Deepin V20 编译使用最新版本5.6.12内核方法
Tofloor
poster avatar
kirin2018
deepin
2020-05-15 00:14
Author

一、准备好编译需要的工具
automake、make、g++(包含gcc)、bison、flex、libelf-dev、libssl-dev、bc。

懒人模式三条命令:
sudo apt install -y automake make g++ bison flex libelf-dev libssl-dev bc
sudo apt install build-essential libncurses5-dev -y
sudo apt-get build-dep linux

二、步骤
1、先到清华大学镜像源:https://mirror.tuna.tsinghua.edu.cn/kernel/v5.x/,
下载内核源码 linux-5.6.12.tar.gz文件,

2、解压(提取)tar zxvf kernel-5.6.12.tar.gz,
               cd linux-5.6.12
   进入内核源码文件夹目录。

3、配置:

make menuconfig

Tab 键选择 Save 即可。

4、编辑一下生成的隐藏文件 .config,把以下这行KEY的值改成空:

CONFIG_SYSTEM_TRUSTED_KEYS=""

5、然后,禁用签名验证,下面两条命令:

scripts/config --disable MODULE_SIG
scripts/config --disable DEBUG_INFO

6、最后,生成 deb 包:

make deb-pkg

7、deb 包生成完了就安装:

dpkg -i linux-headers-*_amd64.deb
dpkg -i linux-image-*_amd64.deb
dpkg -i linux-libc-dev*.deb

8、重启 deepin V20,新版本5.6.12内核就可以用了。

############################################################
三、其它事项

重启,检查新内核:
uname -r

删除旧内核:
sudo apt remove --purge linux-image-5.3.0-3-amd64

不确定的话可以先查看有哪些旧内核:
dpkg -l | grep linux-image | awk '{print$2}'

此命令我得到两条结果:
linux-image-5.3.0-3-amd64-unsigned
linux-image-5.6.12
linux-image-deepin-amd64
注意:惊喜发现自动删除了系统原来自带的第一个4.19.*旧版本内核了,只保留最新的两个。


Reply Favorite View the author
All Replies
3 / 3
To page
SamLukeYes
deepin
2020-07-28 04:19
#41
https://bbs.deepin.org/post/194265
sudo apt-get build-dep linux
[sudo] yyb 的密码:
正在读取软件包列表... 完成

看25楼,我已经解答过这个问题了
Reply View the author
china9494520
deepin
2020-07-28 18:04
#42
https://bbs.deepin.org/post/194265
看25楼,我已经解答过这个问题了

是把deb-src前面的#号去掉吗?还是不管用啊
Reply View the author
SamLukeYes
deepin
2020-07-28 18:18
#43
https://bbs.deepin.org/post/194265
是把deb-src前面的#号去掉吗?还是不管用啊

那应该是 deepin 的软件源里没有这个源码包了,还是用预编译的吧
Reply View the author
何来
deepin
2020-07-29 10:19
#44
5.7比较好,不要喜新厌旧
Reply View the author
qq4945286
deepin
2020-07-29 18:07
#45

出错!!!!!

~/Downloads/linux-5.7$ sudo apt build-dep linux
正在读取软件包列表... 完成
E: 您必须在 sources.list 中指定代码源(deb-src) URI
Reply View the author
22******39@qq.com
deepin
2020-07-30 17:02
#46
make -j8 爽歪歪
Reply View the author
3 / 3
To page