From 52b051d78ead51fe4ab0513543dbfc619fd6a337 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sat, 10 Jun 2023 00:24:12 +1000 Subject: [PATCH] polishing --- vm.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vm.sh b/vm.sh index 74274e6..d3f535d 100755 --- a/vm.sh +++ b/vm.sh @@ -1,19 +1,20 @@ #!/bin/bash # -# QEMU setup for trial3 VM +# QEMU setup for trial VM + +BOOT="-boot menu=on" +[ -z "$EFI" ] || BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd" + +[ -d disk.raw ] || dd if=/dev/zero of=disk.raw bs=1G count=0 seek=8 + -if [ -n "$EFI" ] ; then - BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd" -else - BOOT="-boot menu=on" -fi ARGS=( -m 2G -M pc,accel=kvm -cpu host - -serial mon:stdio -echr 0x1c + -serial mon:stdio -echr 0x1c # Using ^\ as meta character -vga qxl $BOOT -drive index=0,id=disk,media=disk,format=raw,file=disk.raw -drive index=1,id=boot,media=disk,format=raw,file=bootimage.raw ) -qemu-system-x86_64 ${ARGS[@]} +exec qemu-system-x86_64 ${ARGS[@]} -- 2.39.2