qemu: add support for optional /var disk (256M)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-05-21 20:39:12 +02:00
committed by Tobias Waldekranz
parent 468b49e916
commit bd696cba9a
2 changed files with 21 additions and 2 deletions
+11 -1
View File
@@ -66,10 +66,20 @@ config QEMU_DTB_EXTEND
default y if BR2_aarch64
config QEMU_RW
string "Writable layer"
string "Writable /cfg layer"
depends on QEMU_ROOTFS_INITRD
default "images/cfg.ext4"
config QEMU_RW_VAR_OPT
bool "Separate writable /var (256MB)"
if QEMU_RW_VAR_OPT
config QEMU_RW_VAR
string "Writable /var layer"
default "images/var.ext4"
endif
config QEMU_HOST
string "Export host filesystem path"
default "images"
+10 -1
View File
@@ -75,10 +75,19 @@ rw_args()
if ! [ -f "$QEMU_RW" ]; then
dd if=/dev/zero of="$QEMU_RW" bs=16M count=1 >/dev/null 2>&1
mkfs.ext4 -L cfg "$QEMU_RW" >/dev/null 2>&1
mkfs.ext4 -L cfg "$QEMU_RW" >/dev/null 2>&1
fi
echo -n "-drive file=$QEMU_RW,if=virtio,format=raw,bus=0,unit=1 "
if [ "$QEMU_RW_VAR_OPT" ]; then
if ! [ -f "$QEMU_RW_VAR" ]; then
dd if=/dev/zero of="$QEMU_RW_VAR" bs=256M count=1 >/dev/null 2>&1
mkfs.ext4 -L var "$QEMU_RW_VAR" >/dev/null 2>&1
fi
echo -n "-drive file=$QEMU_RW_VAR,if=virtio,format=raw,bus=0,unit=2 "
fi
}
host_args()