From: Ralph Ronnquist Date: Wed, 18 Sep 2024 11:17:08 +0000 (+1000) Subject: test either installing or running X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=a083c5af56bdd9011142344fb0a2ae5bc4313bcc;p=rrq%2Fbespoke-installer.git test either installing or running --- diff --git a/vm.sh b/vm.sh index f349347..00a0fcd 100755 --- a/vm.sh +++ b/vm.sh @@ -2,7 +2,25 @@ ARCH=${1:=arm64} -IMG=disk.raw +IMG=disk-$ARCH.raw +if [ -f $IMG ] ; then + read -p "(r)un or (i)nstall: " CMD + case "$CMD" in + r|run) + APPEND="root=/dev/vda1" + ;; + i|install) + INITRD="-initrd $ARCH/initrd.gz" + ;; + *) + echo "** Aborted. Need an r or an i..." >&2 + exit 1 + ;; + esac +else + dd if=/dev/zero of=$IMG bs=1G count=0 seek=4 + INITRD="-initrd $ARCH/initrd.gz" +fi case "$ARCH" in arm64) @@ -26,9 +44,12 @@ ARGS=( -M virt -cpu $CPU -m 4G # boot setup -kernel $ARCH/vmlinuz - -initrd $ARCH/initrd.gz + $INITRD -append "console=ttyAMA0 root=/dev/vda1 roottype=ext4" - -serial mon:stdio -echr 0x1c + -serial stdio + # qemu monitor interface + -chardev socket,id=QEMU,server=on,wait=off,path=QEMU + -mon chardev=QEMU,mode=readline # graphics setup -nographic # harddrive setup