Merge pull request #271 from devimc/topic/fixWrongFS

image-builder: add fs type
This commit is contained in:
GabyCT 2019-03-29 10:10:55 -06:00 committed by GitHub
commit a17d2bbb40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,7 +194,9 @@ calculate_required_disk_size() {
continue
fi
format_loop "${device}" "${block_size}" > /dev/null 2>&1
if ! format_loop "${device}" "${block_size}" "${fs_type}" > /dev/null 2>&1 ; then
die "Could not format loop device: ${device}"
fi
mount "${device}p1" "${mount_dir}"
avail="$(df -h --output=avail "${mount_dir}" | tail -n1 | sed 's/[M ]//g')"
umount "${mount_dir}"
@ -264,6 +266,7 @@ setup_loop_device() {
format_loop() {
local device="$1"
local block_size="$2"
local fs_type="$3"
case "${fs_type}" in
"${ext4_format}")
@ -316,7 +319,9 @@ create_rootfs_image() {
die "Could not setup loop device"
fi
format_loop "${device}" "${block_size}"
if ! format_loop "${device}" "${block_size}" "${fs_type}"; then
die "Could not format loop device: ${device}"
fi
info "Mounting root partition"
readonly mount_dir=$(mktemp -d osbuilder-mount-dir.XXXX)