[OpenWrt-Devel] [PATCH] base-files: Add preinit option to disable config restore
Felix Fietkau
nbd at openwrt.org
Tue Jul 14 05:09:05 EDT 2015
On 2015-07-13 16:14, Bruno Randolf wrote:
> Sometimes it's desirable to be sure that config files from a new firmware image
> overwrite the config files from the previously running firmware and we can not
> always expect the user to use 'sysupgrade -n'. In this case the option
> TARGET_PREINIT_CONFIG_RESTORE can be set to 'n'.
>
> This is more useful with a custom uci-default scripts which can selectively
> migrate config options, since the the old configuration still exists during the
> first boot in /sysupgrade.tgz until /etc/init.d/done is called.
>
> Signed-off-by: Bruno Randolf <br1 at einfach.org>
Unless I'm missing something, this seems like a rarely needed special
case to me. How about simply adding a custom preinit file to your
firmware through files/ instead?
Since the preinit script runs boot_run_hook preinit_mount_root just
before the config restore, you should be able to add your code in the
right place and use it to delete or move sysupgrade.tgz.
- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list