On first boot all defaults are generated using files in openwrt/package/base-files/files/etc/uci-defaults/
Network configurations must be added as UCI commands to a file named XX-name with XX being the order of execution. File should be named something like 99-custom in order to run after defaults have been created.
Add 'exit 0' to the end of the file to remove after execution, or your network config will continuously be overwritten.
Most settings are in ready UCI config files in/etc/config in the image.
Some settings, like "system" and "network" are generated on the fly at the first boot, based on board detection, but only in case those config files do not exist.
Uci-defaults scripts can be used tweaking settings or e.g. for migration between versions, but they have no major role in generating the normal system defaults.
Interesting. What version would this be? When building 21.02 stable there are no configuration files to begin with. Unless this is specific to my device(rpi4b)?
All OpenWrt versions, at least since Kamikaze 8.09 in 2008...
Most settings are in respective packages, and placed into /etc/config in the image compilation phase by the Makefiles of each package.
Some settings, like network, are generated on the fly at boot, if missing. E.g. network for ipq806x routers
It does. After the compilation...
The whole root file system is initialised and prepared, and files are gathered there.
Note also the how etc/ includes also two "custom files" from me: Compile_info.txt and HNsettings.r7800-041221.cpt
This is from my build system after the compilation: