]> code.ossystems Code Review - openembedded-core.git/commitdiff
poky-qemu-internal: enforce a 128M memory limit for qemuarm
authorScott Garman <scott.a.garman@intel.com>
Tue, 12 Oct 2010 16:07:09 +0000 (09:07 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 12 Oct 2010 16:21:39 +0000 (17:21 +0100)
This fixes [BUGID #433]

Also set a sane default for the ifconfig command, which simplifies
our autobuilder sanity test setup.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
scripts/poky-qemu-internal

index 834624dedec44ffc02bfd0bb5ebc2095f01f6842..2f8af95707bd0f4c92ce9f33b540873ea8e63380 100755 (executable)
@@ -37,6 +37,9 @@ if [ -z "$QEMU_MEMORY" ]; then
         "qemux86-64")
             QEMU_MEMORY="128M"
             ;;
+        "qemuarm")
+            QEMU_MEMORY="128M"
+            ;;
         "qemumips")
             QEMU_MEMORY="128M"
             ;;
@@ -50,6 +53,16 @@ if [ -z "$QEMU_MEMORY" ]; then
 
 fi
 
+# Bug 433: qemuarm cannot use > 128 MB RAM
+if [ "$MACHINE" = "qemuarm" ]; then
+    RAM=`echo $QEMU_MEMORY | sed 's/M$//'`
+    if [[ -z "$RAM" || $RAM -gt 128 ]]; then
+        echo "WARNING: qemuarm does not support > 128M of RAM."
+        echo "*** Changing QEMU_MEMORY to default of 128M ***"
+        QEMU_MEMORY="128M"
+    fi
+fi
+
 # This file is created when poky-gen-tapdevs creates a bank of tap
 # devices, indicating that the user should not bring up new ones using
 # sudo.
@@ -97,7 +110,12 @@ release_lock() {
 LOCKDIR="/tmp/qemu-tap-locks"
 [ ! -d "$LOCKDIR" ] && mkdir $LOCKDIR
 
-POSSIBLE=`ifconfig -a | grep '^tap' | awk '{print $1}'`
+IFCONFIG=`which ifconfig`
+if [ -z "$IFCONFIG" ]; then
+    IFCONFIG=/sbin/ifconfig
+fi
+
+POSSIBLE=`$IFCONFIG -a | grep '^tap' | awk '{print $1}'`
 TAP=""
 LOCKFILE=""
 for tap in $POSSIBLE; do