I am going to flash OpenWrt to a router, and give it to my brother to use at his home.
By default, when doing a reset, OpenWrt will have Wifi disabled, lan 192.168.1.1, etc.
I would like to have a specific configuration pre-configured for each router (he will be using 3 - 1 as main router and 2 as dump AP - with LAN connection if possible, and Mesh if not), so that when doing a reset to default, the original configuration will be used.
And will that set of "defaults" survive across Attended SysUpgrades?
Wouldn't having persistent custom default configs mean that auc is not usable after that and future upgrades would each need to be a custom build with installation via sysupgrade pointing to the custom image, especially on squashfs based images?
It is my understanding that what you are referring to relates to keeping the active settings only. Installing or upgrading to a normal sysupgrade would install the standard "default" config so any issuing of the firstboot command ('Reset to defaults' in Luci) would no longer use his custom 'default' config as installed by your recommended method.
I would think that in order to achieve the goal of the OP, a custom build for every future upgrade would be needed.
EDIT: I take "... so that when doing a reset to default, the original configuration will be used." to mean that he wants his custom config to be applied and not the OpenWrt standard default config from /rom/etc/config/.
Having your personal settings included in the image as the reset-proof defaults requires a personal image compilation with "custom files" (with imagebuilder or full buildroot) or directly modifying the original source code (with the full buildroot).
supplying the modified config files as custom files is the easiest method,
including uci-defaults scripts that modify settings as custom files would be slightly harder
modifying sources is much harder (and required full buildroot)
(Attendedsysupgrade knows nothing about the current settings, but as it uses the normal sysupgrade for flashing the generated image, it naturally allows keeping the current settings. But the current settings are not included in the generated image itself, as they are provided as an additional backup file to be flashed. And reset would quite normally lead to the original normal defaults.)
i am using following approach for this
reset your router to defaults
install additional packages
setup everything as you wish
when you finish, copy with SCP files from router /etc/config to your PC
setup your build environment (ex on Linux)
copy your files into /home/user/openwrt/files
openwrt is folder where you git clone
make menuconfig
select all packages which you are installed from Luci
compile your custom bulid
flash to router
this way, factory reset will always be a good working premade config
packages are already installed
... similar things could be made with online firmware selector +additional packages + "uci defaults"