scripts: Add support to scripts for spitz images
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1216 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
parent
9604533009
commit
3cce9ba903
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
IMAGE=$1
|
||||||
|
IMAGEOUT=$2
|
||||||
|
|
||||||
|
echo $IMAGE
|
||||||
|
echo $IMAGEOUT
|
||||||
|
|
||||||
|
size=`ls -l $IMAGE | awk '{ print $5}'`
|
||||||
|
size2=`expr $size / 512 / 16 / 63`
|
||||||
|
|
||||||
|
echo $size
|
||||||
|
echo $size2
|
||||||
|
|
||||||
|
# MBR Size = 512 * 63 bytes
|
||||||
|
dd if=/dev/zero of=$IMAGEOUT count=63
|
||||||
|
|
||||||
|
echo "x" > /tmp/fdisk.cmds
|
||||||
|
echo "c" >> /tmp/fdisk.cmds
|
||||||
|
echo "1024" >> /tmp/fdisk.cmds
|
||||||
|
echo "h" >> /tmp/fdisk.cmds
|
||||||
|
echo "16" >> /tmp/fdisk.cmds
|
||||||
|
echo "r" >> /tmp/fdisk.cmds
|
||||||
|
echo "n" >> /tmp/fdisk.cmds
|
||||||
|
echo "p" >> /tmp/fdisk.cmds
|
||||||
|
echo "1" >> /tmp/fdisk.cmds
|
||||||
|
echo "1" >> /tmp/fdisk.cmds
|
||||||
|
echo "$size2" >> /tmp/fdisk.cmds
|
||||||
|
echo "w" >> /tmp/fdisk.cmds
|
||||||
|
|
||||||
|
fdisk $IMAGEOUT < /tmp/fdisk.cmds
|
||||||
|
cat $IMAGE >> $IMAGEOUT
|
|
@ -40,6 +40,9 @@ else
|
||||||
if [ "$MACHINE" = "akita" ]; then
|
if [ "$MACHINE" = "akita" ]; then
|
||||||
TYPE="jffs2"
|
TYPE="jffs2"
|
||||||
fi
|
fi
|
||||||
|
if [ "$MACHINE" = "spitz" ]; then
|
||||||
|
TYPE="ext3"
|
||||||
|
fi
|
||||||
HDIMAGE=$2
|
HDIMAGE=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ if [ ! -f "$ZIMAGE" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MACHINE" != "qemuarm" -a "$MACHINE" != "qemux86" -a "$MACHINE" != "akita" ]; then
|
if [ "$MACHINE" != "qemuarm" -a "$MACHINE" != "qemux86" -a "$MACHINE" != "akita" -a "$MACHINE" != "spitz" ]; then
|
||||||
echo "Error, unsupported machine type $MACHINE"
|
echo "Error, unsupported machine type $MACHINE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -91,23 +91,22 @@ fi
|
||||||
|
|
||||||
if [ "$MACHINE" = "spitz" ]; then
|
if [ "$MACHINE" = "spitz" ]; then
|
||||||
QEMU=`which qemu-system-arm`
|
QEMU=`which qemu-system-arm`
|
||||||
# QEMU=/usr/local/bin/qemu-system-arm
|
if [ "$TYPE" = "ext3" ]; then
|
||||||
# if [ "$TYPE" = "ext2" ]; then
|
echo $HDIMAGE
|
||||||
# if [ "x$HDIMAGE" = "x" ]; then
|
HDIMAGE=`readlink -f $HDIMAGE`
|
||||||
# HDIMAGE=`readlink -f $BUILDDIR/tmp/deploy/images/oh-image-sdk-spitz.ext2`
|
echo $HDIMAGE
|
||||||
# if [ ! -e $HDIMAGE.mbr ]; then
|
if [ ! -e "$HDIMAGE.qemudisk" ]; then
|
||||||
# cp $OEROOT/mbr.bin $HDIMAGE.mbr
|
echo "Adding a partition table to the ext3 image for use by QEMU, please wait..."
|
||||||
# cat $HDIMAGE >> $HDIMAGE.mbr
|
poky-addptable2image $HDIMAGE $HDIMAGE.qemudisk
|
||||||
# fi
|
fi
|
||||||
# HDIMAGE=$BUILDDIR/tmp/deploy/images/hdaimage.bin
|
QEMUOPTIONS="$QEMU_NETWORK_CMD -M spitz -hda $HDIMAGE.qemudisk -vertical"
|
||||||
# fi
|
fi
|
||||||
# QEMUOPTIONS="-append \"root=/dev/sda mem=$QEMU_MEMORY\" $QEMU_NETWORK_CMD -M spitz -hda $HDIMAGE"
|
|
||||||
# fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$MACHINE" = "akita" ]; then
|
if [ "$MACHINE" = "akita" ]; then
|
||||||
QEMU=`which qemu-system-arm`
|
QEMU=`which qemu-system-arm`
|
||||||
if [ "$TYPE" = "jffs2" ]; then
|
if [ "$TYPE" = "jffs2" ]; then
|
||||||
|
HDIMAGE=`readlink -f $HDIMAGE`
|
||||||
if [ ! -e "$HDIMAGE.qemuflash" ]; then
|
if [ ! -e "$HDIMAGE.qemuflash" ]; then
|
||||||
echo "Converting raw image into flash image format for use by QEMU, please wait..."
|
echo "Converting raw image into flash image format for use by QEMU, please wait..."
|
||||||
raw2flash.akita < $HDIMAGE > $HDIMAGE.qemuflash
|
raw2flash.akita < $HDIMAGE > $HDIMAGE.qemuflash
|
||||||
|
|
|
@ -43,6 +43,9 @@ else
|
||||||
if [ "$MACHINE" = "akita" ]; then
|
if [ "$MACHINE" = "akita" ]; then
|
||||||
TYPE="jffs2"
|
TYPE="jffs2"
|
||||||
fi
|
fi
|
||||||
|
if [ "$MACHINE" = "spitz" ]; then
|
||||||
|
TYPE="ext3"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "x$3" != "x" ]; then
|
if [ "x$3" != "x" ]; then
|
||||||
|
@ -68,6 +71,14 @@ if [ "$MACHINE" = "qemuarm" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$MACHINE" = "spitz" ]; then
|
||||||
|
if [ "$TYPE" = "ext3" ]; then
|
||||||
|
if [ "x$HDIMAGE" = "x" ]; then
|
||||||
|
HDIMAGE=$BUILDDIR/tmp/deploy/images/oh-image-pda-spitz.ext3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$MACHINE" = "akita" ]; then
|
if [ "$MACHINE" = "akita" ]; then
|
||||||
if [ "$TYPE" = "jffs2" ]; then
|
if [ "$TYPE" = "jffs2" ]; then
|
||||||
if [ "x$HDIMAGE" = "x" ]; then
|
if [ "x$HDIMAGE" = "x" ]; then
|
||||||
|
|
Loading…
Reference in New Issue