diff --git a/man/systemd-sysext.xml b/man/systemd-sysext.xml index 8da6bd26ad..f4dd150a53 100644 --- a/man/systemd-sysext.xml +++ b/man/systemd-sysext.xml @@ -108,9 +108,9 @@ accessed. Note that there is no concept of enabling/disabling installed system extension images: all - installed extension images are automatically activated at boot. However, you can place a symlink - to /dev/null in /etc/extensions/ to "mask" an image with - the same name in a folder with lower precedence. + installed extension images are automatically activated at boot. However, you can place an empty directory + named like the extension (no .raw) in /etc/extensions/ to "mask" + an extension with the same name in a system folder with lower precedence. A simple mechanism for version compatibility is enforced: a system extension image must carry a /usr/lib/extension-release.d/extension-release.$name diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index ae6dd0b3d7..0c70459486 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -356,6 +356,19 @@ systemctl is-active testservice-50f.service systemd-dissect --umount "${image_dir}/app0" systemd-dissect --umount "${image_dir}/app1" +# Test that an extension consisting of an empty directory under /etc/extensions/ takes precedence +mkdir -p /var/lib/extensions/ +ln -s /usr/share/app-nodistro.raw /var/lib/extensions/app-nodistro.raw +systemd-sysext merge +grep -q -F "MARKER=1" /usr/lib/systemd/system/some_file +systemd-sysext unmerge +mkdir -p /etc/extensions/app-nodistro +systemd-sysext merge +test ! -e /usr/lib/systemd/system/some_file +systemd-sysext unmerge +rmdir /etc/extensions/app-nodistro +rm /var/lib/extensions/app-nodistro.raw + echo OK >/testok exit 0