[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
4 / 5
To page
186******75
deepin
2022-08-21 15:47
#61

第一步为什么要把将下载好的linux内核解压至/usr/src,其他地方不可以吗?

Reply View the author
186******75
deepin
2022-08-21 20:17
#62
jjcui8595

网上有的教程是这样编译和安装的,看起来比较简单。不知道跟你发的教程在最终效果上有什么不同?请指点一下

sudo make -j12
sudo make modules_install
sudo make install

最后怎么打成deb包

Reply View the author
jjcui8595
Moderator
2022-08-21 22:32
#63
186******75

最后怎么打成deb包

自己编译的内核不一定适合别人的机器,所以直接安装了,没有打包

Reply View the author
186******75
deepin
2022-08-22 23:47
#64

按你的方法编辑了5.18.18,5.19.2和4.19.225三个内核都能启动,5.18.18,5.19.2这两个内核启动后没有wifi和声音,4.19.225有wifi但没有声音,问你遇到这样的问题是怎么解决的?先谢谢了

Reply View the author
晚秋(lateautumn)
Moderator
2022-09-29 23:24
#65

升级内核这么复杂呀,还想升级5.19内核呢!tail

Reply View the author
xuqi
deepin testing team
2022-10-09 22:31
#66

like

Reply View the author
clown_commando
deepin
2022-10-14 01:15
#67

使用这个教程,成功升级了6.0.1内核。

Reply View the author
136******53
deepin
2022-11-06 23:05
#68

新手没必要整,整出问题,肯定自己解决不了。

喜欢折腾的捣鼓吧!做好自己折腾不好的准备!

Reply View the author
186******25
deepin
2022-11-11 15:42
#69

感谢分享,新手学习中

Reply View the author
zhenyusky
deepin
2022-11-17 05:43
#70
whoam1

主线5.18版本我的amd-5800H机型存在着待机无法唤醒,桌面显示异常的问题

我的matebook14笔记本也存在无法唤醒的问题

Reply View the author
whoam1
deepin
2022-11-17 16:23
#71
zhenyusky

我的matebook14笔记本也存在无法唤醒的问题

可能amd的笔记本都存在这个问题

Reply View the author
zhoubin-Chinese
deepin
2022-12-16 18:32
#72

Reply View the author
158******91
deepin
2022-12-19 04:45
#73
whoam1

可能amd的笔记本都存在这个问题

我还有屏幕亮度调不了的问题,解决好的滴滴我一下呜呜呜呜

Reply View the author
152******72
deepin
2022-12-27 16:53
#74

👍

Reply View the author
xiguayuyichao
deepin
2023-02-03 05:32
#75
It has been deleted!
xiguayuyichao
deepin
2023-02-03 05:42
#76
It has been deleted!
xiguayuyichao
deepin
2023-02-03 08:01
#77

image.png

Reply View the author
186******79
deepin
2023-03-01 21:56
#78

菜鸟弱弱的问一句,为什么要自己编译这个内核 ,,不能直接安装最新版的系统么?还是说每次内核更新了都需要这样处理一次,,,

Reply View the author
某一个夜晚
deepin
2023-03-08 03:20
#79
186******79

菜鸟弱弱的问一句,为什么要自己编译这个内核 ,,不能直接安装最新版的系统么?还是说每次内核更新了都需要这样处理一次,,,

对小白用户还是略显复杂了,就没有人开发出一个工具来编译吗?

Reply View the author
365
deepin
2024-02-02 13:33
#80
It has been deleted!
4 / 5
To page