<div dir="ltr"><br>Package: grub-common<br>Version: 2.12-9+deb13u1<br>Severity: important<br><br>Dear Maintainer,<br><br>During an in-place upgrade from Debian 12 (bookworm) to Debian 13 (trixie)<br>on a Hyper-V Generation 1 virtual machine (BIOS/MBR, no EFI firmware),<br>the system was rendered unbootable after grub-common was upgraded and<br>update-grub was run as part of the post-install process.<br><br>The root cause is that /etc/grub.d/30_uefi-firmware is installed executable<br>by grub-common and is unconditionally executed by grub-mkconfig regardless<br>of whether the running system has UEFI firmware. On this BIOS/MBR system,<br>the script generated a "UEFI Firmware Settings" entry in grub.cfg which<br>caused the boot process to stall after the GRUB banner, leaving the system<br>unbootable.<br><br>I expect this is reproducible on any BIOS/MBR system where grub-common is installed,<br>including legacy-mode virtual machines and older physical hardware, whenever<br>update-grub is run.<br><br>The script /etc/grub.d/30_uefi-firmware contains a check for $grub_platform<br>being "efi", however this is a GRUB environment variable evaluated at boot<br>time, not at config-generation time. It therefore does not prevent the<br>problematic menu entry from being written into grub.cfg on BIOS systems.<br><br>The fix is straightforward — add an OS-level guard as the first line of<br>/etc/grub.d/30_uefi-firmware:<br><br>  [ -d /sys/firmware/efi ] || exit 0<br><br>This check is evaluated when grub-mkconfig runs, which is the correct<br>moment. If /sys/firmware/efi does not exist, the system is not UEFI and<br>the script should take no action.<br><br>Workaround applied on the affected system:<br><br>  chmod -x /etc/grub.d/30_uefi-firmware<br><br>Further to the workaround... to prevent future grub-common upgrades from restoring the execute bit and<br>reintroducing the problem, the following apt hook was also added:<br><br>  echo 'DPkg::Post-Invoke {"chmod -x /etc/grub.d/30_uefi-firmware || true;";};' \<br>    > /etc/apt/apt.conf.d/99-disable-uefi-grub-entry<br><br>Note: This bug is distinct from #1058818, which concerns fwsetup<br>--is-supported not being recognised by older GRUB binaries on UEFI systems.<br>This bug concerns the script running at all on non-UEFI systems during<br>config generation.<br><br>-- System Information:<br>Debian Release: 13 (trixie)<br>Architecture: amd64<br>Kernel: Linux 6.12.74+deb13+1-amd64<br>Hypervisor: Microsoft Hyper-V Generation 1 (BIOS/MBR, no EFI)</div>