diff options
| author | torben | 2015-11-12 15:39:14 +0100 |
|---|---|---|
| committer | torben | 2015-11-12 15:39:14 +0100 |
| commit | e45f380b9caa3129ef0b8d6ea71aa7a2dcc9da9f (patch) | |
| tree | 0083ac147f85db1be5fe7babed4e9b51b13bb810 /builder/dnbd3-rootfs/hooks | |
| parent | Adding persistent storage support. (diff) | |
| download | systemd-init-e45f380b9caa3129ef0b8d6ea71aa7a2dcc9da9f.tar.gz systemd-init-e45f380b9caa3129ef0b8d6ea71aa7a2dcc9da9f.tar.xz systemd-init-e45f380b9caa3129ef0b8d6ea71aa7a2dcc9da9f.zip | |
Removes deprecated files.
Diffstat (limited to 'builder/dnbd3-rootfs/hooks')
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/pre-mount/mount-qcow.sh | 49 | ||||
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh | 7 | ||||
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/pre-pivot/mount-tmp.sh | 24 |
3 files changed, 14 insertions, 66 deletions
diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/mount-qcow.sh b/builder/dnbd3-rootfs/hooks/pre-mount/mount-qcow.sh deleted file mode 100755 index 290bc213..00000000 --- a/builder/dnbd3-rootfs/hooks/pre-mount/mount-qcow.sh +++ /dev/null @@ -1,49 +0,0 @@ -############################################################################### -# CHECKS -# - -SETUP_ROOTFS_SCRIPT="/sbin/setup-qcow2" - -if [ ! -e "${SETUP_ROOTFS_SCRIPT}" ]; then - warn "No such file of directory: ${SETUP_ROOTFS_SCRIPT}" - emergency_shell -n "Error in $0" - return 1 -fi - -if [ ! -x "${SETUP_ROOTFS_SCRIPT}" ]; then - warn "Cannot execute: ${SETUP_ROOTFS_SCRIPT}" - emergency_shell -n "Error in $0" - return 1 -fi - -# -# END CHECKS -############################################################################### - -############################################################################### -# MAIN CODE -# - -# ok, let's source the setup script -if ! . ${SETUP_ROOTFS_SCRIPT} ; then - warn "Could not source: ${SETUP_ROOTFS_SCRIPT}" - emergency_shell -n "Error in $0" - return 1 -fi - -# just go over the functions in the right order ;-) -for fun in connect_dnbd3 create_qcow export_qcow connect_qcow; do - if ! $fun; then - # something failed, drop a shell for debugging - warn "'$fun' failed with: $?" - emergency_shell -n "Error in $fun" - return 1 - fi -done - -# all good, we are done -return 0 - -# -# END MAIN CODE -############################################################################### diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh index 41e2d387..6e6e98dc 100755 --- a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh +++ b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh @@ -24,11 +24,8 @@ local read_only_partition="$(utils_create_partition_via_offset "$nbd_device" \ # TODO implement persistent available indicator. local persistent="N" # 'P' for persistent storage, 'N' for not persistent if true; then - modprobe brd max_part=1 rd_size=524288 - local writable_device="/dev/ram0" && \ - #mknod --mode 660 "$writable_device" b 1 1 && \ - #chown root:disk "$writable_device" - mkfs.ext4 "$writable_device" + modprobe brd max_part=1 rd_size=524288 && \ + local writable_device="/dev/ram0" else # Use next free loop device. local writable_device="$(losetup -f)" && \ diff --git a/builder/dnbd3-rootfs/hooks/pre-pivot/mount-tmp.sh b/builder/dnbd3-rootfs/hooks/pre-pivot/mount-tmp.sh index 3e702064..c1366877 100755 --- a/builder/dnbd3-rootfs/hooks/pre-pivot/mount-tmp.sh +++ b/builder/dnbd3-rootfs/hooks/pre-pivot/mount-tmp.sh @@ -6,11 +6,11 @@ OPENSLX_TMP_DISK_FLAG="/tmp/openslx.disk.tmp" if [ ! -e "$OPENSLX_TMP_DISK_FLAG" ]; then - warn "'$OPENSLX_TMP_DISK_FLAG' not found!" - warn "Systemd will manage $NEWROOT/tmp on its own." - # no partition for the future /tmp found, just - # let systemd manage it then (probably a tmpfs) - return 1 + warn "'$OPENSLX_TMP_DISK_FLAG' not found!" + warn "Systemd will manage $NEWROOT/tmp on its own." + # no partition for the future /tmp found, just + # let systemd manage it then (probably a tmpfs) + return 1 fi # in /tmp/openslx.disk.tmp is the name of the device @@ -21,17 +21,17 @@ OPENSLX_TMP_DISK_DEV="$(cat $OPENSLX_TMP_DISK_FLAG)" # sanity check: is the content a block device? if [ ! -b "$OPENSLX_TMP_DISK_DEV" ]; then - warn "'$OPENSLX_TMP_DISK_DEV' appears not to be a block device!" - warn "Systemd will manage $NEWROOT/tmp on its own." - return 1 + warn "'$OPENSLX_TMP_DISK_DEV' appears not to be a block device!" + warn "Systemd will manage $NEWROOT/tmp on its own." + return 1 fi # all good, keep on if ! mount -t auto "$OPENSLX_TMP_DISK_DEV" $NEWROOT/tmp; then - # something else went wrong :( - warn "Mounting '$OPENSLX_TMP_DISK_DEV' to '$NEWROOT/tmp' failed with: $!" - warn "Systemd will manage $NEWROOT/tmp on its own." - return 1 + # something else went wrong :( + warn "Mounting '$OPENSLX_TMP_DISK_DEV' to '$NEWROOT/tmp' failed with: $!" + warn "Systemd will manage $NEWROOT/tmp on its own." + return 1 fi # still here? mount worked wohoo |
