OvmfPkg/build.sh: Enable flash for QEMU >= 1.6

If the QEMU version is found to be >= 1.6, then automatically
enable flash (using the QEMU pflash command line parameter).

QEMU supports flash since 1.2, but only if KVM is disabled.
As of QEMU 1.6, flash support should also be enabled when
KVM is used. Therefore it is safest to only enable flash for
QEMU 1.6 and newer.

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@14842 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jordan Justen 2013-11-12 18:35:15 +00:00 committed by jljusten
parent bc9be821c7
commit d48ec970ad
1 changed files with 17 additions and 8 deletions

View File

@ -179,16 +179,25 @@ if [ -z "$PLATFORMFILE" ]; then
PLATFORMFILE=$WORKSPACE/OvmfPkg/OvmfPkg$Processor.dsc
fi
ADD_QEMU_HDA=yes
for arg in "$@"
do
case $arg in
-hd[a-d]|-fd[ab]|-cdrom)
ADD_QEMU_HDA=no
break
if [[ "$RUN_QEMU" == "yes" ]]; then
qemu_version=$($QEMU_COMMAND -version 2>&1 | tail -1 | awk '{print $4}')
case $qemu_version in
1.[6-9].*|1.[1-9][0-9].*|2.*.*)
ENABLE_FLASH=yes
;;
esac
done
ADD_QEMU_HDA=yes
for arg in "$@"
do
case $arg in
-hd[a-d]|-fd[ab]|-cdrom)
ADD_QEMU_HDA=no
break
;;
esac
done
fi
#
# Uncomment this block for parameter parsing debug