diff options
| author | Scott Garman <scott.a.garman@intel.com> | 2010-10-04 21:04:15 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-07 19:57:34 +0100 |
| commit | 0f973ed66551cdd1112ee9df42df5603835b8384 (patch) | |
| tree | 753442dd27a029749846a718353e1fba02a09e49 /scripts/runqemu | |
| parent | e70c8981f250ead9e025ecd27aef94b67d784fc6 (diff) | |
| download | poky-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-x | scripts/runqemu | 218 |
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 | |||
| 21 | if [ "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` | ||
| 29 | else | ||
| 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 | ||
| 34 | fi | ||
| 35 | |||
| 36 | if ! (test -d "$TMPDIR"); then | ||
| 37 | echo >&2 "Error: no $TMPDIR directory, please re-run the script from the Poky build directory." | ||
| 38 | return | ||
| 39 | fi | ||
| 40 | |||
| 41 | SCRIPTSDIR=`dirname "$0"` | ||
| 42 | INTERNAL_SCRIPT=$SCRIPTSDIR/poky-qemu-internal | ||
| 43 | |||
| 44 | if [ "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 | ||
| 53 | else | ||
| 54 | MACHINE=$1 | ||
| 55 | shift | ||
| 56 | fi | ||
| 57 | |||
| 58 | if [ "x$1" != "x" ]; then | ||
| 59 | TYPE=$1 | ||
| 60 | shift | ||
| 61 | else | ||
| 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 | ||
| 72 | fi | ||
| 73 | |||
| 74 | if [ "x$1" != "x" ]; then | ||
| 75 | ZIMAGE=$1 | ||
| 76 | shift | ||
| 77 | fi | ||
| 78 | |||
| 79 | if [ "x$1" != "x" ]; then | ||
| 80 | HDIMAGE=$1 | ||
| 81 | shift | ||
| 82 | fi | ||
| 83 | |||
| 84 | if [ "$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 | ||
| 89 | fi | ||
| 90 | |||
| 91 | function 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 | |||
| 112 | if [ "$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 | ||
| 119 | fi | ||
| 120 | |||
| 121 | if [ "$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 | ||
| 132 | fi | ||
| 133 | |||
| 134 | if [ "$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 | ||
| 145 | fi | ||
| 146 | |||
| 147 | if [ "$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 | ||
| 153 | fi | ||
| 154 | |||
| 155 | if [ "$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 | ||
| 161 | fi | ||
| 162 | |||
| 163 | if [ "$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 | ||
| 169 | fi | ||
| 170 | |||
| 171 | |||
| 172 | if [ "$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 | ||
| 183 | fi | ||
| 184 | |||
| 185 | if [ "$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 | ||
| 196 | fi | ||
| 197 | |||
| 198 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then | ||
| 199 | TARGET_SYS="arm-poky-linux" | ||
| 200 | elif [ "$MACHINE" = "qemux86" ]; then | ||
| 201 | TARGET_SYS="i586-poky-linux" | ||
| 202 | elif [ "$MACHINE" = "qemux86-64" ]; then | ||
| 203 | TARGET_SYS="x86_64-poky-linux" | ||
| 204 | elif [ "$MACHINE" = "qemumips" ]; then | ||
| 205 | TARGET_SYS="mips-poky-linux" | ||
| 206 | fi | ||
| 207 | |||
| 208 | CROSSPATH=$TMPDIR/sysroots/$BUILD_SYS/usr/bin:$CROSSPATH | ||
| 209 | |||
| 210 | SYSROOT_SETUP_SCRIPT=`which poky-find-native-sysroot` | ||
| 211 | if [ -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 | ||
| 215 | fi | ||
| 216 | . $SYSROOT_SETUP_SCRIPT | ||
| 217 | |||
| 218 | . $INTERNAL_SCRIPT | ||
