[Tutorials] deepin20.5+Linux内核5.18稳定版
Tofloor
poster avatar
150******21
deepin
2022-05-24 06:40
Author

linux内核官方网站:www.kernel.org

进入网站后下载该版本。下载点击对应 tarball

2345676543.png

二. 开始前的准备工作

输入下面命令完成安装需要的包

sudo apt-get install libncurses5-dev openssl libssl-dev

sudo apt-get install build-essential openssl

sudo apt-get install pkg-config

sudo apt-get install libc6-dev

sudo apt-get install bison

sudo apt-get install flex

sudo apt-get install libelf-dev

sudo apt-get install zlibc minizip

sudo apt-get install libidn11-dev libidn11

三.内核编译(以下命令全部在root用户下执行)

  1. 将下载好的linux内核解压至/usr/src

#tar -xavf linux-5.18.tar.xz -C /usr/src

#cd /usr/src/linux-5.18

  1. 得到源代码后,将其净化

#make mrproper

  1. 配置要进行编译的内核

#cp /boot/config-'uname -r' ./.config

#make menuconfig

截图_选择区域_20220527120645.png

依次点击load → (.config)OK→ SAVE→ (.config)OK →EXIT load后默认.config (ls -al)

4.编译内核. (15分钟)

#make bzImage -j4 (-j表示加速,4代表着线程数)

5.编译模块.(1小时左右,我电脑好像就用了40min,反正需要等待一定时间)

#make modules -j4

6.安装模块

#make INSTALL_MOD_STRIP=1 modules_install

7.打包

这个命令的作用是把/lib/modules/5.18中对应的.ko驱动打包到initrd.img文件中。

#mkinitramfs /lib/modules/5.18.0-amd64-desktop -o /boot/initrd.img-5.18- amd64-desktop

8.到此为止,构建内核完毕,把内核映象和System.map拷贝到/boot/下

#cp /usr/src/linux-5.18/arch/x86/boot/bzImage /boot/vmlinuz-5.18-amd64-desktop

#cp /usr/src/linux-5.18/System.map /boot/System.map-5.18

  1. 修改grub配置文件/boot/grub/grub.cfg

chmod 777 grub.cfg

update-grub2

重启,启动grub时就可看到自己新的内核

reboot

Reply Favorite View the author
All Replies
2 / 5
To page
jianguo922
deepin
2022-05-25 07:12
#21

感谢分享

Reply View the author
150******21
deepin
2022-05-25 07:54
#22
jjcui8595

安卓环境无法使用

确实,一直提示安卓服务启动超时

Reply View the author
lsd1137
deepin
2022-05-25 15:55
#23

有没有编译好的😁

Reply View the author
jiutian123
deepin
2022-05-25 18:31
#24
150******21

确实,一直提示安卓服务启动超时

截图_20220525102221.png

截图_20220525102851.png

声音搞没了 看驱动没显示异常, 就是把一些amd的给点掉了 看着我的声卡 也是 intel的sweat

Reply View the author
jiutian123
deepin
2022-05-25 18:33
#25
jjcui8595

安卓环境无法使用

应该是哪里做了调整,我的也是 启动超时 当时也没有对安卓环境做选项 默认的

Reply View the author
aurora
deepin
2022-05-25 21:14
#26

点赞,收藏kissing_heart

Reply View the author
Half老刘
deepin
2022-05-26 07:55
#27

编译升级倒是成功了,就是系统盘一下占用达到50多G,不知道该怎么办

Reply View the author
Adeqlrl
deepin
2022-05-26 17:49
#28

我按照流程来的,为什么这里会提示这个问题呢

image.png

Reply View the author
150******21
deepin
2022-05-26 18:41
#29
Adeqlrl

我按照流程来的,为什么这里会提示这个问题呢

image.png

.config文件有问题

Reply View the author
150******21
deepin
2022-05-26 18:44
#30
Half老刘

编译升级倒是成功了,就是系统盘一下占用达到50多G,不知道该怎么办

截图_选择区域_20220526104332.png

按照上面的方法查看一下哪个文件夹最大,自己酌情删除对应文件里面无用的东西就行了

Reply View the author
Adeqlrl
deepin
2022-05-26 22:38
#31
150******21

.config文件有问题

我重新操作过一遍了,还是一样的问题,这是怎么导致的,有什么解决方法吗

Reply View the author
Half老刘
deepin
2022-05-27 06:21
#32
150******21

截图_选择区域_20220526104332.png

按照上面的方法查看一下哪个文件夹最大,自己酌情删除对应文件里面无用的东西就行了

src下面的编译文件有25G,这个留着还有用么

