1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

Meta: Always try genext2fs as fallback to build disk image

If mounting disk image fails (e.g. fuse is not available on macos),
always try using genext2fs before giving up.
This commit is contained in:
Eric Butler 2021-05-09 08:39:21 -04:00 committed by Andreas Kling
parent e0fe38ea25
commit 1a48609c6b

View file

@ -87,25 +87,23 @@ printf "mounting filesystem... "
mkdir -p mnt mkdir -p mnt
use_genext2fs=0 use_genext2fs=0
if [ "$(uname -s)" = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
fuse-ext2 _disk_image mnt -o rw+,allow_other,uid=501,gid=20 || die "could not mount filesystem" mount_cmd="fuse-ext2 _disk_image mnt -o rw+,allow_other,uid=501,gid=20"
echo "done"
elif [ "$(uname -s)" = "OpenBSD" ]; then elif [ "$(uname -s)" = "OpenBSD" ]; then
mount -t ext2fs "/dev/${VND}i" mnt/ || die "could not mount filesystem" mount_cmd="mount -t ext2fs "/dev/${VND}i" mnt/"
echo "done"
elif [ "$(uname -s)" = "FreeBSD" ]; then elif [ "$(uname -s)" = "FreeBSD" ]; then
fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/ || die "could not mount filesystem" mount_cmd="fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/"
echo "done"
else else
if ! mount _disk_image mnt/ ; then mount_cmd="mount _disk_image mnt/"
fi
if ! eval "$mount_cmd"; then
if command -v genext2fs 1>/dev/null ; then if command -v genext2fs 1>/dev/null ; then
echo "mount failed but genext2fs exists, use it instead" echo "mount failed but genext2fs exists, use it instead"
use_genext2fs=1 use_genext2fs=1
else else
die "could not mount filesystem and genext2fs is missing" die "could not mount filesystem and genext2fs is missing"
fi fi
else else
echo "done" echo "done"
fi
fi fi
cleanup() { cleanup() {