I have a x86 router that I upgrade with the two partitions strategy: Sysupgrade help for x86_64 - #14 by frollic
In a third partition I made some scripts to automate the building of a custom image with the same installed packages. Download the rootfs archive and kernel and copy them to the other root and boot partitions. This works well.
So now I'm trying to figure out how to backup current configs and restore them on the reboot of the upgraded partition,
I've tried to copy them manually after changing the other rootfs. But they seems to get overwritten by the first boot procedure.
After that, I tried to use the sysupgrade restore mecanism (https://openwrt.org/docs/techref/sysupgrade#how_it_works) by generating the sysupgrade.tgz archive and copying it in the new rootfs manually before rebooting. But it seems the
/lib/preinit/80_mount_root do not get executed on my firstboot on the upgraded rootfs. There is a INITRAMFS env variable that is checked in the file, but I can't figured out where it is set.
Do someone knows the first boot procedure well enough to tell if this approach could work for automating the config files restore? Or has suggestions how to achieve a fully automated upgrade?