grml2iso: use shell for calculation instead of using bc
authorMichael Prokop <mika@grml.org>
Wed, 8 Feb 2012 22:14:38 +0000 (23:14 +0100)
committerMichael Prokop <mika@grml.org>
Wed, 8 Feb 2012 22:14:39 +0000 (23:14 +0100)
We are lacking a dependency on bc but there shouldn't be any
reason why we'd have to use bc to calculate the cylinder foo,
so let's just use the internal shell mechanism.

grml2iso

index 3e48b35..dc23036 100755 (executable)
--- a/grml2iso
+++ b/grml2iso
@@ -248,8 +248,8 @@ Options:
 
 # pad the output ISO to multiples of 256 KiB for partition table support {{{
   siz=$($getfilesize "$ISOFILE")
 
 # pad the output ISO to multiples of 256 KiB for partition table support {{{
   siz=$($getfilesize "$ISOFILE")
-  cyls=$(echo "$siz / 512 / 32 / 16 + 1" | bc)  # C=$cyls H=16 S=32
-  ofs=$(echo "$cyls * 16 * 32 * 512 - 1" | bc)  # padding offset (size - 1)
+  cyls=$(($siz / 512 / 32 / 16 + 1))  # C=$cyls H=16 S=32
+  ofs=$(($cyls * 16 * 32 * 512 - 1))  # padding offset (size - 1)
   dd if=/dev/zero bs=1 count=1 seek=$ofs of="$ISOFILE" 2>/dev/null
 # }}}
 
   dd if=/dev/zero bs=1 count=1 seek=$ofs of="$ISOFILE" 2>/dev/null
 # }}}