Skip to content

Commit 9c351c7

Browse files
committed
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 <[email protected]>
1 parent 230574b commit 9c351c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

board/common/qemu/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#
2020
# shellcheck disable=SC3037
2121

22+
# Add /sbin to PATH for mkfs.ext4 and such (not default in debian)
23+
export PATH="/sbin:/usr/sbin:$PATH"
24+
2225
qdir=$(dirname "$(readlink -f "$0")")
2326
imgdir=$(readlink -f "${qdir}/..")
2427
prognm=$(basename "$0")
@@ -174,6 +177,8 @@ rw_args()
174177
{
175178
[ "$CONFIG_QEMU_RW" ] || return
176179

180+
command -v mkfs.ext4 >/dev/null || die "$prognm: cannot find mkfs.ext4"
181+
177182
if ! [ -f "aux.ext4" ]; then
178183
dd if=/dev/zero of="aux.ext4" bs=1M count=1 >/dev/null 2>&1
179184
mkfs.ext4 -L aux "aux.ext4" >/dev/null 2>&1

0 commit comments

Comments
 (0)