Bug#1151014: grub2: 10_linux should skip incomplete kernel images with pending postinst trigger and missing initrd
Viktor Pashaiev
w.paszajew at gmail.com
Thu Oct 15 20:12:24 BST 2026
Package: grub2
Version: 2.14-4
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu stonking ubuntu-patch
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skip-incomplete-kernel-without-initrd.patch
Type: application/x-diff
Size: 764 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20261015/0dd99e8f/attachment.bin>
More information about the Pkg-grub-devel
mailing list