summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-29 13:40:43 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-30 17:01:41 +0200
commit695ebbaf7fbbcfb9128e2f135efe057fb8558cd9 (patch)
tree4d22881f941f51a56431366487ead85d6fd1aff9
parentmkosi: Use systemd.crash_action=poweroff in integration tests (diff)
downloadsystemd-695ebbaf7fbbcfb9128e2f135efe057fb8558cd9.tar.xz
systemd-695ebbaf7fbbcfb9128e2f135efe057fb8558cd9.zip
mkosi: Override /sbin/init in minimal-base
Required for TEST-13-NSPAWN.
-rwxr-xr-xmkosi.images/minimal-base/mkosi.postinst11
1 files changed, 11 insertions, 0 deletions
diff --git a/mkosi.images/minimal-base/mkosi.postinst b/mkosi.images/minimal-base/mkosi.postinst
new file mode 100755
index 0000000000..c76fb0a011
--- /dev/null
+++ b/mkosi.images/minimal-base/mkosi.postinst
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -e
+
+# We don't use mkosi.extra because /usr/sbin could be a symlink and cp doesn't handle that properly until
+# coreutils 9.5 or newer.
+cat >"$BUILDROOT/sbin/init" <<EOF
+#!/bin/bash
+echo "Hello from dummy init, beautiful day, innit?"
+ip link
+EOF
+chmod +x "$BUILDROOT/sbin/init"