生态社区

技术文档

银河麒麟服务器升级内核,更改内核启动项

发布时间:2022-03-02    浏览次数:3592次    作者:湖南省计算产业生态创新中心 (长沙)

升级内核,更改内核启动项

环境信息:

v10服务器版本通用,以 24.2 内核版本作为参考,灵活处理

实施步骤:

查看当前启动

[root@localhost ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/efi/EFI/kylin/grub.cfg

0 : Kylin Linux Advanced Server (4.19.90-23.6.v2101.ky10.aarch64) V10 (Tercel)

1 : Kylin Linux Advanced Server (0-rescue-9f2c76dc926340dd83f51659b9dab205) V10 (Tercel)

2 : System setup

 

[root@localhost ~]# grub2-editenv list

saved_entry=Kylin Linux Advanced Server (4.19.90-23.6.v2101.ky10.aarch64) V10 (Tercel)

boot_success=0

提取以下包

[root@localhost ~]# ll kernel-*

-rw------- 1 root root  2372320  516 21:17 kernel-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root 45828624  516 21:33 kernel-core-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root 14518888  517 15:11 kernel-devel-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root  3572696  517 14:57 kernel-headers-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root 12667124  516 21:33 kernel-modules-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root  2834688  517 16:56 kernel-modules-extra-4.19.90-24.2.v2101.ky10.aarch64.rpm

-rw------- 1 root root  2445944  517 16:56 kernel-modules-internal-4.19.90-24.2.v2101.ky10.aarch64.rpm

安装内核与模块包 (不可一个个安装)

[root@localhost ~]# rpm -ivh kernel-core-4.19.90-24.2.v2101.ky10.aarch64.rpm kernel-modules-4.19.90-24.2.v2101.ky10.aarch64.rpm kernel-4.19.90-24.2.v2101.ky10.aarch64.rpm kernel-modules-extra-4.19.90-24.2.v2101.ky10.aarch64.rpm kernel-modules-internal-4.19.90-24.2.v2101.ky10.aarch64.rpm

升级develheaders

[root@localhost ~]# rpm -Uvh kernel-devel-4.19.90-24.2.v2101.ky10.aarch64.rpm

[root@localhost ~]# rpm -Uvh kernel-headers-4.19.90-24.2.v2101.ky10.aarch64.rpm

查看默认启动项

[root@localhost ~]# grub2-editenv list

saved_entry=Kylin Linux Advanced Server (4.19.90-24.2.v2101.ky10.aarch64) V10 (Tercel)

boot_success=0

如果已设置为升级后的内核,则执行重启服务器。如果没有则手动设置

设置默认启动项

[root@localhost ~]#  grub2-set-default kernel-4.19.90-24.2.v2101.ky10.aarch64.rpm

#查看当前启动的项                                          

[root@localhost ~]# grub2-editenv list

saved_entry=kernel-4.19.90-24.2.v2101.ky10.aarch64.rpm

boot_success=0

重启服务器确认默认内核版本

###重启

[root@localhost ~]# reboot

###确认版本

[root@localhost ~]# uname -r

4.19.90-24.2.v2101.ky10.aarch64