From: Phillip L. <ph...@lo...> - 2009-03-01 03:02:13
|
Salim S I wrote: > Hello, > My embedded system architecture is as follows > > mtdblock1 - kernel > mtdblock - root filesystem (squashfs) > > My bootloader us U-boot. > > Things are fine when I upgrade the flash from u-boot. I can write and > overwrite squashfs images on to the flash for upgrade. > > #mount > /dev/mtdblock2 on / type squashfs (rw) > /proc on /proc type proc (rw,nodiratime) > devpts on /dev/pts type devpts (rw) > none on /tmp type ramfs (rw) > > After booting I try to overwrite /dev/mtdblock2 from linux using dd command > (for firmware upgrade) > > dd if=testsquashfs of=/dev/mtdblock2 > > after reboot,the squashfs fails to mount. > > SQUASHFS error: Unable to read inode [2e53a1:793] > > If I use the same image to overwrite (i.e same image that was originally in > the flash), things are fine. > > > I do not use initrd or initramfs. > > I understand this has got to do with the inode info getting changed. Could > someone point out how this upgrade could be done from linux? > This isn't really an issue with Squashfs. The reason why you're getting a Squashfs error is because the Squashfs filesystem hasn't been correctly written to the mtd flash device. Although dd to a mtd device in theory should work, in most cases it will not, due to the fact that dd will not perform a flash erase. You should be using the specialised flash utilities available from the mtd utilities package. This contains utilities to erase and write the flash. You also should be using the mtd character device (usually /dev/mtdX) rather than the block device /dev/mtdblockX. In general only use the block device when mounting the filesystem. For example, the following should correctly write a filesystem to NAND flash. flash_eraseall /dev/mtd2 nandwrite /dev/mtd2 testsquashfs Phillip |