revised uefi boot setup
authorRalph Ronnquist <rrq@rrq.au>
Sun, 27 Apr 2025 13:43:58 +0000 (23:43 +1000)
committerRalph Ronnquist <rrq@rrq.au>
Sun, 27 Apr 2025 13:43:58 +0000 (23:43 +1000)
vm.sh

diff --git a/vm.sh b/vm.sh
index 452b475209e6d86001943c9160b2eca4422ca798..4e8522ac3ec842b8a76a06d65f5ab6575f7df743 100755 (executable)
--- a/vm.sh
+++ b/vm.sh
@@ -48,7 +48,16 @@ case "$MEDIA" in
 esac
 
 BOOT="-boot menu=on,splash=boot.jpg,splash-time=60000"
-[ $(( $REPLY % 2 )) -eq 0 ] &&  BOOT="-bios /usr/share/OVMF/OVMF_CODE.fd"
+if [ $(( $REPLY % 2 )) -eq 0 ] ; then
+    {
+        dd if=/usr/share/OVMF/OVMF_CODE_4M.fd of=pcode.bin 
+        dd if=/usr/share/OVMF/OVMF_VARS_4M.fd of=pvars.bin
+    } 2>/dev/null
+    BOOT="
+       -drive if=pflash,readonly=on,format=raw,file=pcode.bin
+        -drive if=pflash,readonly=off,format=raw,file=pvars.bin
+    "
+fi
 
 case "$NET" in
     vde)