summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-10-09 14:12:16 +0200
committerJonathan Bauer2018-10-09 14:12:16 +0200
commit09eea5953787da4c1e80bfc427383d1b34f8c4b0 (patch)
tree809e875187d445b4280919386c301ee96816de5e
parentautodetect libkmod version to decide which dracut version to install (diff)
downloadsystemd-init-09eea5953787da4c1e80bfc427383d1b34f8c4b0.tar.gz
systemd-init-09eea5953787da4c1e80bfc427383d1b34f8c4b0.tar.xz
systemd-init-09eea5953787da4c1e80bfc427383d1b34f8c4b0.zip
[slx-runmode] support for SLX_SYSTEMD_TARGET
to overwrite the default.target configured within stage4
-rwxr-xr-xbuilder/modules.d/slx-runmode/module-setup.sh13
-rw-r--r--builder/modules.d/slx-runmode/scripts/runmode.sh13
2 files changed, 26 insertions, 0 deletions
diff --git a/builder/modules.d/slx-runmode/module-setup.sh b/builder/modules.d/slx-runmode/module-setup.sh
new file mode 100755
index 00000000..7705ad06
--- /dev/null
+++ b/builder/modules.d/slx-runmode/module-setup.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+check() {
+ # Tell dracut that this module should only be included if it is required
+ # explicitly.
+ return 255
+}
+depends() {
+ echo dnbd3-rootfs
+}
+install() {
+ # unpacking config.tgz should be pre-pivot 10, let's do this afterwards
+ inst_hook pre-pivot 50 "$moddir/scripts/runmode.sh"
+}
diff --git a/builder/modules.d/slx-runmode/scripts/runmode.sh b/builder/modules.d/slx-runmode/scripts/runmode.sh
new file mode 100644
index 00000000..a563486f
--- /dev/null
+++ b/builder/modules.d/slx-runmode/scripts/runmode.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+#
+# SLX_SYSTEMD_TARGET overrides the default.target to boot
+# the stage4 into - required for the so-called 'run mode'.
+
+. /etc/openslx
+
+if [ -n "$SLX_SYSTEMD_TARGET" ]; then
+ SLX_SYSTEMD_TARGET="${SLX_SYSTEMD_TARGET%.target}.target"
+ ln -sf "$SLX_SYSTEMD_TARGET" "$NEWROOT/etc/systemd/system/default.target"
+fi
+
+true