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 <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14841 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jordan Justen 2013-11-12 18:35:08 +00:00 committed by jljusten
parent 182eb45627
commit bc9be821c7
1 changed files with 11 additions and 4 deletions

View File

@ -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 $?