summaryrefslogtreecommitdiff
path: root/scripts/poky-addptable2image
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-01-30 12:23:57 +0000
committerRichard Purdie <richard@openedhand.com>2007-01-30 12:23:57 +0000
commit3cce9ba903a35dce67c08a8344acd52a3eae3e41 (patch)
treee9f97d39fa62fe55ccb267381507dbd0fd8ece47 /scripts/poky-addptable2image
parent9604533009f19b8deadb827da9bd957cf75d67ab (diff)
downloadopenembedded-core-3cce9ba903a35dce67c08a8344acd52a3eae3e41.tar.gz
openembedded-core-3cce9ba903a35dce67c08a8344acd52a3eae3e41.tar.bz2
openembedded-core-3cce9ba903a35dce67c08a8344acd52a3eae3e41.zip
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
Diffstat (limited to 'scripts/poky-addptable2image')
-rwxr-xr-xscripts/poky-addptable2image32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/poky-addptable2image b/scripts/poky-addptable2image
new file mode 100755
index 0000000000..8602e5f085
--- /dev/null
+++ b/scripts/poky-addptable2image
@@ -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 \ No newline at end of file