Basically, I have a device that is going to require replacing its stock U-Boot which is fully locked down. I have to install by flashing directly to the chip. I'm not expecting this device to be merged into the main branch, it's mostly just a learning project.
The problem I'm having is when I'm setting my U-Boot sf read commands. I never know exactly what the size of the kernel partition is going to be. I've been lead to believe there are many devices where U-Boot is set to read from a specific address to another and it expects there to be a kernel in there. Is this done by telling OpenWrt's build tools to always make the kernel partition a specific size? if so, how do I define that?
Modern OpenWrt uses a dynamic kernel-rootfs split, so there is no fixed-size kernel partition.
Do you boot from a NAND chip or a NOR chip? If it's NAND, modern U-Boot versions support UBI, the kernel is then directly loaded from a UBI partition. Example:
If it's NOR, then often a fixed size is read. I think that the amount is set to a size where the kernel is more or less guaranteed to fit. I had a short look at one of the devices I own (WS-AP3915i), there it's 0xc00000 while the partition itself is much bigger. Example: