]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Add testuser and tar to system image
authorRichard Maw <richard.maw@codethink.co.uk>
Mon, 27 Nov 2023 17:50:49 +0000 (17:50 +0000)
committerRichard Maw <richard.maw@codethink.co.uk>
Wed, 13 Dec 2023 17:55:46 +0000 (17:55 +0000)
The integration tests are installed into the image
with the intention that it should be possible to run those tests,
but those tests require the named user testuser
and tar is needed for machined-import

mkosi.images/system/mkosi.conf
mkosi.images/system/mkosi.postinst.chroot

index 7612f221cc50783ed205721905fc45565fd458c7..6948f8eb7ce8eb65b6a1f4e2220b0997b26ae4db 100644 (file)
@@ -33,6 +33,7 @@ Packages=
         strace
         systemd
         tmux
+        tar
         tree
         udev
         util-linux
index e0728de27985e231b7983e0fe3b53cbc810ddd78..0fec067ebb2a6c8d80c8f7d01d95b7c0c236e63a 100755 (executable)
@@ -83,3 +83,12 @@ if [ "$ID" = "centos" ] && [ "$VERSION" = "8" ]; then
     alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
     alternatives --set python3 /usr/bin/python3.9
 fi
+
+mkdir -p /usr/lib/sysusers.d
+cat >/usr/lib/sysusers.d/testuser.conf <<EOF
+u      testuser        4711    "Test User"     /home/testuser
+EOF
+mkdir -p /usr/lib/tmpfiles.d
+cat >/usr/lib/tmpfiles.d/testuser.conf <<EOF
+q      /home/testuser  0700    4711    4711
+EOF