Patchwork runqemu: Move the KVM check after the MACHINE/KERNEL Checks

login
register
mail settings
Submitter Saul Wold
Date Aug. 23, 2012, 8:46 p.m.
Message ID <1345754787-23198-1-git-send-email-sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/35241/
State Accepted
Commit 8d5e6999caff50a4b7d9a9ba69f9875285270459
Headers show

Comments

Saul Wold - Aug. 23, 2012, 8:46 p.m.
The MACHINE/KERNEL Checks setup MACHINE is it's unset, the KVM checks valid
MACHINE is qemux86 or qemux86-64 and fail if it's unset!

[YOCTO #2970]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 scripts/runqemu |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)
Scott Garman - Aug. 24, 2012, 1:58 a.m.
On 08/23/2012 01:46 PM, Saul Wold wrote:
> The MACHINE/KERNEL Checks setup MACHINE is it's unset, the KVM checks valid
> MACHINE is qemux86 or qemux86-64 and fail if it's unset!
>
> [YOCTO #2970]
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>

Thanks for this.

Acked-by: Scott Garman <scott.a.garman@intel.com>

> ---
>   scripts/runqemu |   31 ++++++++++++++++---------------
>   1 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 290f9cc..a3c3509 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -191,6 +191,22 @@ elif [ ! -w /dev/net/tun ] ; then
>   	exit 1
>   fi
>
> +# Report errors for missing combinations of options
> +if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
> +    error "you must specify at least a MACHINE or KERNEL argument"
> +fi
> +if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
> +    error "NFS booting without an explicit ROOTFS path is not yet supported"
> +fi
> +
> +if [ -z "$MACHINE" ]; then
> +    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> +    if [ -z "$MACHINE" ]; then
> +        error "Unable to set MACHINE from kernel filename [$KERNEL]"
> +    fi
> +    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
> +fi
> +
>   YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
>   # Detect KVM configuration
>   if [ "x$KVM_ENABLED" = "xyes" ]; then
> @@ -220,21 +236,6 @@ if [ "x$KVM_ENABLED" = "xyes" ]; then
>       fi
>   fi
>
> -# Report errors for missing combinations of options
> -if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
> -    error "you must specify at least a MACHINE or KERNEL argument"
> -fi
> -if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
> -    error "NFS booting without an explicit ROOTFS path is not yet supported"
> -fi
> -
> -if [ -z "$MACHINE" ]; then
> -    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> -    if [ -z "$MACHINE" ]; then
> -        error "Unable to set MACHINE from kernel filename [$KERNEL]"
> -    fi
> -    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
> -fi
>   machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'`
>   # MACHINE is now set for all cases
>
>

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 290f9cc..a3c3509 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -191,6 +191,22 @@  elif [ ! -w /dev/net/tun ] ; then
 	exit 1
 fi
 
+# Report errors for missing combinations of options
+if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
+    error "you must specify at least a MACHINE or KERNEL argument"
+fi
+if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
+    error "NFS booting without an explicit ROOTFS path is not yet supported"
+fi
+
+if [ -z "$MACHINE" ]; then
+    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
+    if [ -z "$MACHINE" ]; then
+        error "Unable to set MACHINE from kernel filename [$KERNEL]"
+    fi
+    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
+fi
+
 YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
 # Detect KVM configuration
 if [ "x$KVM_ENABLED" = "xyes" ]; then
@@ -220,21 +236,6 @@  if [ "x$KVM_ENABLED" = "xyes" ]; then
     fi
 fi
 
-# Report errors for missing combinations of options
-if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
-    error "you must specify at least a MACHINE or KERNEL argument"
-fi
-if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
-    error "NFS booting without an explicit ROOTFS path is not yet supported"
-fi
-
-if [ -z "$MACHINE" ]; then
-    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
-    if [ -z "$MACHINE" ]; then
-        error "Unable to set MACHINE from kernel filename [$KERNEL]"
-    fi
-    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
-fi
 machine2=`echo $MACHINE | tr 'a-z' 'A-Z' | sed 's/-/_/'`
 # MACHINE is now set for all cases