diff options
| author | torben | 2015-12-03 18:06:56 +0100 |
|---|---|---|
| committer | torben | 2015-12-03 18:06:56 +0100 |
| commit | 70e693eea8b83d6d322778e74b439e469b62269f (patch) | |
| tree | eaa339fd638ab8f45a9eba405630b4eee96b90bb /builder | |
| parent | Fix. (diff) | |
| download | systemd-init-70e693eea8b83d6d322778e74b439e469b62269f.tar.gz systemd-init-70e693eea8b83d6d322778e74b439e469b62269f.tar.xz systemd-init-70e693eea8b83d6d322778e74b439e469b62269f.zip | |
Refactoring.
Diffstat (limited to 'builder')
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh | 34 |
1 files changed, 17 insertions, 17 deletions
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 2492e493..c44d0565 100755 --- a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh +++ b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh @@ -34,49 +34,49 @@ udevadm settle local read_only_partition=$(utils.find_block_device \ "$SLX_SYSTEM_PARTITION_IDENTIFIER") -if [ -z $read_only_partition ]; then - warn no partition found on device $nbd_device +if [ -z "$read_only_partition" ]; then + warn no partition found on device "$nbd_device" emergency_shell fi # Make read-only partition writable. ## detect partition for persistent storage -local persistent_device=$(utils.find_block_device \ - "$SLX_WRITABLE_DEVICE_IDENTIFIER") +local persistent_device="$(utils.find_block_device \ + "$SLX_WRITABLE_DEVICE_IDENTIFIER")" # TODO move somewhere else -#local tmp_device=$(utils.find_block_device \ - #'$SLX_TMP_PARTITION_IDENTIFIER') +#local tmp_device="$(utils.find_block_device \ + #'$SLX_TMP_PARTITION_IDENTIFIER')" #if [ -n $tmp_device ]; then - #mount -t auto "$tmp_device" $NEWROOT/tmp + #mount --type auto "$tmp_device" "$NEWROOT/tmp" #fi -local persistent="N" # 'P' for persistent storage, 'N' for not persistent +local persistent='N' # 'P' for persistent storage, 'N' for not persistent local writable_device if [ -n "$persistent_device" ]; then - writable_device=$persistent_device + writable_device="$persistent_device" if [ "$SLX_WRITABLE_DEVICE_PERSISTENT" = "yes" ]; then - persistent="P" + persistent='P' fi else local ramdisk_size="$SLX_RAMDISK_SIZE" if [ "ramdisk_size" = "" ]; then - ramdisk_size=$(cat /proc/meminfo | awk '/MemTotal/ {print $2}') + ramdisk_size="$(cat /proc/meminfo | awk '/MemTotal/ {print $2}')" fi - modprobe brd max_part=1 rd_size=$ramdisk_size - writable_device="/dev/ram0" - persistent="N" + modprobe brd max_part=1 rd_size="$ramdisk_size" + writable_device='/dev/ram0' + persistent='N' fi # persistent storage on a filesystem (e.g. usb stick) # writable_device="$(losetup -f)" #dd if=/dev/zero of=persistent_storage.img bs=1k count=1000 #losetup "$writable_device" persistent_storage.img -#persistent="P" +#persistent='P' local partition_size="$(blockdev --getsz "$read_only_partition")" -local writable_partition_name="root" +local writable_partition_name='root' logging.info "Using writable device $writable_device, persistency: $persistent" -local chunksize="1" +local chunksize='1' modprobe dm_snapshot dmsetup create "$writable_partition_name" --noudevsync --table \ "0 $partition_size snapshot $read_only_partition $writable_device $persistent $chunksize" |
