From 3cce9ba903a35dce67c08a8344acd52a3eae3e41 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 30 Jan 2007 12:23:57 +0000 Subject: 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 --- scripts/poky-addptable2image | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 scripts/poky-addptable2image (limited to 'scripts/poky-addptable2image') diff --git a/scripts/poky-addptable2image b/scripts/poky-addptable2image new file mode 100755 index 000000000..8602e5f08 --- /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 -- cgit v1.2.3