diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2011-09-02 19:48:59 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2011-09-02 19:48:59 +0200 |
commit | 52577cbeee1714c28e3bbd887e0d90d3590c858c (patch) | |
tree | a74a528768f7ad1d05f1dfa16c05ea29df34f8be | |
parent | 06ce168a42a0834f2ab1b17a493c6e339906404a (diff) |
fix image creation
-rwxr-xr-x | scripts/create-image.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/create-image.sh b/scripts/create-image.sh index f3e03eced..2b5b34bc9 100755 --- a/scripts/create-image.sh +++ b/scripts/create-image.sh @@ -79,11 +79,13 @@ printf "Creating filesystem $filesystem\n" printf "Create partition and filesystem\n" $parted -s $1 mklabel msdos -$parted -s $1 mkpart primary ext2 0 98% +$parted -s $1 -- mkpart primary ext2 0 -0 $parted -s $1 set 1 boot on -dd if=$1 of=mbr bs=16384 count=1 2>/dev/null -dd if=$1 skip=16384 of=$1.new 2>/dev/null +offset=$(parted $1 unit b print | tail -2 | head -1 | cut -f 1 --delimit="B" | cut -c 9-) + +dd if=$1 of=mbr bs=$offset count=1 2>/dev/null +dd if=$1 skip=$offset of=$1.new 2>/dev/null if [ "$filesystem" = "ext2" -o "$filesystem" = "ext3" -o "$filesystem" = "ext4" ];then mkfsopts=-F @@ -105,7 +107,7 @@ rm mbr tmp=$(mktemp -d) -mount -o loop,offset=16384 -t $filesystem $1 $tmp +mount -o loop,offset=$offset -t $filesystem $1 $tmp if [ -z $initramfs ];then printf "Extracting install archive\n" |