From 45e22dafb3d487341809a54ae63bf005300b5bea Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 6 Nov 2022 00:56:52 +0100 Subject: [PATCH] Meta: Look for e2fsck path on build-image-qemu.sh Now we attempt to look for the path of e2fsck before checking if the path can be found in any of the predefined routes. This fixes e2fsck not being found on some "special" distros like NixOS. Related #13754 --- Meta/build-image-qemu.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index eeeb2860646..7107727ec59 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -50,13 +50,14 @@ if [ "$(uname -s)" = "Darwin" ]; then E2FSCK="e2fsck" RESIZE2FS_PATH="resize2fs" -elif [ "$(uname -s)" = "SerenityOS" ]; then - E2FSCK="/usr/local/sbin/e2fsck" -else - E2FSCK="/usr/sbin/e2fsck" +elif [ ! -f "$E2FSCK" ]; then + E2FSCK="$(command -v e2fsck)" if [ ! -f "$E2FSCK" ]; then - E2FSCK=/sbin/e2fsck + E2FSCK="/usr/sbin/e2fsck" + if [ ! -f "$E2FSCK" ]; then + E2FSCK="/sbin/e2fsck" + fi fi fi