summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2011-09-03 15:50:30 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-09-05 20:25:45 +0100
commitfa4555268833ab30e4a4802c3afce119062951b9 (patch)
tree7f3c893fc65651a3460119d3cd97dcd401f923ac /scripts/runqemu
parent334a2ef94da0d255ee91c6f25a4fb03171b7db90 (diff)
downloadpoky-fa4555268833ab30e4a4802c3afce119062951b9.tar.gz
runqemu: standardize ability to specify custom qemu/kenel boot options
The old manner of specifying custom options to QEMU in this script using angle brackets was a frequent source of confusion. Meanwhile, Otavio Salvador added a decent method of specifying custom kernel boot options to this script. This patch documents the bootparams option and adds a similar way of specifying custom QEMU options using qemuparams="". This fixes [YOCTO #1019] (From OE-Core rev: 1038df14a96d789b3f9e9e1692305ba1fea67886) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu32
1 files changed, 18 insertions, 14 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 113088e548..74938f7404 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -26,17 +26,19 @@ usage() {
26 echo " KERNEL - the kernel image file to use" 26 echo " KERNEL - the kernel image file to use"
27 echo " ROOTFS - the rootfs image file or nfsroot directory to use" 27 echo " ROOTFS - the rootfs image file or nfsroot directory to use"
28 echo " MACHINE=xyz - the machine name (optional, autodetected from KERNEL filename if unspecified)" 28 echo " MACHINE=xyz - the machine name (optional, autodetected from KERNEL filename if unspecified)"
29 echo " Additional QEMU command-line options can be passed with:" 29 echo " Simplified QEMU command-line options can be passed with:"
30 echo " nographic - disables video console" 30 echo " nographic - disables video console"
31 echo " serial - enables a serial console on /dev/ttyS0" 31 echo " serial - enables a serial console on /dev/ttyS0"
32 echo " kvm - enables KVM when running qemux86/qemux86-64, VT capable CPU required" 32 echo " kvm - enables KVM when running qemux86/qemux86-64 (VT-capable CPU required)"
33 echo " \"<extra-qemu-options>\" - enables extra qemu options, excluding serial and kvm" 33 echo " qemuparams=\"xyz\" - specify custom parameters to QEMU"
34 echo " bootparams=\"xyz\" - specify custom kernel parameters during boot"
34 echo "" 35 echo ""
35 echo "Examples:" 36 echo "Examples:"
36 echo " $MYNAME qemuarm" 37 echo " $MYNAME qemuarm"
37 echo " $MYNAME qemux86-64 core-image-sato ext3" 38 echo " $MYNAME qemux86-64 core-image-sato ext3"
38 echo " $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial" 39 echo " $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
39 echo " $MYNAME qemux86 \"<-m 256>\"" 40 echo " $MYNAME qemux86 qemuparams=\"-m 256\""
41 echo " $MYNAME qemux86 bootparams=\"psplash=false\""
40 exit 1 42 exit 1
41} 43}
42 44
@@ -135,6 +137,18 @@ while [ $i -le $# ]; do
135 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio" 137 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
136 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0" 138 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
137 ;; 139 ;;
140 "qemuparams="*)
141 SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
142
143 # Warn user if they try to specify serial or kvm options
144 # to use simplified options instead
145 serial_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-serial\)'`
146 kvm_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-enable-kvm\)'`
147 if [[ ! -z "$serial_option" || ! -z "$kvm_option" ]]; then
148 echo "Error: Please use simplified serial or kvm options instead"
149 usage
150 fi
151 ;;
138 "bootparams="*) 152 "bootparams="*)
139 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT ${arg##bootparams=}" 153 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT ${arg##bootparams=}"
140 ;; 154 ;;
@@ -149,16 +163,6 @@ while [ $i -le $# ]; do
149 KVM_ENABLED="yes" 163 KVM_ENABLED="yes"
150 KVM_CAPABLE=`grep 'vmx\|smx' /proc/cpuinfo` 164 KVM_CAPABLE=`grep 'vmx\|smx' /proc/cpuinfo`
151 ;; 165 ;;
152 \<*\>)
153 SCRIPT_QEMU_EXTRA_OPT=$arg
154 serial_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-serial\)'`
155 kvm_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-enable-kvm\)'`
156 echo "$kvm_option"
157 if [[ ! -z "$serial_option" || ! -z "$kvm_option" ]]; then
158 echo "Error: Please use serial or kvm params instead!"
159 usage
160 fi
161 ;;
162 *) 166 *)
163 # A directory name is an nfs rootfs 167 # A directory name is an nfs rootfs
164 if [ -d "$arg" ]; then 168 if [ -d "$arg" ]; then