summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu46
1 files changed, 23 insertions, 23 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 7c2c4b31db..18fd691873 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -70,10 +70,10 @@ process_filename() {
70 echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]" 70 echo "Error: conflicting KERNEL args [$KERNEL] and [$filename]"
71 usage 71 usage
72 fi 72 fi
73 elif [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" || 73 elif [ "x$EXT" = "xext2" -o "x$EXT" = "xext3" -o \
74 "x$EXT" == "xjffs2" || "x$EXT" == "xbtrfs" ]]; then 74 "x$EXT" = "xjffs2" -o "x$EXT" = "xbtrfs" ]; then
75 # A file ending in a supportted fs type is a rootfs image 75 # A file ending in a supportted fs type is a rootfs image
76 if [[ -z "$FSTYPE" || "$FSTYPE" == "$EXT" ]]; then 76 if [ -z "$FSTYPE" -o "$FSTYPE" = "$EXT" ]; then
77 FSTYPE=$EXT 77 FSTYPE=$EXT
78 ROOTFS=$filename 78 ROOTFS=$filename
79 else 79 else
@@ -102,7 +102,7 @@ while [ $i -le $# ]; do
102 fi 102 fi
103 ;; 103 ;;
104 "ext2" | "ext3" | "jffs2" | "nfs" | "btrfs") 104 "ext2" | "ext3" | "jffs2" | "nfs" | "btrfs")
105 if [[ -z "$FSTYPE" || "$FSTYPE" == "$arg" ]]; then 105 if [ -z "$FSTYPE" -o "$FSTYPE" = "$arg" ]; then
106 FSTYPE=$arg 106 FSTYPE=$arg
107 else 107 else
108 echo "Error: conflicting FSTYPE types [$FSTYPE] and [$arg]" 108 echo "Error: conflicting FSTYPE types [$FSTYPE] and [$arg]"
@@ -143,7 +143,7 @@ while [ $i -le $# ]; do
143 # to use simplified options instead 143 # to use simplified options instead
144 serial_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-serial\)'` 144 serial_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-serial\)'`
145 kvm_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-enable-kvm\)'` 145 kvm_option=`expr "$SCRIPT_QEMU_EXTRA_OPT" : '.*\(-enable-kvm\)'`
146 if [[ ! -z "$serial_option" || ! -z "$kvm_option" ]]; then 146 if [ ! -z "$serial_option" -o ! -z "$kvm_option" ]; then
147 echo "Error: Please use simplified serial or kvm options instead" 147 echo "Error: Please use simplified serial or kvm options instead"
148 usage 148 usage
149 fi 149 fi
@@ -152,7 +152,7 @@ while [ $i -le $# ]; do
152 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT ${arg##bootparams=}" 152 SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT ${arg##bootparams=}"
153 ;; 153 ;;
154 "audio") 154 "audio")
155 if [[ "x$MACHINE" == "xqemux86" || "x$MACHINE" == "xqemux86-64" ]]; then 155 if [ "x$MACHINE" = "xqemux86" -o "x$MACHINE" = "xqemux86-64" ]; then
156 echo "Enable audio on qemu. Pls. install snd_intel8x0 or snd_ens1370 driver in linux guest."; 156 echo "Enable audio on qemu. Pls. install snd_intel8x0 or snd_ens1370 driver in linux guest.";
157 QEMU_AUDIO_DRV="alsa" 157 QEMU_AUDIO_DRV="alsa"
158 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -soundhw ac97,es1370" 158 SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -soundhw ac97,es1370"
@@ -166,7 +166,7 @@ while [ $i -le $# ]; do
166 # A directory name is an nfs rootfs 166 # A directory name is an nfs rootfs
167 if [ -d "$arg" ]; then 167 if [ -d "$arg" ]; then
168 echo "Assuming $arg is an nfs rootfs" 168 echo "Assuming $arg is an nfs rootfs"
169 if [[ -z "$FSTYPE" || "$FSTYPE" == "nfs" ]]; then 169 if [ -z "$FSTYPE" -o "$FSTYPE" = "nfs" ]; then
170 FSTYPE=nfs 170 FSTYPE=nfs
171 else 171 else
172 echo "Error: conflicting FSTYPE types [$arg] and nfs" 172 echo "Error: conflicting FSTYPE types [$arg] and nfs"
@@ -200,13 +200,13 @@ fi
200 200
201YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" 201YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
202# Detect KVM configuration 202# Detect KVM configuration
203if [[ "x$KVM_ENABLED" == "xyes" ]]; then 203if [ "x$KVM_ENABLED" = "xyes" ]; then
204 if [[ -z "$KVM_CAPABLE" ]]; then 204 if [ -z "$KVM_CAPABLE" ]; then
205 echo "You are tring to enable KVM on cpu without VT support. Remove kvm from the command-line, or refer"; 205 echo "You are tring to enable KVM on cpu without VT support. Remove kvm from the command-line, or refer";
206 echo "$YOCTO_KVM_WIKI"; 206 echo "$YOCTO_KVM_WIKI";
207 exit 1; 207 exit 1;
208 fi 208 fi
209 if [[ "x$MACHINE" != "xqemux86" && "x$MACHINE" != "xqemux86-64" ]]; then 209 if [ "x$MACHINE" != "xqemux86" -a "x$MACHINE" != "xqemux86-64" ]; then
210 echo "KVM only support x86 & x86-64. Remove kvm from the command-line"; 210 echo "KVM only support x86 & x86-64. Remove kvm from the command-line";
211 exit 1; 211 exit 1;
212 fi 212 fi
@@ -225,11 +225,11 @@ if [[ "x$KVM_ENABLED" == "xyes" ]]; then
225fi 225fi
226 226
227# Report errors for missing combinations of options 227# Report errors for missing combinations of options
228if [[ -z "$MACHINE" && -z "$KERNEL" ]]; then 228if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
229 echo "Error: you must specify at least a MACHINE or KERNEL argument" 229 echo "Error: you must specify at least a MACHINE or KERNEL argument"
230 usage 230 usage
231fi 231fi
232if [[ "$FSTYPE" == "nfs" && -z "$ROOTFS" ]]; then 232if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
233 echo "Error: NFS booting without an explicit ROOTFS path is not yet supported" 233 echo "Error: NFS booting without an explicit ROOTFS path is not yet supported"
234 usage 234 usage
235fi 235fi
@@ -313,11 +313,11 @@ findimage() {
313 # recently created one is the one we most likely want to boot. 313 # recently created one is the one we most likely want to boot.
314 filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs` 314 filenames=`ls -t $where/*-image*$machine.$extension 2>/dev/null | xargs`
315 for name in $filenames; do 315 for name in $filenames; do
316 if [[ "$name" =~ core-image-sato-sdk || 316 if [ "$name" =~ core-image-sato-sdk -o \
317 "$name" =~ core-image-sato || 317 "$name" =~ core-image-sato -o \
318 "$name" =~ core-image-lsb || 318 "$name" =~ core-image-lsb -o \
319 "$name" =~ core-image-basic || 319 "$name" =~ core-image-basic -o \
320 "$name" =~ core-image-minimal ]]; then 320 "$name" =~ core-image-minimal ]; then
321 ROOTFS=$name 321 ROOTFS=$name
322 return 322 return
323 fi 323 fi
@@ -327,11 +327,11 @@ findimage() {
327 exit 1 327 exit 1
328} 328}
329 329
330if [[ -e "$ROOTFS" && -z "$FSTYPE" ]]; then 330if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
331 # Extract the filename extension 331 # Extract the filename extension
332 EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'` 332 EXT=`echo $ROOTFS | awk -F . '{ print \$NF }'`
333 if [[ "x$EXT" == "xext2" || "x$EXT" == "xext3" || 333 if [ "x$EXT" = "xext2" -o "x$EXT" = "xext3" -o \
334 "x$EXT" == "xjffs2" || "x$EXT" == "xbtrfs" ]]; then 334 "x$EXT" = "xjffs2" -o "x$EXT" = "xbtrfs" ]; then
335 FSTYPE=$EXT 335 FSTYPE=$EXT
336 else 336 else
337 echo "Note: Unable to determine filesystem extension for $ROOTFS" 337 echo "Note: Unable to determine filesystem extension for $ROOTFS"
@@ -396,9 +396,9 @@ setup_sysroot
396# We can't run without a libGL.so 396# We can't run without a libGL.so
397libgl='no' 397libgl='no'
398 398
399test -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so && libgl='yes' 399[ -e /usr/lib/libGL.so -a -e /usr/lib/libGLU.so ] && libgl='yes'
400test -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so && libgl='yes' 400[ -e /usr/lib64/libGL.so -a -e /usr/lib64/libGLU.so ] && libgl='yes'
401test -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so && libgl='yes' 401[ -e /usr/lib/*-linux-gnu/libGL.so -a -e /usr/lib/*-linux-gnu/libGLU.so ] && libgl='yes'
402 402
403if [ "$libgl" != 'yes' ]; then 403if [ "$libgl" != 'yes' ]; then
404 echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator. 404 echo "You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.