From 379f5843b223263fc3c205b3153cb424334196c8 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 6 Mar 2018 14:29:07 +0100 Subject: new module to mount newroot's /tmp pre-pivot Uses SLX_TMP_PARTITION_IDENTIFIER to mount $NEWROOT/tmp --- builder/modules.d/openslx_tmp_mount/module-setup.sh | 13 +++++++++++++ .../openslx_tmp_mount/scripts/mount_newroot_tmp.sh | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100755 builder/modules.d/openslx_tmp_mount/module-setup.sh create mode 100755 builder/modules.d/openslx_tmp_mount/scripts/mount_newroot_tmp.sh 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 -- cgit v1.2.3-55-g7522