我使用Gentoo Linux作为我的唯一操作系统,因此我想显示隐藏在顶层“ Gentoo Linux的高级选项”条目中的Gentoo引导选项(即,一个GRUB起始于一个较低级别的菜单)是我选择并在“ Gentoo Linux的高级选项”选项上按Enter时显示的菜单)GRUB菜单,这可能吗?我知道我可以手动编辑/boot/grub/grub.cfg
以完成此操作,但是我想要一个更永久的解决方案,因此/boot/grub/grub.cfg
无论何时grub-mkconfig -o /boot/grub/grub.cfg
重新运行我都不必继续手动编辑文件。因为我希望能够在GRUB启动后立即选择备用内核,而不必在“ Gentoo Linux的高级选项”菜单中找到该选项。需要明确的是,我使用的是GRUB2,而不是GRUB Legacy。
我不习惯Gentoo(仅Ubuntu)。但是/etc/grub.d/10_linux
配置已经完成,使用中定义的变量/etc/default/grub
(路径在Gentoo中可能有所不同)。请参阅man grub-mkconfig
或info -f grub -n 'Simple configuration'
。后者说:
The file '/etc/default/grub' controls the operation of
'grub-mkconfig'. It is sourced by a shell script, and so must be valid
POSIX shell input; normally, it will just be a sequence of 'KEY=value'
lines...
'GRUB_DISABLE_SUBMENU'
Normally, 'grub-mkconfig' will generate top level menu entry for
the kernel with highest version number and put all other found
kernels or alternative menu entries for recovery mode in submenu.
For entries returned by 'os-prober' first entry will be put on top
level and all others in submenu. If this option is set to 'y',
flat menu with all entries on top level will be generated instead.
Changing this option will require changing existing values of
'GRUB_DEFAULT', 'fallback' (*note fallback::) and 'default' (*note
default::) environment variables as well as saved default entry
using 'grub-set-default' and value used with 'grub-reboot'.
因此,查找/etc/default/grub
(或无论在何处)并设置GRUB_DISABLE_SUBMENU=y
。然后重新运行grub-mkconfig
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句