#1058818 grub-common: fwsetup --is-supported not supported, boots into setup instead

Package:
grub-common
Source:
grub-common
Description:
GRand Unified Bootloader (common files)
Submitter:
Georg Lukas
Date:
2023-12-17 16:27:04 UTC
Severity:
normal
#1058818#5
Date:
2023-12-16 21:07:02 UTC
From:
To:
The `fwsetup --is-supported` call from grub.d/30_uefi-firmware doesn't
query for support, but instead reboots right into the BIOS setup. This
makes the system unusable, as the command is executed when reading the
config file.

Removing /etc/grub.d/30_uefi-firmware and re-running update-grub
works around the issue.

#1058818#10
Date:
2023-12-16 22:52:47 UTC
From:
To:
This is probably related to
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=26031d3b101648352e4e427f04bf69d320088e77
- if the config change from that commit is combined with an older grub2
binary, the binary will interpret `fwsetup --is-supported` as `fwsetup`
and immediately reboot into the BIOS setup.

This will happen when loading a new config from an old grub2, like the
one bundled with the Debian installer ISO/USB.

This also happens with the grub2 binary that's part of the 2.12~rc1-12
package - maybe it wasn't cleanly compiled? Or I have some older files
installed somewhere?!

#1058818#15
Date:
2023-12-17 16:26:10 UTC
From:
To:
Okay, this is a weirdness caused by how I installed this laptop. I did a
standard Debian install in 2021, then copied the rootfs from my previous
(non-EFI) machine over it.

Therefore I ended up with the modules in /usr/lib/grub/x86_64-efi in
place, but not part of any installed Debian package. Instead, grub-pc
kept the files in /usr/lib/grub/i386-pc up-to-date.

However, grub-install correctly identified the machine as EFI and just
silently used the stale files from /usr/lib/grub/x86_64-efi:

# /usr/sbin/grub-install
Installing for x86_64-efi platform.
Installation finished. No error reported.
#

This caused the 2021 files to be installed to /boot/grub/x86_64-efi/ and
to the EFI partition.

Installing grub-efi-amd64-bin and updating grub got me the
efifwsetup.mod with the --is-supported flag and now everything is good.

Still, maybe it's a good idea to have grub-install check for the
presence of the right / up-to-date package?

Thank you very much.