]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysext: Check for /etc/initrd-release in given --root= tree 39473/head
authorKai Lueke <kailuke@microsoft.com>
Tue, 28 Oct 2025 11:56:45 +0000 (20:56 +0900)
committerKai Lueke <kailuke@microsoft.com>
Tue, 4 Nov 2025 13:10:50 +0000 (22:10 +0900)
commit570eae5007cbf2852f7c314f80224ecf3c828b25
treecd7f83f8d55df19182923c929698e2736fbd304c
parent6649562924f361edca98ce3d015bd7dcda97b076
sysext: Check for /etc/initrd-release in given --root= tree

Both sysext and confext used the host's /etc/initrd-release file even
when --root=/somewhere was specified. A workaround was the
SYSTEMD_IN_INITRD= env var but without knowing this it was quite
confusing. Aside from users validating their extensions, the primary
use case for this to matter is when the extensions are set up from the
initrd where the initrd-release file is present when running but we want
to prepare the extensions for the final system and thus should match
for the right scope.
Make systemd-sysext check for /etc/initrd-release inside the given
--root= tree. An alternative would be to always ignore the
initrd-release check when --root= is passed but this way it is more
consistent. The image policy logic for EFI-loader-passed extensions
won't take effect when --root= is used, though.
src/shared/discover-image.c
src/sysext/sysext.c
test/units/TEST-50-DISSECT.sysext.sh