From a9c3eeb4c2eb519cd61963c3e90c8029e67a9112 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 25 Feb 2026 07:48:55 +0100 Subject: bin: cleanup the busybox /home only when a binary was provided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- bin/run-riscv-qemu.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/run-riscv-qemu.sh b/bin/run-riscv-qemu.sh index bdcb2b5..52505a4 100755 --- a/bin/run-riscv-qemu.sh +++ b/bin/run-riscv-qemu.sh @@ -39,6 +39,9 @@ while [[ $# -gt 0 ]]; do ;; *) if [ ! -z "$BUSYBOX_SRC" ]; then + echo "run-riscv-qemu (info): including '$1' to the VM" + + rm -rf "$BUSYBOX_SRC/initramfs/home" mkdir -p "$BUSYBOX_SRC/initramfs/home/$(whoami)" cp "$1" "$BUSYBOX_SRC/initramfs/home/$(whoami)/" fi @@ -80,7 +83,7 @@ if [ -z "$KERNEL" ]; then exit 1 fi fi -echo "run-riscv-qemu (info): using '\$KERNEL' as the Linux kernel Image." +echo "run-riscv-qemu (info): using '$KERNEL' as the Linux kernel Image." ## # If the user provided a disk option, run QEMU with that disk in mind. @@ -110,10 +113,6 @@ if [ -z "$BUSYBOX_SRC" ]; then exit 1 fi -# Cleanup older environments. -rm -rf "$BUSYBOX_SRC/initramfs/home" -mkdir -p "$BUSYBOX_SRC/initramfs/home" - pushd "$BUSYBOX_SRC/initramfs" find . -print0 | cpio --null -o --format=newc | gzip -9 >../initramfs.cpio.gz popd -- cgit v1.2.3