on  it road.com

解决方案

这可以使用 GRUB 中的“title”选项轻松完成。
修改 /boot/grub/grub.conf 以获得自定义标题,如下所示:

title Place your custom tile here
        root (hd0,0)
       kernel /vmlinuz-2.6.32-220.7.1.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-220.7.1.el6.x86_64.img

例如,在我们的例子中,我们可以拥有 /boot/grub/grub.conf 文件,如下所示:

# cat /boot/grub/grub.conf
default=0
timeout=5                                 
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Choose this boot option to run APP01.
        root (hd0,0)
       kernel /vmlinuz-2.6.32-220.7.1.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-220.7.1.el6.x86_64.img
title Choose this boot option to run APP02.
        root (hd0,0)
        kernel /vmlinuz-2.6.32-220.4.2.el6.x86_64 ro root=/dev/mapper/vg_vm27-lv_root rd_LVM_LV=vg_vm27/lv_root rd_LVM_LV=vg_vm27/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
        initrd /initramfs-2.6.32-220.4.2.el6.x86_64.img

问题

我们运行双引导 CentOS/RHEL 6 并为 2 个不同的应用程序使用 2 个内核。
我们如何为每个应用程序显示自定义内核名称,如下所示:

CentOS 6.x
   Choose this boot option to run APP01.
CentOS 6.y
   Choose this boot option to run APP02.
在 CentOS/RHEL 6 GRUB 菜单中如何显示自定义的内核名称

如何在 GRUB 菜单中暂停引导过程以选择内核

我们可能还希望有时间在 GRUB 菜单上选择内核。
在某些情况下,人们更喜欢手动选择内核。
为此,请在 /boot/grub/grub.conf 文件中注释“超时”选项,以在 GRUB 菜单中暂停引导过程。

例如:

# vim /boot/grub/grub.conf file.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_vm27-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=0
#timeout=5
....
日期:2020-09-17 00:12:38 来源:oir作者:oir