]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/build.sh
OvmfPkg/README: Add information about OVMF flash layout
[mirror_edk2.git] / OvmfPkg / build.sh
index 6751551b1014b5632c38718c0ce7f08722617978..65add5c9e93c3cce222ab0e279586d078662f035 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2013, 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
@@ -139,11 +139,30 @@ done
 case $PROCESSOR in
   IA32)
     Processor=Ia32
-    QEMU_COMMAND=qemu
+    if [ -n "$QEMU_COMMAND" ]; then
+      #
+      # The user set the QEMU_COMMAND variable. We'll use it to run QEMU.
+      #
+      :
+    elif  [ -x `which qemu-system-i386` ]; then
+      QEMU_COMMAND=qemu-system-i386
+    elif  [ -x `which qemu-system-x86_64` ]; then
+      QEMU_COMMAND=qemu-system-x86_64
+    elif  [ -x `which qemu` ]; then
+      QEMU_COMMAND=qemu
+    else
+      echo Unable to find QEMU for IA32 architecture!
+      exit 1
+    fi
     ;;
   X64)
     Processor=X64
-    QEMU_COMMAND=qemu-system-x86_64
+    if [ -z "$QEMU_COMMAND" ]; then
+      #
+      # The user didn't set the QEMU_COMMAND variable.
+      #
+      QEMU_COMMAND=qemu-system-x86_64
+    fi
     ;;
   *)
     echo Unsupported processor architecture: $PROCESSOR