如何自定義CentOS7啟動菜單

比如我們想在系統啟動菜單中加入Clover引導菜單(本章只講菜單修改,不涉及文檔操作,Clover文件請自行下載並放到對應位置)。


第一步、要先更新grub2配置模板

在/etc/grub.d/40_custom中追加以下內容:

menuentry "Clover Bootloader" {

if [ "${grub_platform}" == "efi" ]; then

search --file --no-floppy --set=root /EFI/CLOVER/CLOVERX64.efi

chainloader /EFI/CLOVER/CLOVERX64.efi

else

search --file --no-floppy --set=root /usr/standalone/i386/boot0ss

chainloader /usr/standalone/i386/boot0ss

fi

}


第二步、再生成新的grub2配置文件

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg


第三步、重啟系統,在grub2中可以進Clover的菜單。

init 6 #這裡你用“reboot”也是一樣的


分享到:


相關文章: