Sysupgrade option to retain IP,mask,and default gateway settings only

Just went through the usual process of upgrading, and did not retain configs as per the many threads that say to avoid doing that when moving between major versions. All went well.

After I had flashed the image I realized I could no longer connect because the IP had reverted back to the default within the image. Easily solved once the problem was identified. A few minutes of fiddling around with my environment so I had a machine to connect to the router from, and I could connect back in. I then changed the IP details on the router, rebooted it, and then put my environment back to normal.

In the process of doing all this, it struck me that this feels like it could be done better. ie. Some kind of middle ground where only the absolute minimum config settings are retained (in my mind that would IP address of lan interface, subnet mask, and default gateway, but open to suggestions if other stuff would be worth keeping - and still viewed as safe to do so)

Q1: Does such a script/mechanism already exist? If not, what might it look like?

Q2: Looking through the code it seems the logic is a bit unique depending on the board, but seems to be ultimately triggered by platform_copy_config() in most cases (correct me if i'm off base here). Would something similar work here where only /etc/config/network is preserved?

open to other thoughts/ideas ..

I'm interested to hear any. As such an upgrade, even on commercial routers I work with - required "off-lining" it for the purpose of reloading configs.

As advice, you could build a custom image that uses your /etc/config/network - that would work.