Reply View the author
150******21
deepin
2022-05-27 17:22
#33
Half老刘

src下面的编译文件有25G,这个留着还有用么

有时候编译会用到,我分区太小了,就直接删除了不影响正常使用

Reply View the author
WangZhongyun
deepin
2022-05-27 17:28
#34

截图_2022-05-27_09-22-21.png
如果官方能这样提供测试新内核的工具就好了。测试用户大大增加,也就大大增加反馈问题的可能。

Reply View the author
jiutian123
deepin
2022-05-27 21:27
#35
150******21

确实,一直提示安卓服务启动超时

请教个问题我这样拷贝过去load后,再打开那个图像配置选项,为什么里面的选择项没变化,比如我删除最后四大项 后,进去 依旧有星号选择默认的

Reply View the author
jiutian123
deepin
2022-05-27 21:28
#36
WangZhongyun

截图_2022-05-27_09-22-21.png
如果官方能这样提供测试新内核的工具就好了。测试用户大大增加,也就大大增加反馈问题的可能。

这是什么软件呀 看着挺爽的 一目了然

Reply View the author
150******21
deepin
2022-05-27 23:59
#37
WangZhongyun

截图_2022-05-27_09-22-21.png
如果官方能这样提供测试新内核的工具就好了。测试用户大大增加,也就大大增加反馈问题的可能。

这个看着确实很不错,很方便的感觉

希望官方可以加到系统里

Reply View the author
babyfengfjx
Super Moderator
CQA
2022-05-28 00:49
#38

会玩~

Reply View the author
kirin2020
deepin
2022-05-28 01:40
#39
WangZhongyun

截图_2022-05-27_09-22-21.png
如果官方能这样提供测试新内核的工具就好了。测试用户大大增加,也就大大增加反馈问题的可能。

这个工具真的很好,我在minit下就喜欢用它。

Reply View the author
Hansum东
deepin
2022-05-28 05:07
#40

跟着步骤做,在make install时出现很多错误。

sudo make install

sh ./arch/x86/boot/install.sh 5.18.0-amd64-desktop
arch/x86/boot/bzImage System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.18.0-amd64-desktop /boot/vmlinuz-5.18.0-amd64-desktop
run-parts: executing /etc/kernel/postinst.d/dkms 5.18.0-amd64-desktop /boot/vmlinuz-5.18.0-amd64-desktop
Error! Bad return status for module build on kernel: 5.18.0-amd64-desktop (x86_64)
Consult /var/lib/dkms/amdgpu/5.11.32-1350683/build/make.log for more information.
Error! The directory /var/lib/dkms/asg_xdroid/2.0/source/
does not appear to have module source located within it. Build halted.
Error! The directory /var/lib/dkms/ashmem_xdroid/2.0/source/
does not appear to have module source located within it. Build halted.
Error! Bad return status for module build on kernel: 5.18.0-amd64-desktop (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.273+bdcom/build/make.log for more information.
Error! The directory /var/lib/dkms/binder_xdroid/2.0/source/
does not appear to have module source located within it. Build halted.
Error! Bad return status for module build on kernel: 5.18.0-amd64-desktop (x86_64)
Consult /var/lib/dkms/rtw89/1.0.2/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.18.0-amd64-desktop /boot/vmlinuz-5.18.0-amd64-desktop
update-initramfs: Generating /boot/initrd.img-5.18.0-amd64-desktop
W: Possible missing firmware /lib/firmware/amdgpu/ip_discovery.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vega10_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi12_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_8_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_8_toc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_8_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_5_ta.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_5_toc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_5_asd.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/aldebaran_cap.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_7_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/gc_10_3_6_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sdma_5_2_7.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/sdma_5_2_6.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vcn_3_1_2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/dcn_3_1_6_dmcub.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/dcn_3_1_5_dmcub.bin for module amdgpu
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
nor crypto modules. If that's on purpose, you may want to uninstall the
'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
integration and avoid this warning.
setupcon is missing. Please install the 'console-setup' package.
W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/cml_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/dg1_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_guc_69.0.3.bin for module i915
W: Possible missing firmware /lib/firmware/i915/adlp_dmc_ver2_14.bin for module i915
W: plymouth: The plugin label.so is missing, the selected theme might not work as expected.
W: plymouth: You might want to install the plymouth-themes package to fix this.
I: The initramfs will attempt to resume from /dev/sda6
I: (UUID=4b3fbaee-be48-4e33-bf42-07d6c84d87cc)
I: Set the RESUME variable to override this.
live-boot: core filesystems devices utils udev blockdev dns.

Reply View the author
2 / 5
To page