summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2016-03-22 16:06:20 +0100
committertorben2016-03-22 16:06:20 +0100
commit4c7ecc7b4de7c657459cf03d8f7138ab8a3c1f9a (patch)
tree192cae564eea78565ef227b4ebf252b5b86afb80
parentfix (diff)
downloadsystemd-init-4c7ecc7b4de7c657459cf03d8f7138ab8a3c1f9a.tar.gz
systemd-init-4c7ecc7b4de7c657459cf03d8f7138ab8a3c1f9a.tar.xz
systemd-init-4c7ecc7b4de7c657459cf03d8f7138ab8a3c1f9a.zip
Fix.
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/prepare-root-partition.sh14
-rwxr-xr-xbuilder/dnbd3-rootfs/scripts/container-unpack-xmount.sh8
2 files changed, 12 insertions, 10 deletions
diff --git a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
index 4fc7e2ee..435e669a 100755
--- a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
+++ b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
@@ -15,9 +15,9 @@ logging.set_level debug
source /etc/openslx
# region find writable partition
-if [[ "$SLX_WRITABLE_DEVICE_IDENTIFIER" != "" ]] &&
+if [[ "$SLX_WRITABLE_DEVICE_IDENTIFIER" != '' ]] &&
! persistent_device="$(
- tools.find_block_device "$SLX_WRITABLE_DEVICE_IDENTIFIER" "" \
+ tools.find_block_device "$SLX_WRITABLE_DEVICE_IDENTIFIER" '' \
"$SLX_WRITABLE_DEVICE_IDENTIFIER_TIMEOUT"
)"
then
@@ -40,7 +40,7 @@ then
storage_file=$persistent_mountpoint/$SLX_WRITABLE_DEVICE_STORAGE_FILE
! mkdir --parents $persistent_mountpoint
if ! mount --type auto "$persistent_device" "$persistent_mountpoint"; then
- logging.warn "Failed to mount $persistent_device, checking filesystem"
+ logging.warn "Failed to mount $persistent_device, checking filesystem."
! $SLX_WRITABLE_DEVICE_STORAGE_FILSYSTEM_CHECK_COMMAND \
"$persistent_device"
if ! mount --type auto "$persistent_device" "$persistent_mountpoint"
@@ -59,7 +59,7 @@ then
fi
if [ -n "$persistent_device" ]; then
if [ ! -e "$storage_file" ]; then
- # create sparse file
+ # Create a sparse file.
dd of="$storage_file" bs=1M \
seek="$SLX_WRITABLE_DEVICE_STORAGE_FILE_MAX_SIZE_MB" count=0
fi
@@ -68,7 +68,7 @@ then
fi
fi
-# 'P' for persistent storage, 'N' for not persistent (affects dmsetup call,
+# "P" for persistent storage, "N" for not persistent (affects dmsetup call,
# see scripts/device-add-write-layer.sh)
persistent='N'
if [ -n "$persistent_device" ]; then
@@ -78,7 +78,7 @@ if [ -n "$persistent_device" ]; then
fi
else
ramdisk_size="$SLX_RAMDISK_SIZE"
- if [ "$ramdisk_size" = "" ]; then
+ if [ "$ramdisk_size" = '' ]; then
ramdisk_size="$(awk '/MemTotal/ {print $2}' /proc/meminfo)"
fi
# NOTE: If the kernel modul "brd" is compiled into current kernel we can't
@@ -101,7 +101,7 @@ IFS_backup="$IFS"
IFS=","
return_code=1
for host in ${SLX_DNBD3_SERVERS}; do
- logging.info "Trying host '$host'."
+ 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"
diff --git a/builder/dnbd3-rootfs/scripts/container-unpack-xmount.sh b/builder/dnbd3-rootfs/scripts/container-unpack-xmount.sh
index 37e0e5be..c7e1b45c 100755
--- a/builder/dnbd3-rootfs/scripts/container-unpack-xmount.sh
+++ b/builder/dnbd3-rootfs/scripts/container-unpack-xmount.sh
@@ -10,17 +10,19 @@ exceptions.activate
logging.set_level info
logging.set_commands_level info
+# NOTE: All output has to be forwarded to standard error because determined
+# device should be printed on standard output.
in_device="$1"
mkdir --parents /mnt/xmount
loop_device="$(losetup --find)"
if ! utils.dependency_check xmount; then
- logging.warn "\"xmount\" not found, assuming raw image."
+ logging.warn "\"xmount\" not found, assuming raw image." 1>&2
elif systemd-preserve-process-marker xmount --in qemu "$in_device" --out raw \
/mnt/xmount &>/dev/null
then
- in_device="/mn/xmount/*.dd"
+ in_device="/mnt/xmount/*.dd"
else
- logging.warn "\"xmount\" call failed, assuming raw image."
+ logging.warn "\"xmount\" call failed, assuming raw image." 1>&2
fi
losetup "$loop_device" $in_device --partscan
udevadm settle