diff options
| -rwxr-xr-x | scripts/poky-nokia800-flashutil | 53 | ||||
| -rwxr-xr-x | scripts/poky-qemu-internal | 37 | ||||
| -rwxr-xr-x | scripts/runqemu | 14 |
3 files changed, 98 insertions, 6 deletions
diff --git a/scripts/poky-nokia800-flashutil b/scripts/poky-nokia800-flashutil new file mode 100755 index 0000000000..8d40f1dbf9 --- /dev/null +++ b/scripts/poky-nokia800-flashutil | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | # Copyright (C) 2008 OpenedHand Ltd. | ||
| 3 | # Contact: andrew@openedhand.com | ||
| 4 | # | ||
| 5 | # Erase the partition given in $3 (default: rootfs) and flash the contents | ||
| 6 | # of image given in $1 into the image $2. | ||
| 7 | |||
| 8 | if [ ! -r "$1" ]; then | ||
| 9 | echo "Usage: $0 <image> <destimage> [<partition>]" | ||
| 10 | exit -1 | ||
| 11 | fi | ||
| 12 | |||
| 13 | if [ ! -e "$2" ]; then | ||
| 14 | echo "foo" | ||
| 15 | # Making an empty/erased flash image. Need a correct echo behavior. | ||
| 16 | dd if=/dev/zero of=$2 bs=268435456 count=0 seek=1 | ||
| 17 | bash -c 'echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b' | ||
| 18 | cat .8b .8b > .16b # OOB is 16 bytes | ||
| 19 | cat .16b .16b .16b .16b .16b .16b .16b .16b > .8sec | ||
| 20 | cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec | ||
| 21 | cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec | ||
| 22 | cat .512sec .512sec .512sec .512sec > .2ksec | ||
| 23 | cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16k | ||
| 24 | cat .16k .16k .16k .16k .16k .16k .16k .16k > .128k | ||
| 25 | # N800 NAND is 512k sectors big | ||
| 26 | cat .128k .128k .128k .128k >> $2 | ||
| 27 | rm -rf .8b .16b .8sec .64sec .512sec .2ksec .16k, .128k | ||
| 28 | fi | ||
| 29 | |||
| 30 | if [ "$3" != "" ]; then | ||
| 31 | case "$3" in | ||
| 32 | config) | ||
| 33 | partition=/dev/mtd1 | ||
| 34 | page=64 | ||
| 35 | ;; | ||
| 36 | initfs) | ||
| 37 | partition=/dev/mtd3 | ||
| 38 | page=1280 | ||
| 39 | ;; | ||
| 40 | rootfs) | ||
| 41 | partition=/dev/mtd4 | ||
| 42 | page=2304 | ||
| 43 | ;; | ||
| 44 | *) | ||
| 45 | echo "Unknown partition $2" | ||
| 46 | exit -1 | ||
| 47 | esac | ||
| 48 | else | ||
| 49 | partition=/dev/mtd4 | ||
| 50 | page=2304 | ||
| 51 | fi | ||
| 52 | |||
| 53 | dd if=$1 of=$2 conv=notrunc bs=2048 seek=$page | ||
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index 1a8fb63b35..4ddb116130 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal | |||
| @@ -30,16 +30,16 @@ | |||
| 30 | # HDIMAGE - the disk image file to use | 30 | # HDIMAGE - the disk image file to use |
| 31 | # | 31 | # |
| 32 | 32 | ||
| 33 | if [ -z "$QEMU_MEMORY" ]; then | ||
| 34 | QEMU_MEMORY="64M" | ||
| 35 | fi | ||
| 36 | |||
| 33 | QEMUIFUP=`which poky-qemu-ifup` | 37 | QEMUIFUP=`which poky-qemu-ifup` |
| 34 | QEMUIFDOWN=`which poky-qemu-ifdown` | 38 | QEMUIFDOWN=`which poky-qemu-ifdown` |
| 35 | KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0" | 39 | KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0" |
| 36 | QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN" | 40 | QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN" |
| 37 | KERNCMDLINE="mem=$QEMU_MEMORY" | 41 | KERNCMDLINE="mem=$QEMU_MEMORY" |
| 38 | 42 | ||
| 39 | if [ -z "$QEMU_MEMORY" ]; then | ||
| 40 | QEMU_MEMORY="64M" | ||
| 41 | fi | ||
| 42 | |||
| 43 | SERIALOPTS="" | 43 | SERIALOPTS="" |
| 44 | if [ "x$SERIAL_LOGFILE" != "x" ]; then | 44 | if [ "x$SERIAL_LOGFILE" != "x" ]; then |
| 45 | SERIALOPTS="-serial file:$SERIAL_LOGFILE" | 45 | SERIALOPTS="-serial file:$SERIAL_LOGFILE" |
| @@ -50,6 +50,7 @@ case "$MACHINE" in | |||
| 50 | "qemux86") ;; | 50 | "qemux86") ;; |
| 51 | "akita") ;; | 51 | "akita") ;; |
| 52 | "spitz") ;; | 52 | "spitz") ;; |
| 53 | "nokia800") ;; | ||
| 53 | *) | 54 | *) |
| 54 | echo "Error: Unsupported machine type $MACHINE" | 55 | echo "Error: Unsupported machine type $MACHINE" |
| 55 | return | 56 | return |
| @@ -130,13 +131,39 @@ if [ "$MACHINE" = "akita" ]; then | |||
| 130 | fi | 131 | fi |
| 131 | fi | 132 | fi |
| 132 | 133 | ||
| 134 | if [ "$MACHINE" = "nokia800" ]; then | ||
| 135 | QEMU=qemu-system-arm | ||
| 136 | if [ "$TYPE" = "jffs2" ]; then | ||
| 137 | HDIMAGE=`readlink -f $HDIMAGE` | ||
| 138 | if [ ! -e "$HDIMAGE.qemuflash" ]; then | ||
| 139 | #if [ ! -e "$HDIMAGE.initfs" ]; then | ||
| 140 | # echo "Error, $HDIMAGE.initfs must exist!" | ||
| 141 | # return | ||
| 142 | #fi | ||
| 143 | #if [ ! -e "$HDIMAGE.config" ]; then | ||
| 144 | # echo "Error, $HDIMAGE.config must exist!" | ||
| 145 | # return | ||
| 146 | #fi | ||
| 147 | #echo "'Flashing' config partition, please wait..." | ||
| 148 | #poky-nokia800-flashutil $HDIMAGE.config $HDIMAGE.qemuflash config | ||
| 149 | #echo "'Flashing' initfs, please wait..." | ||
| 150 | #poky-nokia800-flashutil $HDIMAGE.initfs $HDIMAGE.qemuflash initfs | ||
| 151 | echo "'Flashing' rootfs, please wait..." | ||
| 152 | poky-nokia800-flashutil $HDIMAGE $HDIMAGE.qemuflash | ||
| 153 | fi | ||
| 154 | KERNCMDLINE="root=/dev/mtdblock4 rootfstype=jffs2" | ||
| 155 | QEMUOPTIONS="$QEMU_NETWORK_CMD -M n800 -mtdblock $HDIMAGE.qemuflash -serial vc -m 130 -serial vc -serial vc -serial vc" | ||
| 156 | fi | ||
| 157 | fi | ||
| 158 | |||
| 159 | |||
| 133 | if [ "x$QEMUOPTIONS" = "x" ]; then | 160 | if [ "x$QEMUOPTIONS" = "x" ]; then |
| 134 | echo "Error: Unable to support this combination of options" | 161 | echo "Error: Unable to support this combination of options" |
| 135 | return | 162 | return |
| 136 | fi | 163 | fi |
| 137 | 164 | ||
| 138 | SDKDIR="/usr/local/poky/eabi-glibc" | 165 | SDKDIR="/usr/local/poky/eabi-glibc" |
| 139 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then | 166 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then |
| 140 | SDKPATH="$SDKDIR/arm/arm-poky-linux-gnueabi/bin:$SDKDIR/arm/bin" | 167 | SDKPATH="$SDKDIR/arm/arm-poky-linux-gnueabi/bin:$SDKDIR/arm/bin" |
| 141 | fi | 168 | fi |
| 142 | 169 | ||
diff --git a/scripts/runqemu b/scripts/runqemu index 4bbd3f6d8a..854d675d19 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -45,6 +45,9 @@ else | |||
| 45 | if [ "$MACHINE" = "akita" ]; then | 45 | if [ "$MACHINE" = "akita" ]; then |
| 46 | TYPE="jffs2" | 46 | TYPE="jffs2" |
| 47 | fi | 47 | fi |
| 48 | if [ "$MACHINE" = "nokia800" ]; then | ||
| 49 | TYPE="jffs2" | ||
| 50 | fi | ||
| 48 | if [ "$MACHINE" = "spitz" ]; then | 51 | if [ "$MACHINE" = "spitz" ]; then |
| 49 | TYPE="ext3" | 52 | TYPE="ext3" |
| 50 | fi | 53 | fi |
| @@ -58,7 +61,7 @@ if [ "x$4" != "x" ]; then | |||
| 58 | HDIMAGE=$4 | 61 | HDIMAGE=$4 |
| 59 | fi | 62 | fi |
| 60 | 63 | ||
| 61 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then | 64 | if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then |
| 62 | if [ "x$ZIMAGE" = "x" ]; then | 65 | if [ "x$ZIMAGE" = "x" ]; then |
| 63 | ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin | 66 | ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin |
| 64 | fi | 67 | fi |
| @@ -96,6 +99,15 @@ if [ "$MACHINE" = "akita" ]; then | |||
| 96 | fi | 99 | fi |
| 97 | fi | 100 | fi |
| 98 | 101 | ||
| 102 | if [ "$MACHINE" = "nokia800" ]; then | ||
| 103 | if [ "$TYPE" = "jffs2" ]; then | ||
| 104 | if [ "x$HDIMAGE" = "x" ]; then | ||
| 105 | HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-nokia800.jffs2 | ||
| 106 | fi | ||
| 107 | fi | ||
| 108 | fi | ||
| 109 | |||
| 110 | |||
| 99 | if [ "$MACHINE" = "qemux86" ]; then | 111 | if [ "$MACHINE" = "qemux86" ]; then |
| 100 | if [ "x$ZIMAGE" = "x" ]; then | 112 | if [ "x$ZIMAGE" = "x" ]; then |
| 101 | ZIMAGE=$BUILDDIR/tmp/deploy/images/bzImage-$MACHINE.bin | 113 | ZIMAGE=$BUILDDIR/tmp/deploy/images/bzImage-$MACHINE.bin |
