Hi Karl, > Adrian Schmutzler <[email protected]> wrote: > > 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. > Given that it will be set again after every sysupgrade, I think > the name is unclear. (I don't have a better one)
No, it won't! That's the whole idea behind this thing. At the beginning of config_generate, there is check whether /etc/config/system already exists (simplified for this argument), and in this case the script is terminated. So, the option will _only_ be set after initial install or after "sysupgrade -n ..." (or when someone deletes his/her /etc/config/system manually). > You've also deleted it at 90-xxxx, so good luck anyone using 99 or similar to "be at the end". Well, I consider it good practice to _not_ use the last number. It will be easy to move a script before 90-xxx, but if for some reason I don't see (there always is one) it is required to run after, it will be easy to do. (One could as well have chosen 95 ...) > Having it baked in makes > it hard to do the difference between _first_ install and > upgrades/reinstalls. See above. Achieving that is actually the goal. > We solved this by having a uci-defaults script _set_ a flag. > (_not_ baked in) This allows scripts to detect that flag and know > whether it's truly a first boot or not. > With your setup, as a script author, all you know is that it's > the first boot since a sysupgrade, iff you run before 90_end. I do not get your point here. Best Adrian
openpgp-digital-signature.asc
Description: PGP signature
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
