summaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu-internal
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-xscripts/poky-qemu-internal22
1 files changed, 20 insertions, 2 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index ca2511a024..5e74169bdf 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -29,6 +29,23 @@
29# ROOTFS - the disk image file to use 29# ROOTFS - the disk image file to use
30# 30#
31 31
32
33mem_size=-1
34
35#Get rid of <> and get the contents of extra qemu running params
36SCRIPT_QEMU_EXTRA_OPT=`echo $SCRIPT_QEMU_EXTRA_OPT | sed -e 's/<//' -e 's/>//'`
37#if user set qemu memory, eg: -m 256 in qemu extra params, we need to do some
38# validation check
39mem_set=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-m[[:space:]] *[0-9]*\)'`
40if [ ! -z "$mem_set" ] ; then
41#Get memory setting size from user input
42 mem_size=`echo $mem_set | sed 's/-m[[:space:]] *//'`
43fi
44
45if [ $mem_size -gt 0 ]; then
46 QEMU_MEMORY="$mem_size"M
47fi
48
32if [ -z "$QEMU_MEMORY" ]; then 49if [ -z "$QEMU_MEMORY" ]; then
33 case "$MACHINE" in 50 case "$MACHINE" in
34 "qemux86") 51 "qemux86")
@@ -60,6 +77,7 @@ if [ "$MACHINE" = "qemuarm" ]; then
60 echo "WARNING: qemuarm does not support > 128M of RAM." 77 echo "WARNING: qemuarm does not support > 128M of RAM."
61 echo "*** Changing QEMU_MEMORY to default of 128M ***" 78 echo "*** Changing QEMU_MEMORY to default of 128M ***"
62 QEMU_MEMORY="128M" 79 QEMU_MEMORY="128M"
80 SCRIPT_QEMU_EXTRA_OPT=`echo $SCRIPT_QEMU_EXTRA_OPT | sed -e "s/$mem_set/-m 128/" `
63 fi 81 fi
64fi 82fi
65 83
@@ -427,8 +445,8 @@ fi
427 445
428echo "Running $QEMU..." 446echo "Running $QEMU..."
429# -no-reboot is a mandatory option - see bug #100 447# -no-reboot is a mandatory option - see bug #100
430echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_CMDLINE_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"' 448echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
431$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || /bin/true 449$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || /bin/true
432 450
433cleanup 451cleanup
434 452