From 71866e48246d0e68c4f07f2b7a673432d9d3fd95 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Thu, 4 Apr 2024 12:53:00 +0900 Subject: [PATCH] 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. --- build_library/qemu_template.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index 2cd73e6e5d..3a7c631eb0 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -31,6 +31,8 @@ Options: -M MB Set VM memory in MBs. -T DIR Add a software TPM2 device through swtpm which stores secrets 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. -h this ;-) @@ -90,6 +92,12 @@ while [ $# -ge 1 ]; do -T|-tpm) SWTPM_DIR="$2" shift 2 ;; + -R|-pflash-ro) + VM_PFLASH_RO="$2" + shift 2 ;; + -W|-pflash-rw) + VM_PFLASH_RW="$2" + shift 2 ;; -v|-verbose) set -x shift ;;