[U-Boot] Integity validation (checksum) of a squashfs root file system

Marek Vasut marek.vasut at gmail.com
Mon Feb 6 19:41:20 CET 2012


> Hi M,
> 
> sha1sum does provide a console output but nothing that could be used for an
> automated check like crc32 -v...

Make it export an env. variable?

M

> 
> Pascal
> 
> -----Original Message-----
> From: Marek Vasut
> Sent: Monday, February 06, 2012 11:34 AM
> To: u-boot at lists.denx.de
> Cc: Pascal Levesque
> Subject: Re: [U-Boot] Integity validation (checksum) of a squashfs root
> file system
> 
> > Hi,
> > 
> > I would like to validate the integrity (checksum) of a squashfs root file
> > system before starting Linux.
> > 
> > Current strategy I am using is:
> > - Wrap squashfs rootfs inside a u-boot image
> > - TFTP download on the target
> > - Download validation using iminfo
> > - Save squashfs rootfs in flash without the image header (Linux failed to
> > load squashfs rootfs if u-boot image is present)
> > 
> > Problems:
> > - I need to hardcode squashfs rootfs offset in u-boot image in order to
> > be able to flash it - U-Boot image header information (size, crc, ...)
> > is lost after a reboot. It is not possible to check the integrity of the
> > flash content.
> > 
> > I would like to save some fields of u-boot image header (size, crc, ...)
> > in u-boot environment variables. And then do an integrity check at boot
> > time.
> > 
> > I have not find a way to extract those fields and save them without
> > changing u-boot code. I have added some code to “iminfo” command to set
> > environment variables for CRC, size, payload offset, timestamp.
> > 
> > Is it an acceptable way of doing it?
> > Is there a better way of doing it?
> > 
> > Thanks in advance,
> > 
> > Pascal
> 
> Use sha1sum integrated into uboot and stick it at the end?
> 
> M


More information about the U-Boot mailing list