I'm looking to upgrade a package on my router while preserving the existing configuration files. However, I've encountered an issue: using opkg install overwrites the config files if they haven't been modified. Additionally, opkg upgrade isn't an option in my case, as I'm upgrading from a local .ipk file, and opkg upgrade only supports upgrading from a feed.
I'm using a separate binary to handle the upgrade process, which downloads the .ipk from a predefined API and installs it using opkg install. Therefore, I can include additional scripts or steps in this process if needed.
Could anyone suggest a flag or a workaround to prevent the existing configuration files from being overwritten during the upgrade?
its a custom proprietory agent running on openwrt21,
once we have the new release of the agent , we change the existing api to point to latest version and it gets downloaded and installed by helper , but issue is we configure some configs in the /etc/config/controllermon which gets overridden when package is installed with opkg install
So you need to mark config files as config files in ipk so that new package will install a copy of new config file next to existing one. Probably uci-defaults can be used to migrate things.
@brada4 thanks for your help,
i did solve the isue with adding preinst and postinst instructions in makefile to copy the config file before install and then pase again post install