mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +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
Notes:
sideshowbarker
2024-07-17 11:08:33 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/c2d999eb52 Pull-request: https://github.com/SerenityOS/serenity/pull/13871 Reviewed-by: https://github.com/linusg
1 changed files with 6 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue