diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-03-16 20:20:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-23 15:43:57 +0000 |
commit | 3b0fa0f9f62e0b155968a2bda7dcf4962acb8d16 (patch) | |
tree | fa8bd45cbbf4da674e9325d2506c5a04a1b5925b /scripts/poky-qemu-internal | |
parent | 7eab4aee687b1ea825b78c0ae715de814230fba1 (diff) | |
download | poky-3b0fa0f9f62e0b155968a2bda7dcf4962acb8d16.tar.gz |
scripts/poky-qemu-internal: Pass -m <mem_size> always on commandline
There is a nasty bug in qemu 0.14.0 where it over writes device memory
if the default sizes was not specified on commandline. It can be
worked around by this patch.
I also simplified the memory size calculation logic a bit so we append
'M' to QEMU_MEMORY at the very end instead of sed'ing it afterwards
(From OE-Core rev: 03ef61ed189264a75adbaf32644a80568b410b9b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-x | scripts/poky-qemu-internal | 32 |
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]*\)'` | |||
40 | if [ ! -z "$mem_set" ] ; then | 40 | if [ ! -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:]] *//'` |
43 | fi | 43 | else |
44 | |||
45 | if [ $mem_size -gt 0 ]; then | ||
46 | QEMU_MEMORY="$mem_size"M | ||
47 | fi | ||
48 | |||
49 | if [ -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 | ||
71 | fi | 65 | fi |
72 | 66 | ||
67 | # QEMU_MEMORY has 'M' appended to mem_size | ||
68 | QEMU_MEMORY="$mem_size"M | ||
69 | |||
73 | # Bug 433: qemuarm cannot use > 128 MB RAM | 70 | # Bug 433: qemuarm cannot use > 128 MB RAM |
74 | if [ "$MACHINE" = "qemuarm" ]; then | 71 | if [ "$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 |
82 | fi | 78 | fi |
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 | |||
83 | if [ -z "$mem_set" ] ; then | ||
84 | SCRIPT_QEMU_EXTRA_OPT="$SCRIPT_QEMU_EXTRA_OPT -m $mem_size" | ||
85 | fi | ||
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. |