[U-Boot] ext2fs.c/ext2fs_mount() fails when inode_size = 256

Bob Furber bob at steroidmicros.com
Wed Aug 12 18:18:00 CEST 2009


Our SBC have been happily booting uClinux from ext3 partitioned SD cards 
prepared on a Fedora Linux-2.6.15 PC.

But, when we prepared our 2GB SD cards on a brand new Ubuntu 
Linux-2.6.27 PC, out SBCs were no longer able to find /boot/linux.bin.

Linux/dumpe2fs showed that the bootable [Fedora] 2GB SD cards had 
inode_size = 128, whereas the delinquent [Ubuntu] SD cards had 
inode_size = 256. Adding a "-I 128" switch to mkfs.ext3 in the script 
that prepares an loads the SD cards solved the problem. That is, our 
SBCs can now boot from Ubuntu prepared SD cards. However, this brings up 
the point that, somewhere along the line, the default inode_size for SD 
cards is no longer 128 bytes. It could be double, quadruple or more.

There is some suspicious code in ext2fs.c/ext2fs_mount():

    inodes_per_block = EXT2_BLOCK_SIZE (data) / 128;

However, when this was replaced by

    inodes_per_block = EXT2_BLOCK_SIZE (data) / INODE_SIZE(data);

..the 2GB/128 byte inode SD cards booted and the 2GB/256 byte inode SD 
cards didn't.

When reading a 2GB/256 byte inode card, 
ext2fs_mount()/ext2fs_read_inode(data, 2, data->inode) returns 
data->inode filled with zeros. Either there is a flaw in data or data is 
not being interpreted correctly. Regrettably, the root problem eludes me.

Any thoughts or comments would be appreciated.

Bob Furber




More information about the U-Boot mailing list