How to change uboot settings when building image?


I usually build my own images and I also know how to manually change uboot settings after I've flashed my image on a router. Yet, I would like to change my building environment so that my uboot changes be included into my image (for info, I plan to add CONFIG_AUTOBOOT_KEYED to uboot).

Could anybody tell me how should I proceed? Which file/directory to work on? I couldn't find info on this.

My device are ubiquiti routers (rocket and nanostation).
Thank you!

My guess would be to put a script that runs as part of the post install of a sysupgrade image...

modifying bootloader config settings from outside the bootloader has potential to corrupt something and brick the device ..

Just curious, why go through the trouble? After youve configured your setting(s) it’ll stay there forever...

I actually came to the very same idea (post install script launched as it is in /etc/uci-defaults ), but as a temporary solution. Actually, the fw_setenv command cannot change all uboot settins, so the post-install script is not fully satisfactory. I need something at uboot's build time.

Why go for the trouble also... I want to automate it as we install many openwrt routers.