How do I know which grub version is used and how to configure it?

Jeffrey Walton noloader at gmail.com
Tue Dec 17 18:02:44 UTC 2024


On Tue, Dec 17, 2024 at 11:02 AM Bo Berglund <bo.berglund at gmail.com> wrote:
>
> [...]
> >>$ grep -i firmware -A2 /boot/grub/grub.cfg
> >>menuentry "    UEFI Firmware Settings" --id 'uefi-firmware' {
> >>        fwsetup
> >>}
> >>
> >
> >Will test that  once I get to a stage where I can actually control the content
> >of the boot menu. Seems like the now disappeared Ubuntu Desktop is owning the
> >boot menu. :(
> >
> >I can only reboot the server between 9 and 11 AM CET when it is not running any
> >jobs.
> >
>
> But look what I found when reading through the grub.cfg file:
>
> ### BEGIN /etc/grub.d/30_uefi-firmware ###
> if [ "$grub_platform" = "efi" ]; then
>         fwsetup --is-supported
>         if [ "$?" = 0 ]; then
>                 menuentry 'UEFI Firmware Settings' $menuentry_id_option
> 'uefi-firmware' {
>                         fwsetup
>                 }
>         fi
> fi
> ### END /etc/grub.d/30_uefi-firmware ###
>
> So you mean that This places a line on the boot menu saying:
>
> 'UEFI Firmware Settings'
>
> Is that on advanced or the main menu?
>
> But the environment var $grub_platform seems not to be set in my Ubuntu....

Hmmm... I wonder where $grub_platform coming from? I cannot find it
being set, either.

root at coffee:~# grep -IR grub_platform /etc
/etc/grub.d/00_header:if [ \$grub_platform = efi ]; then
/etc/grub.d/20_linux_xen:        if [ "\$grub_platform" = "pc" -o
"\$grub_platform" = "" ]; then
/etc/grub.d/10_linux:  echo "   if [ x\$grub_platform = xxen ]; then
insmod xzio; insmod lzopio; fi" | sed "s/^/$submenu_indentation/"
/etc/grub.d/10_linux:    if [ \${grub_platform} != pc ]; then
/etc/grub.d/10_linux_zfs:    echo "${submenu_indentation}       if [
\"\${grub_platform}\" = xen ]; then insmod xzio; insmod lzopio; fi"

Jeff




More information about the ubuntu-users mailing list