summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2010-10-04 21:04:15 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-07 19:57:34 +0100
commit0f973ed66551cdd1112ee9df42df5603835b8384 (patch)
tree753442dd27a029749846a718353e1fba02a09e49 /scripts/runqemu
parente70c8981f250ead9e025ecd27aef94b67d784fc6 (diff)
downloadpoky-0f973ed66551cdd1112ee9df42df5603835b8384.tar.gz
Merge runqemu features into poky-qemu
This merges the functionality of the runqemu script into poky-qemu. It also removes the requirement to order command line args to poky-qemu in any particular order. This fixes a slew of runqemu-related bugs by making the runqemu script obsolete (and fixing the issues in the new poky-qemu), including [BUGID #294] [BUGID #295] [BUGID #371] and [BUGID #324]. Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu218
1 files changed, 0 insertions, 218 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
deleted file mode 100755
index 8a1c2120c2..0000000000
--- a/scripts/runqemu
+++ /dev/null
@@ -1,218 +0,0 @@
1#!/bin/bash
2
3# Handle Poky <-> QEmu interface voodoo
4#
5# Copyright (C) 2006-2007 OpenedHand Ltd.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
21if [ "x$BUILDDIR" = "x" ]; then
22 # BUILDDIR unset, try and get TMPDIR from bitbake
23 type -P bitbake &>/dev/null || {
24 echo "You either need bitbake in your PATH or to source poky-init-build-env before running this script" >&2; exit 1; }
25
26 # we have bitbake in PATH, get TMPDIR and BUILD_SYS from the environment
27 TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
28 BUILD_SYS=`bitbake -e | grep BUILD_SYS=\" | cut -d '=' -f2 | cut -d '"' -f2`
29else
30 BUILD_ARCH=`uname -m`
31 BUILD_OS=`uname | tr '[A-Z]' '[a-z]'`
32 BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
33 TMPDIR=$BUILDDIR/tmp
34fi
35
36if ! (test -d "$TMPDIR"); then
37 echo >&2 "Error: no $TMPDIR directory, please re-run the script from the Poky build directory."
38 return
39fi
40
41SCRIPTSDIR=`dirname "$0"`
42INTERNAL_SCRIPT=$SCRIPTSDIR/poky-qemu-internal
43
44if [ "x$1" = "x" ]; then
45 echo
46 echo "Run as $0 MACHINE IMAGETYPE ZIMAGE IMAGEFILE"
47 echo "where:"
48 echo " MACHINE - the machine to emulate (qemuarm, qemux86)"
49 echo " IMAGETYPE - the type of image to run (ext3, nfs) (default: ext3)"
50 echo " ZIMAGE - the kernel to use (optional)"
51 echo " IMAGEFILE - the image file/location to use (optional)"
52 exit 1
53else
54 MACHINE=$1
55 shift
56fi
57
58if [ "x$1" != "x" ]; then
59 TYPE=$1
60 shift
61else
62 TYPE="ext3"
63 if [ "$MACHINE" = "akita" ]; then
64 TYPE="jffs2"
65 fi
66 if [ "$MACHINE" = "nokia800" ]; then
67 TYPE="jffs2"
68 fi
69 if [ "$MACHINE" = "spitz" ]; then
70 TYPE="ext3"
71 fi
72fi
73
74if [ "x$1" != "x" ]; then
75 ZIMAGE=$1
76 shift
77fi
78
79if [ "x$1" != "x" ]; then
80 HDIMAGE=$1
81 shift
82fi
83
84if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then
85 if [ "x$ZIMAGE" = "x" ]; then
86 ZIMAGE=$TMPDIR/deploy/images/zImage-$MACHINE.bin
87 fi
88 CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/bin
89fi
90
91function findimage {
92 where=$1
93 machine=$2
94 extension=$3
95 names=$4
96 for name in $names;
97 do
98 fullname=$where/$name-$machine.$extension
99 if [ -e "$fullname" ]; then
100 HDIMAGE=$fullname
101 return
102 fi
103 done
104 echo "Couldn't find image in $where. Attempted image names were:"
105 for name in $names;
106 do
107 echo $name-$machine.$extension
108 done
109 exit 1
110}
111
112if [ "$MACHINE" = "qemuarm" ]; then
113 if [ "$TYPE" = "ext3" ]; then
114 if [ "x$HDIMAGE" = "x" ]; then
115 T=$TMPDIR/deploy/images
116 findimage $T qemuarm ext3 "poky-image-sdk poky-image-sato poky-image-lsb poky-image-basic poky-image-minimal"
117 fi
118 fi
119fi
120
121if [ "$MACHINE" = "qemumips" ]; then
122 if [ "x$ZIMAGE" = "x" ]; then
123 ZIMAGE=$TMPDIR/deploy/images/vmlinux-$MACHINE.bin
124 fi
125 if [ "$TYPE" = "ext3" ]; then
126 if [ "x$HDIMAGE" = "x" ]; then
127 T=$TMPDIR/deploy/images
128 findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-lsb poky-image-basic poky-image-minimal"
129 fi
130 fi
131 CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr
132fi
133
134if [ "$MACHINE" = "qemuppc" ]; then
135 if [ "x$ZIMAGE" = "x" ]; then
136 ZIMAGE=$TMPDIR/deploy/images/zImage-$MACHINE.bin
137 fi
138 if [ "$TYPE" = "ext3" ]; then
139 if [ "x$HDIMAGE" = "x" ]; then
140 T=$TMPDIR/deploy/images
141 findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-lsb poky-image-basic poky-image-minimal"
142 fi
143 fi
144 CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr
145fi
146
147if [ "$MACHINE" = "spitz" ]; then
148 if [ "$TYPE" = "ext3" ]; then
149 if [ "x$HDIMAGE" = "x" ]; then
150 HDIMAGE=$TMPDIR/deploy/images/poky-image-sato-spitz.ext3
151 fi
152 fi
153fi
154
155if [ "$MACHINE" = "akita" ]; then
156 if [ "$TYPE" = "jffs2" ]; then
157 if [ "x$HDIMAGE" = "x" ]; then
158 HDIMAGE=$TMPDIR/deploy/images/poky-image-sato-akita.jffs2
159 fi
160 fi
161fi
162
163if [ "$MACHINE" = "nokia800" ]; then
164 if [ "$TYPE" = "jffs2" ]; then
165 if [ "x$HDIMAGE" = "x" ]; then
166 HDIMAGE=$TMPDIR/deploy/images/poky-image-sato-nokia800.jffs2
167 fi
168 fi
169fi
170
171
172if [ "$MACHINE" = "qemux86" ]; then
173 if [ "x$ZIMAGE" = "x" ]; then
174 ZIMAGE=$TMPDIR/deploy/images/bzImage-$MACHINE.bin
175 fi
176 if [ "$TYPE" = "ext3" ]; then
177 if [ "x$HDIMAGE" = "x" ]; then
178 T=$TMPDIR/deploy/images
179 findimage $T qemux86 ext3 "moblin-image-sdk moblin-image-netbook poky-image-sdk poky-image-sato poky-image-lsb poky-image-basic poky-image-minimal"
180 fi
181 fi
182 CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr
183fi
184
185if [ "$MACHINE" = "qemux86-64" ]; then
186 if [ "x$ZIMAGE" = "x" ]; then
187 ZIMAGE=$TMPDIR/deploy/images/bzImage-$MACHINE.bin
188 fi
189 if [ "$TYPE" = "ext3" ]; then
190 if [ "x$HDIMAGE" = "x" ]; then
191 T=$TMPDIR/deploy/images
192 findimage $T qemux86-64 ext3 "moblin-image-sdk moblin-image-netbook poky-image-sdk poky-image-sato poky-image-lsb poky-image-basic poky-image-minimal"
193 fi
194 fi
195 CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr
196fi
197
198if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then
199 TARGET_SYS="arm-poky-linux"
200elif [ "$MACHINE" = "qemux86" ]; then
201 TARGET_SYS="i586-poky-linux"
202elif [ "$MACHINE" = "qemux86-64" ]; then
203 TARGET_SYS="x86_64-poky-linux"
204elif [ "$MACHINE" = "qemumips" ]; then
205 TARGET_SYS="mips-poky-linux"
206fi
207
208CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr/bin:$CROSSPATH
209
210SYSROOT_SETUP_SCRIPT=`which poky-find-native-sysroot`
211if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
212 echo "Error: Unable to find the poky-find-native-sysroot script"
213 echo "Did you forget to source your Poky environment script?"
214 exit 1
215fi
216. $SYSROOT_SETUP_SCRIPT
217
218. $INTERNAL_SCRIPT