编译内核5.4.6版本基于centos7.8版本

本文档详细介绍了如何在CentOS7系统中从官方源下载Linux5.4.6内核,安装必要的依赖包,然后进行内核配置,包括修改内核名称和添加NTFS文件系统支持。接着,指导读者如何编译内核、安装模块和内核核心,并设置默认启动内核。最后,验证新内核的安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.下载内核

https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/

2.安装依赖包

#安装依赖包
yum -y install openssh-devel elfutils-libelf-devel bc #安装开发工具包组
yum -y groupinstall "development tools"
#安装ncurse-devel包 (make menuconfig 文本界面窗口依赖包) yum -y install ncurses-devel
#编译依赖的安装包
yum install openssl-devel -y

3.解压、配置

[root@centos7 ~]#tar xf linux-5.4.6.tar.xz -C /usr/src
[root@centos7 ~]#cd /usr/src
[root@centos7 src]#ln -sv linux-5.4.6 linux
[root@centos7 src]#cd linux
[root@centos7 linux]#cp /boot/config-$(uname -r) ./.config
[root@centos7 linux]#make menuconfig

(1)修改内核名称

General setup --->local version -append to kernel release

 

 

 (2)新添加NTFS文件系统支持模块
File systems --->DOS/FAT/NT Filesystems --->NTFS file system support

 

 

 4.编译

[root@centos7 linux]#make -j `cat /proc/cpuinfo | grep 'model name'|wc -l` #时间较长,具体时间根据硬件性能决定

.................
#编译安装模块
[root@centos7 linux]# make modules_install
#安装内核核心文件
[root@centos7 linux]# make install
#更换内核
[root@centos7 linux]# egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' #查看内核版本
CentOS Linux (5.4.6_hanweize.cn_5.4.6) 7 (Core)
CentOS Linux (3.10.0-1127.el7.x86_64) 7 (Core)
[root@centos7 linux]# grub2-set-default 0
#重启
[root@centos7 linux]# reboot

测试

[root@centos7 ~]# uname -r 5.4.6_hanweize.cn_5.4.6

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zhu1241jie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值