diff options
author | Simo Leone <simo@archlinux.org> | 2008-03-30 03:31:46 -0500 |
---|---|---|
committer | Simo Leone <simo@archlinux.org> | 2008-03-30 04:00:32 -0500 |
commit | c2657570456d6c8db4830cc3c7a5e4888942d691 (patch) | |
tree | 2c7b4453b7d4185c416db67b3a763ad0ddf97f9a | |
parent | 378bf136e288da83fea97dd7891c714e0345b891 (diff) | |
download | archiso32-c2657570456d6c8db4830cc3c7a5e4888942d691.tar.xz |
Changed mkusbimg size to 25% over rootsize
This is plenty to compensate for filesystem
overhead. Cutting the size too close to
the minimum makes the image unbootable.
No idea why.
Signed-off-by: Simo Leone <simo@archlinux.org>
-rwxr-xr-x | mkusbimg | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -56,13 +56,16 @@ LOOPDEV=$(next_avail_loop) TMPDIR=$(mktemp -d) # TODO: there are better ways to do this -# than adding 5MB to the rootsize +# than adding 25% to the rootsize +# XXX: doesn't seem to boot if we cut it too +# close. even if everything fits... # IMGSZ >= filesystem overhead + rootsize + 512bytes # must hold or there will be insufficient space -IMGSZ=$(( $(du -ms ${IMGROOT}|cut -f1) + 5 )) +rootsize=$(du -bs ${IMGROOT}|cut -f1) +IMGSZ=$(( (${rootsize}*5)/4 + 512 )) # create the image file -dd if=/dev/zero of="$IMG" bs=1M count="$IMGSZ" +dd if=/dev/zero of="$IMG" bs="$IMGSZ" count=1 # loop mount the disk image losetup "$LOOPDEV" "$IMG" |