From c2657570456d6c8db4830cc3c7a5e4888942d691 Mon Sep 17 00:00:00 2001 From: Simo Leone Date: Sun, 30 Mar 2008 03:31:46 -0500 Subject: 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 --- mkusbimg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mkusbimg b/mkusbimg index 6a41f4c..5e655b2 100755 --- a/mkusbimg +++ b/mkusbimg @@ -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" -- cgit v1.2.2