[OpenWrt-Devel] [PATCH 1/2] base-files: indicate initial setup by uci system config option
Petr Štetiar
ynezz at true.cz
Sun Nov 17 16:20:55 EST 2019
Adrian Schmutzler <freifunk at adrianschmutzler.de> [2019-11-08 13:05:19]:
> This provides a uci system config setting that will be set only
> during initial setup. This can be used by uci-defaults script to
> determine whether they are run during initial setup or after a
> sysupgrade.
I use similar stuff in my config scripts, just differently.
I do `set system. at system[-1].firstboot_done='1'` in order to know, that
the system was already first time booted.
So if the user performs sysupgrade but prefers to keep settings, I don't run
uci-default scripts which performs one time setup stuff, like setting
hostname, generating unique auth token etc. basically it boils down to
`is_firstboot || exit 0` in those one time uci-default scripts.
-- ynezz
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list