]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Remove testuser from base/mkosi.postinst.chroot
authorRichard Maw <richard.maw@codethink.co.uk>
Wed, 20 Mar 2024 14:33:17 +0000 (14:33 +0000)
committerRichard Maw <richard.maw@codethink.co.uk>
Mon, 25 Mar 2024 15:51:16 +0000 (15:51 +0000)
The testuser user is only needed for integration tests,
which are used in the system user and this config
can be provided as drop-ins instead of inline in postinst scripts.

mkosi.images/base/mkosi.postinst.chroot
mkosi.images/system/mkosi.extra/usr/lib/sysusers.d/testuser.conf [new file with mode: 0644]
mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/testuser.conf [new file with mode: 0644]

index 26459b165deadda9aa89686a2f7cef07248fa7e8..d1052694aa711012d58f703c8fb16f3904300d4b 100755 (executable)
@@ -65,17 +65,6 @@ fi
 mountpoint -q /etc/resolv.conf && umount /etc/resolv.conf
 rm -f /etc/resolv.conf
 
-. /usr/lib/os-release
-
-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
-
 # sbsign is not available on CentOS Stream
 if command -v sbsign &>/dev/null; then
     # Ensure that side-loaded PE addons are loaded if signed, and ignored if not
diff --git a/mkosi.images/system/mkosi.extra/usr/lib/sysusers.d/testuser.conf b/mkosi.images/system/mkosi.extra/usr/lib/sysusers.d/testuser.conf
new file mode 100644 (file)
index 0000000..9d65a0e
--- /dev/null
@@ -0,0 +1 @@
+u      testuser        4711    "Test User"     /home/testuser
diff --git a/mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/testuser.conf b/mkosi.images/system/mkosi.extra/usr/lib/tmpfiles.d/testuser.conf
new file mode 100644 (file)
index 0000000..1b6ecb6
--- /dev/null
@@ -0,0 +1 @@
+q      /home/testuser  0700    4711    4711