On Sun, 06 Sep 2009 01:13:47 +0200 Felix Fietkau <n...@openwrt.org> wrote:
> Daniel Dickinson wrote: > > Hi all, > > > > I've refreshed the patches to work with current trunk (as the old > > patches were no longer applying cleanly due to recent changes). > > There are also a couple of minor functional changes some of which > > make the usb root stuff I'm working on easier. > > > > I'd really appreciate if there could be some review/comments on > > these patches soon. It's been a significant period of time and I > > haven't heard from full devs on what they think, although a couple > > of list members like the idea of the modularization I have done. > In principle, it looks useful. One thing I don't like that well is > that every hook you add has to be a separate file > in /etc/preinit.d/run.d I think it would be cleaner to have just > an /etc/preinit.d with files that are sourced at the beginning of > preinit, which can then add functions to various hooks that are > defined by preinit. For instance the netmsg plugin would then do > something like this: > > netmsg_send_message() { > netmsg [...] > } > netmsg_send_init() { > failsafe_ip > netmsg_send_message "Press reset to enter failsafe now" > } > netmsg_send_enter() { > netmsg_send_message "Entering Failsafe!" > } > > add_hook init netmsg_send_init > add_hook failsafe_enter netmsg_send_enter Hmmm...I'm not as fond of that solution because it is limited to specific hooks. My solution is much more generic. It sources the files in /etc/preinit.d/run.d/stage_* (at each stage) and then executes the functions of the same name as the file. That means packages can drop in new functionality without having to modify preinit for additional hooks. I've used that for the failsafe provider I have posted, and am using it for the usb root I am created. Those options exist as packages. Without packages things act as usual, with the packages there is a change in functionality that wouldn't be possible with predefined hooks, unless you're constantly updating the available hooks. Basically it makes third party (package or vendor-specific) addons much easier. > > I haven't actually tested your patches yet, I'll try to find the time > for it soon. Thank you, I appreciate it. > > booted. > > > > The disadvantage is slower boot on the first boot. > > > > I think the current firstboot unnecessarily complicates the process > > of the firstboot because there are configurations created during > > boot that have to be copied from tmp root and various pivots to try > > and rebase the root after having booted with with a temporary > > ramdisk root. It would be much cleaner to do all the work in > > preinit and once init starts, it's a 'normal' system. > I don't think it's unnecessary complexity. People start to worry and > pull the plug early if the boot takes too long, and on some devices, > e.g. most of the production Fonera 2.0 devices can take *really* long > for their init. Much better to have the system up and running during > that time and even allow you to change stuff in the config. Fair enough. This was more if minor irritation that something I feel strongly about, and I'm not going to push to change it if you feel there is good reason to keep it as-is. Regards, Daniel -- And that's my crabbing done for the day. Got it out of the way early, now I have the rest of the afternoon to sniff fragrant tea-roses or strangle cute bunnies or something. -- Michael Devore GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C http://gnupg.org The C Shore (Daniel Dickinson's Website) http://cshore.is-a-geek.com
signature.asc
Description: PGP signature
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel