Cant seem to change the firmware image size

squashfs image is as big as the files inside, and on first boot it will generate the read-write partition. Also afaik it is compressed with gzip so all empty space does not matter.
If you want to see the real size you need to ungzip the image and flash it to the device, then let it boot the first time to create the read-write partition.

For ext4 partition, it's again compressed with gzip so you need to ungzip to see the real size.

In the same make menuconfig page where you can set kernel and rootfs partsize there is an option to turn off gzip compression of the images.

OpenWrt needs to do some operations that require read-write storage on first boot like generating ssh keys, or running first-boot scripts that generate default configuration. So if you make images to load in a read-only system you should already include all your default configs and the ssh keys for the device. see Building the firmware for Raspberry Pi 4 with Wi-Fi enabled before first boot - #5 by bobafetthotmail

Since you want to make a true read-only system, you may also want to look at this thread too to remount the whole overlay in RAM Disable /etc config save

1 Like