From c2d999eb52372a199c2de087c1c0e4d47838f7e0 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 24 Apr 2022 21:41:14 +0200 Subject: [PATCH] Meta: Remove hardcoded resize2fs executable path Let which find the resize2fs executable path for us, and use `/usr/sbin` as a default. --- Meta/build-image-qemu.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index 1189e12dc4..7c007a5bbf 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -2,11 +2,16 @@ # Note: This is done before `set -e` to let `command` fail if needed FUSE2FS_PATH=$(command -v fuse2fs) +RESIZE2FS_PATH=$(command -v resize2fs) if [ -z "$FUSE2FS_PATH" ]; then FUSE2FS_PATH=/usr/sbin/fuse2fs fi +if [ -z "$RESIZE2FS_PATH" ]; then + RESIZE2FS_PATH=/usr/sbin/resize2fs +fi + set -e die() { @@ -113,7 +118,7 @@ if [ $USE_EXISTING -eq 1 ]; then if [ "$DISK_SIZE_BYTES" -gt "$OLD_DISK_SIZE_BYTES" ]; then echo "resizing disk image..." qemu-img resize -f raw _disk_image "$DISK_SIZE_BYTES" || die "could not resize disk image" - if ! resize2fs _disk_image; then + if ! "$RESIZE2FS_PATH" _disk_image; then rm -f _disk_image USE_EXISTING=0 echo "failed, not using existing image"