"My kernel is too small to boot"
Any idea why a smaller kernel should "corrupt" the UBIFS?
KERNEL_SIZE := 3145728 # 0x5800000 - 0x5500000
IMAGE_SIZE := 89128960 # 0x5800000
BLOCKSIZE := 128k
PAGESIZE := 2048
IMAGES := sysupgrade.bin factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | linksys-image type=EA8300
(linksys-image
adds a "signature" at the end of the image -- see scripts/linksys-image.sh
)
(All images flashed through OEM U-Boot)
Started cleaning up my kernel config on an IPQ4019-based Linksys EA3800 by removing "development" kernel features such as various traces. All of a sudden, I'm seeing boot failures and, in the logs, just before failure to mount root
[ 1.917737] ubi0: attaching mtd11
[ 1.960673] ubi0 warning: ubi_attach: valid VID header but corrupted EC header at PEB 39
[ 2.322537] ubi0: scanning is finished
[ 2.329871] ubi0 error: ubi_read_volume_table: bad attaching information, error 1
or similar.
OK, working from the other partition
root@OpenWrt:/# nandtest /dev/mtd11
ECC corrections: 0
ECC failures : 0
Bad blocks : 0
BBT blocks : 0
054e0000: checking...of 4)...
Finished pass 1 successfully
hopefully rules out premature NAND failure.
I start replacing the removed packages, and it isn't until I re-enable ftrace that is starts to boot again. Mess around there with a few combinations and it seems to be the issue. To confirm that ftrace is the key, I move to a very minimal config and it fails to boot. Add in ftrace and, guess what, it fails to boot.
So I start going for kernel bloat. Every language, all kinds of USB drivers I don't have, you name it. Throw it all in. Took a while, and noticed that
The PEB identified starts at 23 and starts going up to 40 (or perhaps more).
Eventually I hit the point where it boots again. I'm poking at it slowly now, trying to find the tipping point in case that size is meaningful.
Any clues as to how to chase this down and resolve it?