From 9c351c74f4417128367e8742c1c25778c605e96b Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Thu, 18 Dec 2025 16:09:55 +0100 Subject: [PATCH] qemu: fix /cfg mount failure due to missing mkfs.ext4 in PATH The cfg.ext4 disk image was created but not formatted because mkfs.ext4 wasn't found. As sbin is not in PATH for an unprivileged user in Debian. This caused the VM boot to fail with "No persistent storage found for /cfg". Signed-off-by: Richard Alpe --- board/common/qemu/run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/common/qemu/run.sh b/board/common/qemu/run.sh index ee7d7d85..d7e81cec 100755 --- a/board/common/qemu/run.sh +++ b/board/common/qemu/run.sh @@ -19,6 +19,9 @@ # # shellcheck disable=SC3037 +# Add /sbin to PATH for mkfs.ext4 and such (not default in debian) +export PATH="/sbin:/usr/sbin:$PATH" + qdir=$(dirname "$(readlink -f "$0")") imgdir=$(readlink -f "${qdir}/..") prognm=$(basename "$0") @@ -174,6 +177,8 @@ rw_args() { [ "$CONFIG_QEMU_RW" ] || return + command -v mkfs.ext4 >/dev/null || die "$prognm: cannot find mkfs.ext4" + if ! [ -f "aux.ext4" ]; then dd if=/dev/zero of="aux.ext4" bs=1M count=1 >/dev/null 2>&1 mkfs.ext4 -L aux "aux.ext4" >/dev/null 2>&1