mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-04 11:06:21 +00:00
image-builder: add fs type
Add filesystem type to format the loop device. fixes #270 Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
20b087e3d2
commit
8debe95b61
@ -194,7 +194,7 @@ calculate_required_disk_size() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
format_loop "${device}" "${block_size}" > /dev/null 2>&1
|
format_loop "${device}" "${block_size}" "${fs_type}" > /dev/null 2>&1
|
||||||
mount "${device}p1" "${mount_dir}"
|
mount "${device}p1" "${mount_dir}"
|
||||||
avail="$(df -h --output=avail "${mount_dir}" | tail -n1 | sed 's/[M ]//g')"
|
avail="$(df -h --output=avail "${mount_dir}" | tail -n1 | sed 's/[M ]//g')"
|
||||||
umount "${mount_dir}"
|
umount "${mount_dir}"
|
||||||
@ -264,6 +264,7 @@ setup_loop_device() {
|
|||||||
format_loop() {
|
format_loop() {
|
||||||
local device="$1"
|
local device="$1"
|
||||||
local block_size="$2"
|
local block_size="$2"
|
||||||
|
local fs_type="$3"
|
||||||
|
|
||||||
case "${fs_type}" in
|
case "${fs_type}" in
|
||||||
"${ext4_format}")
|
"${ext4_format}")
|
||||||
@ -316,7 +317,7 @@ create_rootfs_image() {
|
|||||||
die "Could not setup loop device"
|
die "Could not setup loop device"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
format_loop "${device}" "${block_size}"
|
format_loop "${device}" "${block_size}" "${fs_type}"
|
||||||
|
|
||||||
info "Mounting root partition"
|
info "Mounting root partition"
|
||||||
readonly mount_dir=$(mktemp -d osbuilder-mount-dir.XXXX)
|
readonly mount_dir=$(mktemp -d osbuilder-mount-dir.XXXX)
|
||||||
|
Loading…
Reference in New Issue
Block a user