qemu_template.sh: Allow parameters for VM pflash firmware

The qemu UEFI and regular qemu script only differ by having a default
value for the firmware. If one tries to switch between different
firmwares one normally would modify the script.
Make it easier to switch boot modes and use custom firmwares by
supporting a flag to set the pflash contents.
This commit is contained in:
Kai Lueke 2024-04-04 12:53:00 +09:00
parent 48780dc375
commit 71866e4824

View File

@ -31,6 +31,8 @@ Options:
-M MB Set VM memory in MBs. -M MB Set VM memory in MBs.
-T DIR Add a software TPM2 device through swtpm which stores secrets -T DIR Add a software TPM2 device through swtpm which stores secrets
and the control socket to the given directory. and the control socket to the given directory.
-R FILE Set up pflash ro content, e.g., for UEFI (with -W).
-W FILE Set up pflash rw content, e.g., for UEFI (with -R).
-s Safe settings: single simple cpu and no KVM. -s Safe settings: single simple cpu and no KVM.
-h this ;-) -h this ;-)
@ -90,6 +92,12 @@ while [ $# -ge 1 ]; do
-T|-tpm) -T|-tpm)
SWTPM_DIR="$2" SWTPM_DIR="$2"
shift 2 ;; shift 2 ;;
-R|-pflash-ro)
VM_PFLASH_RO="$2"
shift 2 ;;
-W|-pflash-rw)
VM_PFLASH_RW="$2"
shift 2 ;;
-v|-verbose) -v|-verbose)
set -x set -x
shift ;; shift ;;