mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 14:43:51 +00:00
osbuilder: Get mount directory size with Mb format
While calculating directory size in imagebuild script, we shoul use `df -BM` instead of `df -h` to keep Mb format. Fixes #336 image-builder: get mount directory size with Mb format Signed-off-by: ClarkLee <clarklee1992@hotmail.com>
This commit is contained in:
parent
0c48630395
commit
6d5aef531a
@ -233,7 +233,7 @@ calculate_required_disk_size() {
|
|||||||
die "Could not format loop device: ${device}"
|
die "Could not format loop device: ${device}"
|
||||||
fi
|
fi
|
||||||
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 -BM --output=avail "${mount_dir}" | tail -n1 | sed 's/[M ]//g')"
|
||||||
umount "${mount_dir}"
|
umount "${mount_dir}"
|
||||||
losetup -d "${device}"
|
losetup -d "${device}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user