mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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:
parent
e0fe38ea25
commit
1a48609c6b
Notes:
sideshowbarker
2024-07-19 17:28:01 +09:00
Author: https://github.com/codebutler 🔰 Commit: https://github.com/SerenityOS/serenity/commit/1a48609c6bc Pull-request: https://github.com/SerenityOS/serenity/pull/6987
1 changed files with 14 additions and 16 deletions
|
@ -87,25 +87,23 @@ printf "mounting filesystem... "
|
|||
mkdir -p mnt
|
||||
use_genext2fs=0
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
fuse-ext2 _disk_image mnt -o rw+,allow_other,uid=501,gid=20 || die "could not mount filesystem"
|
||||
echo "done"
|
||||
mount_cmd="fuse-ext2 _disk_image mnt -o rw+,allow_other,uid=501,gid=20"
|
||||
elif [ "$(uname -s)" = "OpenBSD" ]; then
|
||||
mount -t ext2fs "/dev/${VND}i" mnt/ || die "could not mount filesystem"
|
||||
echo "done"
|
||||
mount_cmd="mount -t ext2fs "/dev/${VND}i" mnt/"
|
||||
elif [ "$(uname -s)" = "FreeBSD" ]; then
|
||||
fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/ || die "could not mount filesystem"
|
||||
echo "done"
|
||||
mount_cmd="fuse-ext2 -o rw+,direct_io "/dev/${MD}" mnt/"
|
||||
else
|
||||
if ! mount _disk_image mnt/ ; then
|
||||
if command -v genext2fs 1>/dev/null ; then
|
||||
echo "mount failed but genext2fs exists, use it instead"
|
||||
use_genext2fs=1
|
||||
else
|
||||
die "could not mount filesystem and genext2fs is missing"
|
||||
fi
|
||||
else
|
||||
echo "done"
|
||||
fi
|
||||
mount_cmd="mount _disk_image mnt/"
|
||||
fi
|
||||
if ! eval "$mount_cmd"; then
|
||||
if command -v genext2fs 1>/dev/null ; then
|
||||
echo "mount failed but genext2fs exists, use it instead"
|
||||
use_genext2fs=1
|
||||
else
|
||||
die "could not mount filesystem and genext2fs is missing"
|
||||
fi
|
||||
else
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
cleanup() {
|
||||
|
|
Loading…
Reference in a new issue