Just like philo I attempted to use the experimental /usr/bin/flash-knoppix2 to create a USB flash storage medium with a big reiserfs rw overlay partition. I also got the error dialog with:
Overlay size is too small!\n(minimum 400MB required)
When I ran the script in a terminal window, I noticed a shell error message complaining about numeric format in the line
Code:
let avail=total-ksize
After changing the format of the calculated media size in MiB from floating point to integer, I could successfully finish the "remastering" of the Knoppix 7.0.5 EN DVD onto my flash medium using only the script, with a 7 GiB writable overlay filesystem. The flash medium only contained an empty (DOS FDISK-style) partition table before I used the script.
/usr/bin/flash-knoppix2.patch:
Code:
--- /usr/bin/flash-knoppix2     2012-12-21 00:27:14.000000000 +0000
+++ flash-knoppix2      2012-12-28 09:01:10.000000000 +0000
@@ -364,7 +364,7 @@
   ERROR="${FLASH}:\n$MSG_ERROR_INCOMPATIBLE"; bailout 2
  fi
 elif [ "p" = "$METHOD" ]; then
- total="$(awk '{print ($1 / 2048)}' /sys/block/"${FLASH##*/}"/size 2>/dev/null)"
+ total="$(awk '{printf( "%d", ($1 / 2048) ) }' /sys/block/"${FLASH##*/}"/size 2>/dev/null)"
  ksize="$(du -sm --exclude='knoppix-data.*' . 2>/dev/null | awk '{size=$1}END{print size}')"
  let avail=total-ksize
  let avail-=200
Please note the change from "print ..." to "printf( "%d, ... )"