参考一篇OAI-vEPC搭建的文章,比原先使用的方法看着更好
1.
grep submenu /boot/grub/grub.cfg |
得到如下输出:
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { |
2.
grep gnulinux /boot/grub/grub.cfg |
得到如下的输出
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.16.2-041602-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.2-041602-generic-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.16.2-041602-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.2-041602-generic-init-upstart-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.16.2-041602-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.16.2-041602-generic-recovery-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.15.0-112-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-112-generic-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.15.0-112-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-112-generic-init-upstart-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { menuentry 'Ubuntu, with Linux 4.15.0-112-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-112-generic-recovery-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982' { |
以标红的为例,作为目标内核版本,修改grub config
3.
sudo vim /etc/default/grub |
修改成如下
#GRUB_DEFAULT=0 GRUB_DEFAULT="gnulinux-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982> gnulinux-4.15.0-112-generic-advanced-0f97f6f7-2a4c-4fc4-a79d-263e7f3e8982" |
注释掉第一行,替换为上两步中标黄、标红的内容,然后
sudo update-grub sudo reboot |
重启后查看内核
uname -a |