From 1abe15fe9d0cf0b5c4c0f4f6ae7d3affd611446f Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Tue, 16 Aug 2022 12:29:12 +0200 Subject: [PATCH] man: Correct information on sysext masking While I had tested that a symlink to /dev/null works to "mask" a sysext I must have gotten something wrong and thus the instructions in 519c2f0d6b343d140f7e08e3eb0f46708c023b4a don't work. What works, at least at the moment, is to instead have an empty directory with the extension name under /etc/extensions/. Correct the info in the man page and add a test for it. --- man/systemd-sysext.xml | 6 +++--- test/units/testsuite-50.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) 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 -- 2.25.1