From bc9be821c7894a721c53e2782b4a546e5e4e43f9 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Tue, 12 Nov 2013 18:35:08 +0000 Subject: [PATCH] OvmfPkg/build.sh: Support --enable-flash switch If this argument is used, then when QEMU is run, the -pflash parameter will be used with QEMU to enable QEMU's flash mode. It should be used before the 'qemu' argument, since it is not a QEMU parameter, but instead it updates how build.sh runs QEMU. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen Reviewed-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14841 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/build.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh index 65add5c9e9..77582465b6 100755 --- a/OvmfPkg/build.sh +++ b/OvmfPkg/build.sh @@ -48,6 +48,7 @@ PLATFORMFILE= THREADNUMBER=1 LAST_ARG= RUN_QEMU=no +ENABLE_FLASH=no # # Pick a default tool type for a given OS @@ -106,6 +107,9 @@ do shift break ;; + --enable-flash) + ENABLE_FLASH=yes + ;; *) BUILD_OPTIONS="$BUILD_OPTIONS $arg" ;; @@ -222,12 +226,15 @@ if [[ "$RUN_QEMU" == "yes" ]]; then mkdir $QEMU_FIRMWARE_DIR fi ln -sf $FV_DIR/OVMF.fd $QEMU_FIRMWARE_DIR/bios.bin - if [[ "$ADD_QEMU_HDA" == "yes" ]]; then - AUTO_QEMU_HDA="-hda fat:$BUILD_ROOT_ARCH" + if [[ "$ENABLE_FLASH" == "yes" ]]; then + QEMU_COMMAND="$QEMU_COMMAND -pflash $QEMU_FIRMWARE_DIR/bios.bin" else - AUTO_QEMU_HDA= + QEMU_COMMAND="$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR" fi - QEMU_COMMAND="$QEMU_COMMAND -L $QEMU_FIRMWARE_DIR $AUTO_QEMU_HDA $*" + if [[ "$ADD_QEMU_HDA" == "yes" ]]; then + QEMU_COMMAND="$QEMU_COMMAND -hda fat:$BUILD_ROOT_ARCH" + fi + QEMU_COMMAND="$QEMU_COMMAND $*" echo Running: $QEMU_COMMAND $QEMU_COMMAND exit $?