mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
Meta: Remove hardcoded resize2fs executable path
Let which find the resize2fs executable path for us, and use `/usr/sbin` as a default.
This commit is contained in:
parent
21671d9b91
commit
c2d999eb52
|
@ -2,11 +2,16 @@
|
||||||
|
|
||||||
# Note: This is done before `set -e` to let `command` fail if needed
|
# Note: This is done before `set -e` to let `command` fail if needed
|
||||||
FUSE2FS_PATH=$(command -v fuse2fs)
|
FUSE2FS_PATH=$(command -v fuse2fs)
|
||||||
|
RESIZE2FS_PATH=$(command -v resize2fs)
|
||||||
|
|
||||||
if [ -z "$FUSE2FS_PATH" ]; then
|
if [ -z "$FUSE2FS_PATH" ]; then
|
||||||
FUSE2FS_PATH=/usr/sbin/fuse2fs
|
FUSE2FS_PATH=/usr/sbin/fuse2fs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$RESIZE2FS_PATH" ]; then
|
||||||
|
RESIZE2FS_PATH=/usr/sbin/resize2fs
|
||||||
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
|
@ -113,7 +118,7 @@ if [ $USE_EXISTING -eq 1 ]; then
|
||||||
if [ "$DISK_SIZE_BYTES" -gt "$OLD_DISK_SIZE_BYTES" ]; then
|
if [ "$DISK_SIZE_BYTES" -gt "$OLD_DISK_SIZE_BYTES" ]; then
|
||||||
echo "resizing disk image..."
|
echo "resizing disk image..."
|
||||||
qemu-img resize -f raw _disk_image "$DISK_SIZE_BYTES" || die "could not resize 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
|
rm -f _disk_image
|
||||||
USE_EXISTING=0
|
USE_EXISTING=0
|
||||||
echo "failed, not using existing image"
|
echo "failed, not using existing image"
|
||||||
|
|
Loading…
Reference in a new issue