]>
git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/blob - scripts/runqemu-addptable2image
3 # Add a partition table to an ext2 image file
5 # Copyright (C) 2006-2007 OpenedHand Ltd.
7 # SPDX-License-Identifier: GPL-2.0-or-later
16 size
=`ls -l $IMAGE | awk '{ print $5}'`
17 size2
=`expr $size / 512 / 16 / 63`
22 # MBR Size = 512 * 63 bytes
23 dd if=/dev
/zero of
=$IMAGEOUT count
=63
25 echo "x" > /tmp
/fdisk.cmds
26 echo "c" >> /tmp
/fdisk.cmds
27 echo "1024" >> /tmp
/fdisk.cmds
28 echo "h" >> /tmp
/fdisk.cmds
29 echo "16" >> /tmp
/fdisk.cmds
30 echo "r" >> /tmp
/fdisk.cmds
31 echo "n" >> /tmp
/fdisk.cmds
32 echo "p" >> /tmp
/fdisk.cmds
33 echo "1" >> /tmp
/fdisk.cmds
34 echo "1" >> /tmp
/fdisk.cmds
35 echo "$size2" >> /tmp
/fdisk.cmds
36 echo "w" >> /tmp
/fdisk.cmds
38 /sbin
/fdisk
$IMAGEOUT < /tmp
/fdisk.cmds
39 cat $IMAGE >> $IMAGEOUT