From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessio Sangalli Date: Mon, 18 Jul 2011 12:52:30 -0700 Subject: [U-Boot] Environment "image" tool In-Reply-To: References: <4E221C41.1080900@manoweb.com> <4E2471C7.4050401@manoweb.com> Message-ID: <4E248EFE.1070804@manoweb.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 | 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