diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2017-02-03 13:10:39 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2017-03-16 14:31:18 -0700 |
commit | 2a5d278b59bea224e0f1c727ed8f80871feaed67 (patch) | |
tree | 58827ec08e2e61bf9a4c99d93fe5649b77f2b92c /OvmfPkg | |
parent | ba8ea42738cf5caa8855c59da5359b8e7929568f (diff) | |
download | edk2-2a5d278b59bea224e0f1c727ed8f80871feaed67.zip edk2-2a5d278b59bea224e0f1c727ed8f80871feaed67.tar.gz edk2-2a5d278b59bea224e0f1c727ed8f80871feaed67.tar.bz2 |
OvmfPkg/build.sh: Parse qemu version in more cases
Since qemu v2.7.0, the pkgversion appears to have a bug:
$ ./configure --target-list=x86_64-softmmu --with-pkgversion=foo
Results in this output:
$ x86_64-softmmu/qemu-system-x86_64 -version
QEMU emulator version 2.8.90(foo)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
This appears to have been introduced in:
67a1de0d19 Makefile: Derive "PKGVERSION" from "git describe" by default
The previous commit (077de81a4c) produces this output:
$ x86_64-softmmu/qemu-system-x86_64 -version
QEMU emulator version 2.6.50 (foo), Copyright (c) 2003-2008 Fabrice Bellard
Now the OvmfPkg/build.sh script uses grep with '-o' to return only the
matched text.
grep -E is also used with a simple regex to extract only the digits of
the version.
qemu-bug: https://bugs.launchpad.net/bugs/1673373
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg')
-rwxr-xr-x | OvmfPkg/build.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh index b6e9360..6821552 100755 --- a/OvmfPkg/build.sh +++ b/OvmfPkg/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> -# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -223,7 +223,9 @@ if [ -z "$PLATFORMFILE" ]; then fi if [[ "$RUN_QEMU" == "yes" ]]; then - qemu_version=$($QEMU_COMMAND -version 2>&1 | tail -1 | awk '{print $4}') + qemu_version=$($QEMU_COMMAND -version 2>&1 | \ + grep -o -E 'version [0-9]+\.[0-9]+\.[0-9]+' | \ + awk '{print $2}') case $qemu_version in 1.[6-9].*|1.[1-9][0-9].*|2.*.*) ENABLE_FLASH=yes |