
18 Jul
2011
18 Jul
'11
9:52 p.m.
On 07/18/2011 10:59 AM, Mike Frysinger wrote:
although thinking about it a bit more, you probably could do it in shell. (cat <env file> | tr '\n' '\0' ; dd if=/dev/zero count=1 ibs=1) > env.bin env_size=8192 pad_size=$(( env_size - $(set -- $(du -b env.bin); echo $1) - 4)) dd if=/dev/zero ibs=$pad_size count=1 | tr '\0' '\377' >> env.bin
and then you get the crc and prepend the 4 bytes crc env.bin
Hi! I am not sure here how you would calculate the crc in the shell script. Are you suggesting there is a command "crc(1)"?
extending tools/envcrc to take a --file option and use that rather than the linked in default would be cool imo.
I will have a look at that prgram.
bye!!! as