Sysupgrade overlay file preservation

I have software deployed in field, now that when I enabled new package mosquito in source code , which needs the user to be present in shadow, passed, group files. Since sysupgrade preserves these files upon upgrade and mosquito is not starting after upgrade. what is the best method to do smooth transistion in upgrade without doing factory reset.

I tried to remove from base-file-essential but then also opkg changes-conf-files list files and saves them.

Thanks in advance.

state your software versions...

current code (master/21.02)... inserts any needed accounts and preserves them during sysupgrade...

1 Like

This code base is pretty old. code base is based on : 15.05.1

Is there any patches which I can port it.

is no longer supported... you can check master/HEAD>(base-files)>file/lib/preinit/80_mount_root for the relevant logic

1 Like

Thanks. I think this will solve my problem.

That seems to be working.

Now global question in sysupgrade,

I see that sysupgrade is not taking any new changes made in /etc/config from image. is there such change made in recent openwrt release so overlay if preserved and new changes be added to the config file.

that's not how it works... ( unless -n is given, existing 'on-router' config/ (settings) is included and carried across during the sysupgrade process)

show examples or re-explain to demonstrate clearly what you mean...

1 Like

What I mean is ,

Lets say, I have image running on device which has /etc/config/networ. Now I have new image where I have new fields being added in /etc/config/network. sysupgrade saves old /etc/config/network file and never takes new changes coming from upgraded images from /etc/config/network.

I am checking /etc/uci-defaults. not sure when its being executed.

1 Like

yes... 'changes' in the new image are typically the responsibitlity of that/each packages 'uci-defaults' logic...

they are not "settings to be carried" as you earlier referred to them...

1 Like

At startup by /etc/init.d/boot, which is run with the startup priority 10, so before any normal packages.

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/base-files/files/etc/init.d/boot;h=a1e8e828dd2b17006d59536e9f53887ebc001966;hb=HEAD

See also

1 Like

Thanks for the update. Got it working with uci-defaults.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.