[OpenWrt-Devel] Question about custom script at init on Trunk.-

David Lang david at lang.hm
Wed Jan 27 14:44:57 EST 2016


On Wed, 27 Jan 2016, Karl Palsson wrote:

> I think you may have misunderstood. S10_boot runs the files in
> /etc/uci-defaults/*
>
> The files in _/etc/uci-defaults/_ do not all start with a
> numerical prefix, and are provided by any and all package that
> has any config it wants to run. So, for a _package_ that wants to
> do something "late" to do any sort of special target
> configuration, such as changing serial ports or mount points for
> an application based on the hardware it's running on, anything
> like 99-xxx is not going to reliably be late at all.
>
> Naming your uci-defaults file something like zzzzz999-something
> will probably work, but it's pretty gross. If you instead try and
> add your own _init_ script, with a START=99, you now don't even
> run until the applications whose config you want to adjust have
> already attempted startup, at whatever START=xx tag they have in
> their own provided init script.
>
> So, /etc/uci-defaults/zzzzz999-something works, but is there a
> better way?

why do you have to change the files from something in uci-defaults?

can't you just put the corrected configs in the image (most of them are scripts, 
so you can add the needed smarts to them to have them pull in variables from 
elsewhere)

you can run a S01 script in init.d (or something late enough to work, early 
enough to run before whatever you need to change) and have it populate the 
variables that other things will use.

David Lang
_______________________________________________
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