summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-03-06 14:29:07 +0100
committerJonathan Bauer2018-03-06 14:29:07 +0100
commit379f5843b223263fc3c205b3153cb424334196c8 (patch)
tree8ca4d88e55fc24e0172a589de170e85cbde75630
parentnew module to format newroot's /tmp (diff)
downloadsystemd-init-379f5843b223263fc3c205b3153cb424334196c8.tar.gz
systemd-init-379f5843b223263fc3c205b3153cb424334196c8.tar.xz
systemd-init-379f5843b223263fc3c205b3153cb424334196c8.zip
new module to mount newroot's /tmp pre-pivot
Uses SLX_TMP_PARTITION_IDENTIFIER to mount $NEWROOT/tmp
-rwxr-xr-xbuilder/modules.d/openslx_tmp_mount/module-setup.sh13
-rwxr-xr-xbuilder/modules.d/openslx_tmp_mount/scripts/mount_newroot_tmp.sh9
2 files changed, 22 insertions, 0 deletions
diff --git a/builder/modules.d/openslx_tmp_mount/module-setup.sh b/builder/modules.d/openslx_tmp_mount/module-setup.sh
new file mode 100755
index 00000000..77c8f40b
--- /dev/null
+++ b/builder/modules.d/openslx_tmp_mount/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() {
+ inst_hook pre-mount 50 "$moddir/scripts/format_newroot_tmp.sh"
+}
diff --git a/builder/modules.d/openslx_tmp_mount/scripts/mount_newroot_tmp.sh b/builder/modules.d/openslx_tmp_mount/scripts/mount_newroot_tmp.sh
new file mode 100755
index 00000000..48e733c7
--- /dev/null
+++ b/builder/modules.d/openslx_tmp_mount/scripts/mount_newroot_tmp.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+. /etc/openslx
+
+if [ -n "$SLX_TMP_PARTITION_IDENTIFIER" ]; then
+ mount -t auto "/dev/disk/by-partlabel/$SLX_TMP_PARTITION_IDENTIFIER" "$NEWROOT/tmp"
+ chmod a+rwxt "$NEWROOT/tmp"
+ # TODO fstab
+fi