Bug#1117563: systemd: /usr/lib/kernel/install.d/55-initrd.install ignores existing initrds
Nick Rosbrook
nick.rosbrook at canonical.com
Wed Oct 8 14:53:18 BST 2025
On Tue, Oct 7, 2025 at 5:25 PM Benjamin Drung <bdrung at ubuntu.com> wrote:
>
> Package: systemd
> Version: 258-1
> Severity: normal
> X-Debbugs-Cc: bdrung at debian.org
>
> Dear Maintainer,
>
> The Dracut 12-uefi and 43-kernel-install test cases fail. dracut-core
> ships /usr/lib/kernel/install.d/50-dracut.install which generates an
> initrd in KERNEL_INSTALL_STAGING_AREA.
> /usr/lib/kernel/install.d/55-initrd.install (coming from
> debian/extra/kernel-install.d/55-initrd.install) then links to the
> initrd in /boot. This results in two initrd being included in the UKI
> and the content of later one overwrites the former one.
>
> Please modify debian/extra/kernel-install.d/55-initrd.install to check
> for the presence of an initrd in KERNEL_INSTALL_STAGING_AREA before
> linking to the initrd in /boot.
>
I wonder if it would be better to try and standardize around
$KERNEL_INSTALL_INITRD_GENERATOR[1].
I see that dracut configures this in tests by setting
`initrd_generator=dracut`[2] in e.g. /etc/kernel/install.conf. But,
dracut-core does not actually ship a kernel/install.conf.d drop-in on
real systems.
Also, dracut-core's 50-dracut.install has:
if [[ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" = "dracut" ]]; then
# We are the initrd generator
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
else
exit 0
fi
which means it continues if $KERNEL_INSTALL_INITRD_GENERATOR is
"dracut" OR unset.
So, I think the following would be a cleaner approach:
(a) dracut-core ships /usr/lib/kernel/install.conf.d/50-dracut.conf
with at least `initrd_generator=dracut` to declare itself as the
initrd generator.
(b) dracut-core's 50-dracut.install is a no-op when
$KERNEL_INSTALL_INITRD_GENERATOR != "dracut".
(c) systemd's 55-initrd.install is a no-op unless
$KERNEL_INSTALL_INITRD_GENERATOR is unset.
What do you think?
-Nick
[1] https://www.freedesktop.org/software/systemd/man/latest/kernel-install.html
[2] https://codesearch.debian.net/search?q=initrd_generator%3D+package%3A%5CQdracut%5CE&literal=1
More information about the Pkg-systemd-maintainers
mailing list