summaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu-internal
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-xscripts/poky-qemu-internal32
1 files changed, 17 insertions, 15 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index 82ef26594c..067c909085 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -40,40 +40,36 @@ mem_set=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-m[[:space:]] *[0-9]*\)'`
40if [ ! -z "$mem_set" ] ; then 40if [ ! -z "$mem_set" ] ; then
41#Get memory setting size from user input 41#Get memory setting size from user input
42 mem_size=`echo $mem_set | sed 's/-m[[:space:]] *//'` 42 mem_size=`echo $mem_set | sed 's/-m[[:space:]] *//'`
43fi 43else
44
45if [ $mem_size -gt 0 ]; then
46 QEMU_MEMORY="$mem_size"M
47fi
48
49if [ -z "$QEMU_MEMORY" ]; then
50 case "$MACHINE" in 44 case "$MACHINE" in
51 "qemux86") 45 "qemux86")
52 QEMU_MEMORY="128M" 46 mem_size=128
53 ;; 47 ;;
54 "qemux86-64") 48 "qemux86-64")
55 QEMU_MEMORY="128M" 49 mem_size=128
56 ;; 50 ;;
57 "qemuarm") 51 "qemuarm")
58 QEMU_MEMORY="128M" 52 mem_size=128
59 ;; 53 ;;
60 "qemumips") 54 "qemumips")
61 QEMU_MEMORY="128M" 55 mem_size=128
62 ;; 56 ;;
63 "qemuppc") 57 "qemuppc")
64 QEMU_MEMORY="128M" 58 mem_size=128
65 ;; 59 ;;
66 *) 60 *)
67 QEMU_MEMORY="64M" 61 mem_size=64
68 ;; 62 ;;
69 esac 63 esac
70 64
71fi 65fi
72 66
67# QEMU_MEMORY has 'M' appended to mem_size
68QEMU_MEMORY="$mem_size"M
69
73# Bug 433: qemuarm cannot use > 128 MB RAM 70# Bug 433: qemuarm cannot use > 128 MB RAM
74if [ "$MACHINE" = "qemuarm" ]; then 71if [ "$MACHINE" = "qemuarm" ]; then
75 RAM=`echo $QEMU_MEMORY | sed 's/M$//'` 72 if [[ -z "$mem_size" || $mem_size -gt 128 ]]; then
76 if [[ -z "$RAM" || $RAM -gt 128 ]]; then
77 echo "WARNING: qemuarm does not support > 128M of RAM." 73 echo "WARNING: qemuarm does not support > 128M of RAM."
78 echo "Changing QEMU_MEMORY to default of 128M." 74 echo "Changing QEMU_MEMORY to default of 128M."
79 QEMU_MEMORY="128M" 75 QEMU_MEMORY="128M"
@@ -81,6 +77,12 @@ if [ "$MACHINE" = "qemuarm" ]; then
81 fi 77 fi
82fi 78fi
83 79
80# We need to specify -m <mem_size> to overcome a bug in qemu 0.14.0
81# https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/584480
82
83if [ -z "$mem_set" ] ; then
84 SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT -m $mem_size"
85fi
84# This file is created when poky-gen-tapdevs creates a bank of tap 86# This file is created when poky-gen-tapdevs creates a bank of tap
85# devices, indicating that the user should not bring up new ones using 87# devices, indicating that the user should not bring up new ones using
86# sudo. 88# sudo.