[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
3 / 5
To page
Hansum东
deepin
2022-05-28 05:13
#41

live-boot: core filesystems devices utils udev blockdev dns.
run-parts: executing /etc/kernel/postinst.d/reconfigure-dde-daemon 5.18.0-amd64-desktop /boot/vmlinuz-5.18.0-amd64-desktop
fix systemd/logind config
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.18.0-amd64-desktop /boot/vmlinuz-5.18.0-amd64-desktop
get rootb uuid error: failed to get "rootb" uuid
正在生成 grub 配置文件 ...
找到主题:/boot/grub/themes/deepin/theme.txt
Found background image: /boot/grub/themes/deepin/background.jpg
找到 Linux 镜像:/boot/vmlinuz-5.18.0-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.18.0-amd64-desktop
找到 Linux 镜像:/boot/vmlinuz-5.17.0-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.17.0-amd64-desktop
找到 Linux 镜像:/boot/vmlinuz-5.15.24-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.15.24-amd64-desktop
找到 Linux 镜像:/boot/vmlinuz-5.15.6-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.15.6-amd64-desktop
找到 Linux 镜像:/boot/vmlinuz-5.10.101-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.10.101-amd64-desktop
找到 Linux 镜像:/boot/vmlinuz-5.10.83-amd64-desktop
找到 initrd 镜像:/boot/initrd.img-5.10.83-amd64-desktop
找到 Windows Boot Manager 位于 /dev/nvme0n1p3@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
完成

Reply View the author
jjcui8595
Moderator
2022-05-28 14:14
#42
Half老刘

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

编译产生了临时文件,删除就行了

Reply View the author
LLLLLL.
deepin
2022-05-28 23:07
#43

uos怎么升级??

Reply View the author
150******21
deepin
2022-05-29 05:13
#44
LLLLLL.

uos怎么升级??

没有用过啊,应该一样的,可以试试

Reply View the author
Hansum东
deepin
2022-05-29 18:35
#45
150******21

https://bbs.deepin.org/phone/zh/post/237612

效果

我没编译成功,在最后一步,make install 时出错了。

能发你的内核上来用用吗?

Reply View the author
readmy
deepin
2022-05-30 16:19
#46
Hansum东

我没编译成功,在最后一步,make install 时出错了。

能发你的内核上来用用吗?

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

Reply View the author
低频思考者
deepin
2022-05-30 17:00
#47
Hansum东

我没编译成功,在最后一步,make install 时出错了。

能发你的内核上来用用吗?

别人编译的内核不见得适用你的机器。深度官方内核为了适应各种不同情况,内核比较臃肿。自己编译内核是了解操作系统运作的好途径。如果有时间有兴趣,花一两个月反复尝试,你将得到一个自己机器的专有内核,可以充分发挥机器性能,减少无效内存、存储占用。

Reply View the author
xuqi
deepin testing team
2022-06-01 22:02
#48

已收藏applaud

Reply View the author
pangju
deepin
2022-06-05 15:11
#49
jiutian123

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

Manjaro(一个发行版)的自带软件

Reply View the author
130******20
deepin
2022-06-06 01:24
#50

反复折腾,编译成功,但最后grub那出了问题,新内核一直启动不起来,只能进高级中选旧内核启动。

如果没记错是在update grub那步出现了一句failed 无效的UUID。

和41楼的朋友遇到的情况一样。

不知道41楼的朋友最后咋解决的。

我参照正常安装能启动的grub对更新内核后的grub进行了手动修改,也不行。以我的知识解决不了这事了,就放弃了,重新安装个20.6,再没折腾内核。

Reply View the author
低频思考者
deepin
2022-06-06 19:10
#51
130******20

反复折腾,编译成功,但最后grub那出了问题,新内核一直启动不起来,只能进高级中选旧内核启动。

如果没记错是在update grub那步出现了一句failed 无效的UUID。

和41楼的朋友遇到的情况一样。

不知道41楼的朋友最后咋解决的。

我参照正常安装能启动的grub对更新内核后的grub进行了手动修改,也不行。以我的知识解决不了这事了,就放弃了,重新安装个20.6,再没折腾内核。

别放弃。启动问题一般是编译配置选项没有选好。你可以从官方配置文件出发,一点点改,一定会配置一个好用的你的机器专属内核。

Reply View the author
ThinkYoung
deepin
2022-06-08 07:23
#52
It has been deleted!
WangZhongyun
deepin
2022-06-08 19:19
#53
ThinkYoung It has been deleted!

这个是arch系manjaro里的内核管理程序,deepin不能直接用。不过方式应该就是:先把不同内核版本相关包先入库,安装内核的相关命令脚本完整形成,再套个图形界面进行管理。只是我不是专业人员。所以还需开发来完成这项任务。如何反馈?

Reply View the author
执笔望月
deepin
2022-06-09 04:14
#54

楼主 ,用5.18也没有遇到安卓服务启动超时的问题?

Reply View the author
150******21
deepin
2022-06-09 20:44
#55
执笔望月

楼主 ,用5.18也没有遇到安卓服务启动超时的问题?

遇到了

Reply View the author
橘小黑
deepin
2022-07-03 19:01
#56

所有过程都通过了~但是无法启动!!选择高级启动 5.18内核报错:

错误:/vmlinuz-5.18.8-amd64-desktop has invalid signature

Reply View the author
sky139
deepin
2022-08-01 04:04
#57

有没有编译好的5.18直接下载的 ?

Reply View the author
打工人下人
deepin
2022-08-13 02:21
#58
jiutian123

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

这个改成这样

cp /boot/config-5.10.0-amd64-desktop -r ./.config

单引号想要不要去掉?谢谢

这个应该是反引号,不是单引号

Reply View the author
186******75
deepin
2022-08-21 15:40
#59
jiutian123

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

这个改成这样

cp /boot/config-5.10.0-amd64-desktop -r ./.config

单引号想要不要去掉?谢谢

这一步的目的的把现在内核的设置传给编辑新内核吗?

Reply View the author
186******75
deepin
2022-08-21 15:41
#60

第三步的目的是什么?

Reply View the author
3 / 5
To page