# grep "menuentry" /boot/grub2/grub.cfg
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry ‘CentOS Linux (5.4.123-1.el7.elrepo.x86_64) 7 (Core)‘ --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-5.4.123-1.el7.elrepo.x86_64-advanced-21730aff-e265-4713-9973-d43721b73cb4‘ {
menuentry ‘CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)‘ --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-3.10.0-1160.el7.x86_64-advanced-21730aff-e265-4713-9973-d43721b73cb4‘ {
menuentry ‘CentOS Linux (0-rescue-577567423019484e9466d9570b6fbb17) 7 (Core)‘ --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-0-rescue-577567423019484e9466d9570b6fbb17-advanced-21730aff-e265-4713-9973-d43721b73cb4‘ {
# uname -r
5.4.123-1.el7.elrepo.x86_64
# grub2-set-default ‘CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)‘
# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
原文:https://www.cnblogs.com/yanjieli/p/14839454.html