diff options
author | Jonathan Bauer | 2018-03-15 11:06:47 +0100 |
---|---|---|
committer | Jonathan Bauer | 2018-03-15 11:06:47 +0100 |
commit | 0ecc821271893afe77a2a8a1717e8a2cd0d3b1f4 (patch) | |
tree | 26cd4730d1c65a5e4eabee3de820c3084692ce05 | |
parent | [dnbd3-rootfs] support multiple identifiers RW dev (diff) | |
download | systemd-init-0ecc821271893afe77a2a8a1717e8a2cd0d3b1f4.tar.gz systemd-init-0ecc821271893afe77a2a8a1717e8a2cd0d3b1f4.tar.xz systemd-init-0ecc821271893afe77a2a8a1717e8a2cd0d3b1f4.zip |
[dnbd3-rootfs] formatting
-rwxr-xr-x | builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh index fc8ee828..68705b1b 100755 --- a/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/builder/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -29,14 +29,14 @@ for identifier in $SLX_WRITABLE_DEVICE_IDENTIFIER; do persistent_device= done IFS="$IFS_backup" + if [ -z "$persistent_device" ]; then logging.warn "Failed to find unique device with identifiers" \ "\"${SLX_WRITABLE_DEVICE_IDENTIFIER}\"; matched devices:" \ "\"${persistent_device}\"" fi -if [ -n "$SLX_WRITABLE_DEVICE_STORAGE_FILE_PATH" ] && [ -n "$persistent_device" ] -then +if [ -n "$SLX_WRITABLE_DEVICE_STORAGE_FILE_PATH" ] && [ -n "$persistent_device" ]; then persistent_mountpoint=/mnt/slx_writable_device storage_file_path="${persistent_mountpoint}/$SLX_WRITABLE_DEVICE_STORAGE_FILE_PATH" ! mkdir --parents "$(dirname "$storage_file_path")" @@ -44,15 +44,13 @@ then logging.warn "Failed to mount $persistent_device, checking filesystem." ! $SLX_WRITABLE_DEVICE_STORAGE_FILESYSTEM_CHECK_COMMAND \ "$persistent_device" - if ! mount --type auto "$persistent_device" "$persistent_mountpoint" - then + if ! mount --type auto "$persistent_device" "$persistent_mountpoint"; then logging.warn "Mounting $persistent_device, still failing," \ "creating new filesystem on device" $SLX_WRITABLE_DEVICE_STORAGE_FILESYSTEM_CREATE_COMMAND \ "$persistent_device" fi - if ! mount --type auto "$persistent_device" "$persistent_mountpoint" - then + if ! mount --type auto "$persistent_device" "$persistent_mountpoint"; then logging.warn "Mounting $persistent_device, still failing," \ "giving up, and using ramdisk" persistent_device="" @@ -103,8 +101,7 @@ for host in ${SLX_DNBD3_SERVERS}; do logging.info "Trying host \"$host\"." if systemd-preserve-process-marker dnbd3-client --host "$host" --image \ "${SLX_DNBD3_IMAGE}" --device "$SLX_DNBD3_DEVICE" \ - --rid "$SLX_DNBD3_RID" - then + --rid "$SLX_DNBD3_RID"; then return_code=0 break fi |