#!/bin/sh BLOCKSIZE=512 echo "HTC\$WALLABY33" >sdheader.000 dd if=sdheader.000 of=sdheader.001 bs=1 count=13 dd if=/dev/zero of=sdheader.002 bs=512 count=1 cat sdheader.001 sdheader.002 >sdheader.003 dd if=sdheader.003 of=sdheader.bin bs=512 count=1 rm -f sdheader.000 sdheader.001 sdheader.002 sdheader.003 SIZE=`cat wallabypatch.bin | wc -c` BLOCKCOUNT=$(( ( ( $SIZE + $BLOCKSIZE - 1 ) / $BLOCKSIZE ) + 1 )) dd if=/dev/zero of=sdbody.000 bs=512 count=1 cat sdbody.000 wallabypatch.bin sdbody.000 > sdbody.001 dd if=sdbody.001 of=wallabypatch-sd.nb2 bs=512 count=$BLOCKCOUNT cat sdheader.bin wallabypatch-sd.nb2 >wallabypatch-sd.img rm -f sdbody.000 sdbody.001 sdheader.bin echo "----------------------------------------------------" echo " An SD blocksize aligned image has been created. " echo " The Wallaby header occupies block 0. Additional " echo " data can be stored in block 1 (currently not used) " echo " Block 2 and up contain the execution code that " echo " will be loaded by the Wallaby Bootloader. " echo "----------------------------------------------------" echo " FILES: wallabypatch-sd.img " echo " wallabypatch-sd.nb2 " echo "----------------------------------------------------"