summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-09-11 06:03:02 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2011-09-11 06:03:02 +0200
commitab9b26ac83655f30c7297babf04efa56d3266563 (patch)
tree7d825331b466b869e1cc8d5291805ade2925f61c /scripts
parente7b6b54de4a0fd70ca950f7f08eea4e2dfad9972 (diff)
parentd6ce7a9b7c34b166d5e7e69aa840f628add622b4 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-image.sh10
-rwxr-xr-xscripts/update-sys2
2 files changed, 7 insertions, 5 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"
diff --git a/scripts/update-sys b/scripts/update-sys
index 268184428..bcfbfa84e 100755
--- a/scripts/update-sys
+++ b/scripts/update-sys
@@ -50,7 +50,7 @@ config $archsym
EOF
if [ "${system}" = "toolchain" -o "${system}" = "qemu" ];then
- sys=${system}-$arch
+ sys=${system}-$cpuarch
else
sys=$system
fi