#1151014 grub2: 10_linux should skip incomplete kernel images with pending postinst trigger and missing initrd

Package:
grub2
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (dummy package)
Submitter:
Viktor Pashaiev
Date:
2026-10-15 19:13:03 UTC
Severity:
normal
Tags:
#1151014#5
Date:
2026-10-15 19:12:24 UTC
From:
To:
Dear Maintainer,

When a kernel post-installation hook fails (e.g. DKMS module build failure),
the kernel package remains half-configured: vmlinuz is installed and a trigger
marker (/usr/lib/linux/triggers/<version>) is present, but no matching initrd is
generated.

A subsequent update-grub invocation (such as during removal of an older kernel)
scans /boot and generates a boot menuentry for the incomplete kernel without an
initrd line. On systems where storage drivers (NVMe, SATA, SAS) are built as
modules, booting this entry causes an immediate kernel panic (unable to mount root).

In /etc/grub.d/10_linux, when inspecting a kernel where no initrd was found
(test -z "${initrd_real}"), we should check if a pending kernel trigger marker
exists in /usr/lib/linux/triggers/${version} or /usr/lib/linux/triggers/${alt_version}.
If the trigger marker is present, skip generating a boot menuentry for that kernel.

Attached is a patch against Debian grub2 2.14-4 implementing this check.

Ubuntu tracking bug: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2141741

Thanks,
Viktor Pashaiev