최상위 GRUB 메뉴에 부팅 대체 커널 옵션을 표시하는 방법은 무엇입니까?

최상위 GRUB 메뉴에 부팅 대체 커널 옵션을 표시하는 방법은 무엇입니까?

나는 Gentoo Linux를 유일한 OS로 사용하므로 최상위 수준(예: GRUB가 시작되는 하위 수준 메뉴)의 "Gentoo Linux용 고급 옵션" 항목에 숨겨진 Gentoo 부팅 옵션을 표시하고 싶습니다. "Advanced Options for Gentoo Linux" 옵션에서 선택하고 Enter를 누르면 표시되는 메뉴입니다) GRUB 메뉴, 이것이 가능합니까? 이 작업을 수행하기 위해 수동으로 편집할 수 있다는 것을 알고 있지만 다시 실행할 때마다 파일을 수동으로 /boot/grub/grub.cfg계속 편집할 필요가 없도록 보다 영구적인 솔루션을 원합니다 . GRUB이 시작되자마자 "Advanced Options for Gentoo Linux" 메뉴에서 옵션을 찾을 필요 없이 대체 커널을 선택할 수 있기를 원합니다. 분명히 말하면 저는 GRUB Legacy가 아닌 GRUB2를 사용하고 있습니다./boot/grub/grub.cfggrub-mkconfig -o /boot/grub/grub.cfg

답변1

나는 Gentoo(Ubuntu만 해당)에 익숙하지 않습니다. 하지만 거기에서는 /etc/grub.d/10_linux정의된 변수를 사용하여 구성이 완료됩니다 /etc/default/grub(경로는 젠투에서 다를 수 있습니다). 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.

관련 정보