summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-04-10 09:50:54 +0000
committerRichard Purdie <richard@openedhand.com>2008-04-10 09:50:54 +0000
commitfaf55131c9b86a8646dd80ca79b44a001b88a87f (patch)
treed8127bd7dd5339145a21c1aa8c6b850f681f05b8 /scripts
parent5091c0bd8842b2a5f94e47c391dc6fe73eac8901 (diff)
downloadpoky-faf55131c9b86a8646dd80ca79b44a001b88a87f.tar.gz
scripts: Add support for nokia800 to runqemu
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4226 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/poky-nokia800-flashutil53
-rwxr-xr-xscripts/poky-qemu-internal37
-rwxr-xr-xscripts/runqemu14
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
8if [ ! -r "$1" ]; then
9 echo "Usage: $0 <image> <destimage> [<partition>]"
10 exit -1
11fi
12
13if [ ! -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
28fi
29
30if [ "$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
48else
49 partition=/dev/mtd4
50 page=2304
51fi
52
53dd 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
33if [ -z "$QEMU_MEMORY" ]; then
34 QEMU_MEMORY="64M"
35fi
36
33QEMUIFUP=`which poky-qemu-ifup` 37QEMUIFUP=`which poky-qemu-ifup`
34QEMUIFDOWN=`which poky-qemu-ifdown` 38QEMUIFDOWN=`which poky-qemu-ifdown`
35KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0" 39KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0"
36QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN" 40QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN"
37KERNCMDLINE="mem=$QEMU_MEMORY" 41KERNCMDLINE="mem=$QEMU_MEMORY"
38 42
39if [ -z "$QEMU_MEMORY" ]; then
40 QEMU_MEMORY="64M"
41fi
42
43SERIALOPTS="" 43SERIALOPTS=""
44if [ "x$SERIAL_LOGFILE" != "x" ]; then 44if [ "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
131fi 132fi
132 133
134if [ "$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
157fi
158
159
133if [ "x$QEMUOPTIONS" = "x" ]; then 160if [ "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
136fi 163fi
137 164
138SDKDIR="/usr/local/poky/eabi-glibc" 165SDKDIR="/usr/local/poky/eabi-glibc"
139if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then 166if [ "$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"
141fi 168fi
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
59fi 62fi
60 63
61if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then 64if [ "$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
97fi 100fi
98 101
102if [ "$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
108fi
109
110
99if [ "$MACHINE" = "qemux86" ]; then 111if [ "$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