OpenWRT firmware partitions of predefined size

Hey all,

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?

Thanks so much for any advice.

1 Like

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:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e16a0e7e8876df0a92ec4779fe766de1a943307a

On some devices, a bootm command is directly passed onto a flash memory region - I just don't have an example at hand.

Thanks for your response! I do a NOR chip so I suppose I'll just choose a safe value. I had it in my head it had to be exact.