diff options
| author | jandob | 2016-01-28 16:16:09 +0100 |
|---|---|---|
| committer | jandob | 2016-01-28 16:16:09 +0100 |
| commit | d58aa4e7e93630639aa5f292d9c2c9089870daf3 (patch) | |
| tree | ee84c6f2f6383f1728f54f3a3be1e075fed3833f /builder | |
| parent | dependecy check update (diff) | |
| parent | Improve debugging configurations. (diff) | |
| download | systemd-init-d58aa4e7e93630639aa5f292d9c2c9089870daf3.tar.gz systemd-init-d58aa4e7e93630639aa5f292d9c2c9089870daf3.tar.xz systemd-init-d58aa4e7e93630639aa5f292d9c2c9089870daf3.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init
Diffstat (limited to 'builder')
| -rwxr-xr-x | builder/build-initramfs.sh | 6 | ||||
| -rwxr-xr-x | builder/dnbd3-rootfs/hooks/prepare-root-partition.sh | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 7ebb65eb..90a4fe77 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -147,8 +147,10 @@ function build_initramfs_print_command_line_option_description() { (improved performance but less features) (default: "$build_initramfs_use_systemd_in_initramfs"). -Additional dracut parameter and normal parameter can be deleimiter via a single -dash (-) (default: "$build_initramfs_dracut_parameter"). +Additional dracut parameter and normal parameter can be added by deleimiting +them via a single dash (-) (default: "$build_initramfs_dracut_parameter" with +"--modules" and dynamically determined modules. Additional custom modules are +concated.). EOF } function build_initramfs_print_help_message() { diff --git a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh index b9355cc3..c527062a 100755 --- a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -36,21 +36,25 @@ if [[ $return_code != 0 ]]; then exit 1 fi # endregion + # region scan partitions read_only_device="" -if ! qemu-img info --output json "$SLX_DNBD3_DEVICE" | grep '"format": "raw"' +if utils.dependency_check qemu-img && ! qemu-img qemu-img info --output json \ + "$SLX_DNBD3_DEVICE" | grep '"format": "raw"' then read_only_device="$(container-unpack-xmount $SLX_DNBD3_DEVICE)" else - # workaround to detect partitions on raw disks - # can be omited when the dnbd3 kernel module supports it (like the nbd - # kernel module with parameter 'max_part') - loop_device="$(losetup -f)" + # Workaround to detect partitions on raw disks can be omitted when the + # dnbd3 kernel module supports it (like the nbd kernel module with + # parameter "max_part"). + loop_device="$(losetup --find)" losetup "$loop_device" "$SLX_DNBD3_DEVICE" --partscan read_only_device="$loop_device" touch $read_only_device udevadm settle fi +# Fail fast if no device could be determined. +[ -z "$read_only_device" ] && exit 1 # endregion # region find read-only partition |
