diff options
Diffstat (limited to 'scripts')
| -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 @@ +#! /bin/sh +# Copyright (C) 2008 OpenedHand Ltd. +# Contact: andrew@openedhand.com +# +# Erase the partition given in $3 (default: rootfs) and flash the contents +# of image given in $1 into the image $2. + +if [ ! -r "$1" ]; then +	echo "Usage: $0 <image> <destimage> [<partition>]" +	exit -1 +fi + +if [ ! -e "$2" ]; then +        echo "foo" +	# Making an empty/erased flash image.  Need a correct echo behavior. +	dd if=/dev/zero of=$2 bs=268435456 count=0 seek=1 +	bash -c 'echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b' +	cat .8b .8b > .16b # OOB is 16 bytes +	cat .16b .16b .16b .16b .16b .16b .16b .16b > .8sec +	cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec +	cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec +	cat .512sec .512sec .512sec .512sec > .2ksec +	cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16k +	cat .16k .16k .16k .16k .16k .16k .16k .16k > .128k +	# N800 NAND is 512k sectors big +	cat  .128k .128k .128k .128k >> $2 +	rm -rf .8b .16b .8sec .64sec .512sec .2ksec .16k, .128k +fi + +if [ "$3" != "" ]; then +	case "$3" in +	config) +		partition=/dev/mtd1 +		page=64 +		;; +	initfs) +		partition=/dev/mtd3 +		page=1280 +		;; +	rootfs) +		partition=/dev/mtd4 +		page=2304 +		;; +	*) +		echo "Unknown partition $2" +		exit -1 +	esac +else +	partition=/dev/mtd4 +	page=2304 +fi + +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 @@  #   HDIMAGE - the disk image file to use  # +if [ -z "$QEMU_MEMORY" ]; then +    QEMU_MEMORY="64M" +fi +  QEMUIFUP=`which poky-qemu-ifup`  QEMUIFDOWN=`which poky-qemu-ifdown`  KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0"  QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN"  KERNCMDLINE="mem=$QEMU_MEMORY" -if [ -z "$QEMU_MEMORY" ]; then -    QEMU_MEMORY="64M" -fi -  SERIALOPTS=""  if [ "x$SERIAL_LOGFILE" != "x" ]; then      SERIALOPTS="-serial file:$SERIAL_LOGFILE" @@ -50,6 +50,7 @@ case "$MACHINE" in  	"qemux86") ;;  	"akita") ;;  	"spitz") ;; +	"nokia800") ;;  	*)  		echo "Error: Unsupported machine type $MACHINE"  		return @@ -130,13 +131,39 @@ if [ "$MACHINE" = "akita" ]; then      fi  fi +if [ "$MACHINE" = "nokia800" ]; then +    QEMU=qemu-system-arm +    if [ "$TYPE" = "jffs2" ]; then +        HDIMAGE=`readlink -f $HDIMAGE` +        if [ ! -e "$HDIMAGE.qemuflash" ]; then +            #if [ ! -e "$HDIMAGE.initfs" ]; then +            #    echo "Error, $HDIMAGE.initfs must exist!" +            #    return +            #fi +            #if [ ! -e "$HDIMAGE.config" ]; then +            #    echo "Error, $HDIMAGE.config must exist!" +            #    return +            #fi +            #echo "'Flashing' config partition, please wait..." +            #poky-nokia800-flashutil $HDIMAGE.config $HDIMAGE.qemuflash config +            #echo "'Flashing' initfs, please wait..." +            #poky-nokia800-flashutil $HDIMAGE.initfs $HDIMAGE.qemuflash initfs +            echo "'Flashing' rootfs, please wait..." +            poky-nokia800-flashutil $HDIMAGE $HDIMAGE.qemuflash  +        fi +	KERNCMDLINE="root=/dev/mtdblock4 rootfstype=jffs2" +        QEMUOPTIONS="$QEMU_NETWORK_CMD -M n800 -mtdblock $HDIMAGE.qemuflash -serial vc -m 130 -serial vc -serial vc -serial vc" +    fi +fi + +  if [ "x$QEMUOPTIONS" = "x" ]; then      echo "Error: Unable to support this combination of options"      return  fi  SDKDIR="/usr/local/poky/eabi-glibc" -if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then +if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then      SDKPATH="$SDKDIR/arm/arm-poky-linux-gnueabi/bin:$SDKDIR/arm/bin"  fi diff --git a/scripts/runqemu b/scripts/runqemu index 4bbd3f6d8a..854d675d19 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -45,6 +45,9 @@ else      if [ "$MACHINE" = "akita" ]; then          TYPE="jffs2"      fi +    if [ "$MACHINE" = "nokia800" ]; then +        TYPE="jffs2" +    fi      if [ "$MACHINE" = "spitz" ]; then          TYPE="ext3"      fi @@ -58,7 +61,7 @@ if [ "x$4" != "x" ]; then      HDIMAGE=$4  fi -if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then +if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then      if [ "x$ZIMAGE" = "x" ]; then          ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin      fi @@ -96,6 +99,15 @@ if [ "$MACHINE" = "akita" ]; then      fi  fi +if [ "$MACHINE" = "nokia800" ]; then +    if [ "$TYPE" = "jffs2" ]; then +        if [ "x$HDIMAGE" = "x" ]; then +           HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-nokia800.jffs2 +        fi +    fi +fi + +  if [ "$MACHINE" = "qemux86" ]; then      if [ "x$ZIMAGE" = "x" ]; then          ZIMAGE=$BUILDDIR/tmp/deploy/images/bzImage-$MACHINE.bin | 
