UCI config migration across OpenWrt releases
Tanjeff Moos
Tanjeff.Moos at westermo.com
Thu Apr 16 07:05:45 PDT 2026
On 4/14/26 18:31, Eric wrote:
>> As I understand it, uci-default scripts run only on first boot (after a
>> factory reset) and are then deleted. How can they run during/after an
>> upgrade?
>>
>> Regards, Tanjeff
>>
> Hi Tanjeff,
>
> The post install script fires off some actions that run any new
> package-specific uci-defaults that were delivered in the package.
> Scan down to the middle of this function, you'll see where it
> picks them up, right after it handles any kmods and applies the
> sysctl settings...
That's true if I upgrade a single package. However, on my device I
install a new image using sysupgrade, preserving the config. So the
sequence is:
1. install old image (uci-defaults are run and deleted)
2. Install new image (preserve config)
Then, the deleted uci-defaults would still be deleted and thus not be
run. Except sysupgrade would restore uci-defaults somehow?
Additional info: My image is in FIT format and lives in flash. During
boot it is extracted to RAM, and my system uses a ramdisk as rootfs. The
configs (i.e. /etc) are stored in an overlayfs, placing a flash
partition on top of the ramdisk. This setup might be unusual ...
More information about the openwrt-devel
mailing list