1.下载内核软件包
https://mirrors.tuna.tsinghua.edu.cn/kernel/v4.x/
2.解包
[root@kernel ]# tar xf linux-4.19.100.tar.xz
3.安装依赖
[root@kernel ]# yum install ncurses-devel bison flex elfutils-libelf-devel groupinstall "Development Tools" -y
4.配置
[root@kernel ]# cd linux-4.19.100
[root@kernel linux-4.19.100]# make menuconfig
5.编译
[root@kernel linux-4.19.100]# make -j 4
6.安装模块
[root@kernel linux-4.19.100]# make modules_install
[root@kernel linux-4.19.100]# make install
7.更改默认启动核心
将GRUB_DEFAULT=saved 改成 GRUB_DEFAULT=0
[root@kernel ]# vim /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
8.使配置文件生效
[root@kernel ]# grub2-mkconfig -o /boot/grub2/grub.cfg
efault 'CentOS Linux (4.19.100) 7 (Core)' //设置默认启动内核
一灯一暗
评论区