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

David Lang david at lang.hm
Wed Jan 27 10:25:59 EST 2016


On Wed, 27 Jan 2016, Karl Palsson wrote:

> David Lang <david at lang.hm> wrote:
>>>
>>> Now, yes, I can have my 80_mystuff script go and try and create
>>> the package config files it might want to modify, but really, I
>>> want "mystuff" to run _last_ or at least, after all the packages
>>> have run. Is there any better system for this other than just
>>> naming my script zzzzz_mystuff instead of 80_mystuff? Is that
>>> expected to be "good enough" ?
>>>
>>> I'm trying this, because I've _been_ trying to use packages
>>> instead of modifying upstream, but when I want my package to do
>>> different things for different targets, it's seemed easier to
>>> hook into the existing target code, rather than trying to copy
>>> target detection and config into a package Config.in options
>>
>> typically people use 99stuff and figure that the order of 99s
>> doesn't really matter much
>>
>
> Well, the thing is, 99 isn't last. that's what I was getting at.
>
> $ ls -l build_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/etc/uci-defaults/
> total 140
> - -rw-r--r-- 1 karlp karlp 128 Jan 26 13:32 00_uhttpd_ubus
> - -rwxrwxr-x 1 karlp karlp 17158 Jan 20 17:20 01_leds -rwxrwxr-x 1
> karlp karlp 10391 Jan 20 17:22 02_network -rwxrwxr-x 1 karlp
> karlp 1673 Sep 25 11:01 03_network-switchX-migration -rwxrwxr-x 1
> karlp karlp 351 Sep 25 11:01 03_network-vlan-migration -rwxrwxr-x
> 1 karlp karlp 1244 Sep 25 11:01 04_led_migration -rwxrwxr-x 1
> karlp karlp 232 Sep 25 11:01 09_fix-seama-header -rw-rw-r-- 1
> karlp karlp 193 Sep 25 11:01 09_fix-trx-header -rw-r--r-- 1 karlp
> karlp 74 Jan 27 10:56 10-fstab -rw-rw-r-- 1 karlp karlp 418 Sep
> 25 11:01 10_migrate-shadow -rw-rw-r-- 1 karlp karlp 450 Sep 25
> 11:01 11_migrate-sysctl -rw-rw-r-- 1 karlp karlp 377 Sep 25 11:01
> 12_network-generate-ula -rw-rw-r-- 1 karlp karlp 377 Sep 25 11:01
> 99_stuff_here -rw-rw-r-- 1 karlp karlp 211 Aug 21 12:40
> agent_etactica -rwxr-xr-x 1 karlp karlp 83 Jan 11 15:05
> luci-i18n-english -rwxr-xr-x 1 karlp karlp 1285 Jan 26 13:33
> mosquitto.uci-defaults -rw-rw-r-- 1 karlp karlp 479 Aug 21 12:40
> mpacker -rwxrwxr-x 1 karlp karlp 291 Aug 21 12:40 mq_delta_gadget
> - -rwxrwxr-x 1 karlp karlp 970 Aug 21 12:40 mrelay -rwxr-xr-x 1
> karlp karlp 300 Jan 26 13:29 odhcpd.defaults -rwxrwxr-x 1 karlp
> karlp 224 Sep 24 14:24 snmpd

badly wrapped.

> Here's what you really have in a new image. Putting things in
> "99_stuff" just won't work very well. All the package provided
> uci-defaults files, which are the ones I want to extend/augment
> with my own files have to come later. They are run at
> /etc/rc.d/S10boot,

S99_whatever will run after S10_whatever. The S## files are run at startup, in 
order and the K## files are run at shutdown in reverse order (since shutdown can 
sometimes require different ordering than startup. If something is in there with 
just ## I'm not sure if they are even run.

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