]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: Correct information on sysext masking
authorKai Lueke <kailuke@microsoft.com>
Tue, 16 Aug 2022 10:29:12 +0000 (12:29 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 16 Aug 2022 19:43:51 +0000 (20:43 +0100)
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
test/units/testsuite-50.sh

index 8da6bd26ad93f7115878418a6b995191d41b38ba..f4dd150a538eb62da08f11d2eabf0e47de23d113 100644 (file)
     accessed.</para>
 
     <para>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 <filename>/dev/null</filename> in <filename>/etc/extensions/</filename> to "mask" an image with
-    the same name in a folder with lower precedence.</para>
+    installed extension images are automatically activated at boot. However, you can place an empty directory
+    named like the extension (no <filename>.raw</filename>) in <filename>/etc/extensions/</filename> to "mask"
+    an extension with the same name in a system folder with lower precedence.</para>
 
     <para>A simple mechanism for version compatibility is enforced: a system extension image must carry a
     <filename>/usr/lib/extension-release.d/extension-release.<replaceable>$name</replaceable></filename>
index ae6dd0b3d7eba109201599379150a30fa957a266..0c704594860b2d6a76059367537e4acf0bc156aa 100755 (executable)
@@ -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