diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index c7c51ec77a..bb26f8b633 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -19,11 +19,23 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | if [ "x$BUILDDIR" = "x" ]; then | 21 | if [ "x$BUILDDIR" = "x" ]; then |
22 | echo "You need to source poky-init-build-env before running this script" | 22 | # BUILDDIR unset, try and get TMPDIR from bitbake |
23 | exit 1 | 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 from the environment | ||
27 | TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2` | ||
28 | else | ||
29 | TMPDIR=$BUILDDIR/tmp | ||
30 | fi | ||
31 | |||
32 | if ! (test -d "$TMPDIR"); then | ||
33 | echo >&2 "Error: no $TMPDIR directory, please re-run the script from the Poky build directory." | ||
34 | return | ||
24 | fi | 35 | fi |
25 | 36 | ||
26 | INTERNAL_SCRIPT=`which poky-qemu-internal` | 37 | SCRIPTSDIR=`dirname "$0"` |
38 | INTERNAL_SCRIPT=SCRIPTSDIR/poky-qemu-internal` | ||
27 | 39 | ||
28 | if [ "x$1" = "x" ]; then | 40 | if [ "x$1" = "x" ]; then |
29 | echo | 41 | echo |
@@ -67,9 +79,9 @@ fi | |||
67 | 79 | ||
68 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then | 80 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then |
69 | if [ "x$ZIMAGE" = "x" ]; then | 81 | if [ "x$ZIMAGE" = "x" ]; then |
70 | ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin | 82 | ZIMAGE=$TMPDIR/deploy/images/zImage-$MACHINE.bin |
71 | fi | 83 | fi |
72 | CROSSPATH=$BUILDDIR/sysroots/$BUILD_SYS/arm-poky-linux-gnueabi/bin | 84 | CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/arm-poky-linux-gnueabi/bin |
73 | fi | 85 | fi |
74 | 86 | ||
75 | function findimage { | 87 | function findimage { |
@@ -96,7 +108,7 @@ function findimage { | |||
96 | if [ "$MACHINE" = "qemuarm" ]; then | 108 | if [ "$MACHINE" = "qemuarm" ]; then |
97 | if [ "$TYPE" = "ext3" ]; then | 109 | if [ "$TYPE" = "ext3" ]; then |
98 | if [ "x$HDIMAGE" = "x" ]; then | 110 | if [ "x$HDIMAGE" = "x" ]; then |
99 | T=$BUILDDIR/tmp/deploy/images | 111 | T=$TMPDIR/deploy/images |
100 | findimage $T qemuarm ext3 "poky-image-sdk poky-image-sato poky-image-minimal" | 112 | findimage $T qemuarm ext3 "poky-image-sdk poky-image-sato poky-image-minimal" |
101 | fi | 113 | fi |
102 | fi | 114 | fi |
@@ -104,34 +116,34 @@ fi | |||
104 | 116 | ||
105 | if [ "$MACHINE" = "qemumips" ]; then | 117 | if [ "$MACHINE" = "qemumips" ]; then |
106 | if [ "x$ZIMAGE" = "x" ]; then | 118 | if [ "x$ZIMAGE" = "x" ]; then |
107 | ZIMAGE=$BUILDDIR/tmp/deploy/images/vmlinux-$MACHINE.bin | 119 | ZIMAGE=$TMPDIR/tmp/deploy/images/vmlinux-$MACHINE.bin |
108 | fi | 120 | fi |
109 | if [ "$TYPE" = "ext3" ]; then | 121 | if [ "$TYPE" = "ext3" ]; then |
110 | if [ "x$HDIMAGE" = "x" ]; then | 122 | if [ "x$HDIMAGE" = "x" ]; then |
111 | T=$BUILDDIR/tmp/deploy/images | 123 | T=$TMPDIR/tmp/deploy/images |
112 | findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-minimal" | 124 | findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-minimal" |
113 | fi | 125 | fi |
114 | fi | 126 | fi |
115 | CROSSPATH=$BUILDDIR/tmp/sysroots/$BUILD_SYS/usr | 127 | CROSSPATH=$TMPDIR/tmp/sysroots/$BUILD_SYS/usr |
116 | fi | 128 | fi |
117 | 129 | ||
118 | if [ "$MACHINE" = "qemuppc" ]; then | 130 | if [ "$MACHINE" = "qemuppc" ]; then |
119 | if [ "x$ZIMAGE" = "x" ]; then | 131 | if [ "x$ZIMAGE" = "x" ]; then |
120 | ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin | 132 | ZIMAGE=$TMPDIR/tmp/deploy/images/zImage-$MACHINE.bin |
121 | fi | 133 | fi |
122 | if [ "$TYPE" = "ext3" ]; then | 134 | if [ "$TYPE" = "ext3" ]; then |
123 | if [ "x$HDIMAGE" = "x" ]; then | 135 | if [ "x$HDIMAGE" = "x" ]; then |
124 | T=$BUILDDIR/tmp/deploy/images | 136 | T=$TMPDIR/tmp/deploy/images |
125 | findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-minimal" | 137 | findimage $T $MACHINE ext3 "poky-image-sdk poky-image-sato poky-image-minimal" |
126 | fi | 138 | fi |
127 | fi | 139 | fi |
128 | CROSSPATH=$BUILDDIR/tmp/sysroots/$BUILD_SYS/usr | 140 | CROSSPATH=$TMPDIR/tmp/sysroots/$BUILD_SYS/usr |
129 | fi | 141 | fi |
130 | 142 | ||
131 | if [ "$MACHINE" = "spitz" ]; then | 143 | if [ "$MACHINE" = "spitz" ]; then |
132 | if [ "$TYPE" = "ext3" ]; then | 144 | if [ "$TYPE" = "ext3" ]; then |
133 | if [ "x$HDIMAGE" = "x" ]; then | 145 | if [ "x$HDIMAGE" = "x" ]; then |
134 | HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-spitz.ext3 | 146 | HDIMAGE=$TMPDIR/tmp/deploy/images/poky-image-sato-spitz.ext3 |
135 | fi | 147 | fi |
136 | fi | 148 | fi |
137 | fi | 149 | fi |
@@ -139,7 +151,7 @@ fi | |||
139 | if [ "$MACHINE" = "akita" ]; then | 151 | if [ "$MACHINE" = "akita" ]; then |
140 | if [ "$TYPE" = "jffs2" ]; then | 152 | if [ "$TYPE" = "jffs2" ]; then |
141 | if [ "x$HDIMAGE" = "x" ]; then | 153 | if [ "x$HDIMAGE" = "x" ]; then |
142 | HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-akita.jffs2 | 154 | HDIMAGE=$TMPDIR/tmp/deploy/images/poky-image-sato-akita.jffs2 |
143 | fi | 155 | fi |
144 | fi | 156 | fi |
145 | fi | 157 | fi |
@@ -147,7 +159,7 @@ fi | |||
147 | if [ "$MACHINE" = "nokia800" ]; then | 159 | if [ "$MACHINE" = "nokia800" ]; then |
148 | if [ "$TYPE" = "jffs2" ]; then | 160 | if [ "$TYPE" = "jffs2" ]; then |
149 | if [ "x$HDIMAGE" = "x" ]; then | 161 | if [ "x$HDIMAGE" = "x" ]; then |
150 | HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-nokia800.jffs2 | 162 | HDIMAGE=$TMPDIR/tmp/deploy/images/poky-image-sato-nokia800.jffs2 |
151 | fi | 163 | fi |
152 | fi | 164 | fi |
153 | fi | 165 | fi |
@@ -155,15 +167,15 @@ fi | |||
155 | 167 | ||
156 | if [ "$MACHINE" = "qemux86" ]; then | 168 | if [ "$MACHINE" = "qemux86" ]; then |
157 | if [ "x$ZIMAGE" = "x" ]; then | 169 | if [ "x$ZIMAGE" = "x" ]; then |
158 | ZIMAGE=$BUILDDIR/tmp/deploy/images/bzImage-$MACHINE.bin | 170 | ZIMAGE=$TMPDIR/tmp/deploy/images/bzImage-$MACHINE.bin |
159 | fi | 171 | fi |
160 | if [ "$TYPE" = "ext3" ]; then | 172 | if [ "$TYPE" = "ext3" ]; then |
161 | if [ "x$HDIMAGE" = "x" ]; then | 173 | if [ "x$HDIMAGE" = "x" ]; then |
162 | T=$BUILDDIR/tmp/deploy/images | 174 | T=$TMPDIR/tmp/deploy/images |
163 | findimage $T qemux86 ext3 "moblin-image-sdk moblin-image-netbook poky-image-sdk poky-image-sato poky-image-minimal" | 175 | findimage $T qemux86 ext3 "moblin-image-sdk moblin-image-netbook poky-image-sdk poky-image-sato poky-image-minimal" |
164 | fi | 176 | fi |
165 | fi | 177 | fi |
166 | CROSSPATH=$BUILDDIR/tmp/sysroots/$BUILD_SYS/usr | 178 | CROSSPATH=$TMPDIR/tmp/sysroots/$BUILD_SYS/usr |
167 | fi | 179 | fi |
168 | 180 | ||
169 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then | 181 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then |
@@ -182,6 +194,6 @@ if [ ! -e $CROSSPATH/$TARGET_SYS/bin/gcc ]; then | |||
182 | ln -s $CROSSPATH/bin/$TARGET_SYS-gcc $CROSSPATH/$TARGET_SYS/bin/gcc | 194 | ln -s $CROSSPATH/bin/$TARGET_SYS-gcc $CROSSPATH/$TARGET_SYS/bin/gcc |
183 | fi | 195 | fi |
184 | 196 | ||
185 | CROSSPATH=$BUILDDIR/tmp/sysroots/$BUILD_SYS/usr/bin:$CROSSPATH:$BUILDDIR/tmp/cross/bin | 197 | CROSSPATH=$TMPDIR/tmp/sysroots/$BUILD_SYS/usr/bin:$CROSSPATH:$TMPDIR/tmp/cross/bin |
186 | 198 | ||
187 | . $INTERNAL_SCRIPT | 199 | . $INTERNAL_SCRIPT |