Como fazer opções de inicialização de kernels alternativos mostradas no menu GRUB de nível superior?

Como fazer opções de inicialização de kernels alternativos mostradas no menu GRUB de nível superior?

Eu uso o Gentoo Linux como meu único sistema operacional, então gostaria de mostrar as opções de inicialização do Gentoo escondidas na entrada "Opções avançadas para Gentoo Linux" no meu nível superior (ou seja, aquele em que o GRUB inicia, um menu de nível inferior seria será o menu mostrado quando eu selecionar e pressionar enter na opção "Opções avançadas para Gentoo Linux") menu GRUB, isso é possível? Eu sei que poderia editar manualmente /boot/grub/grub.cfgpara fazer isso, mas gostaria de uma solução mais permanente para não precisar continuar editando meu /boot/grub/grub.cfgarquivo manualmente sempre que grub-mkconfig -o /boot/grub/grub.cfgele for executado novamente. Como eu gostaria de poder escolher um kernel alternativo assim que o GRUB iniciar, sem ter que encontrar a opção no menu "Opções avançadas para Gentoo Linux". Para ser claro, estou usando o GRUB2 e não o GRUB Legacy.

Responder1

Não estou acostumado com o Gentoo (apenas Ubuntu). Mas aí /etc/grub.d/10_linuxa configuração é feita, usando variáveis ​​definidas no /etc/default/grub(os caminhos podem ser diferentes no Gentoo). Veja man grub-mkconfigou info -f grub -n 'Simple configuration'. Este último diz:

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'.

Então, procure /etc/default/grub(ou onde quer que esteja) e defina GRUB_DISABLE_SUBMENU=y. Em seguida, execute novamente grub-mkconfig.

informação relacionada