> From: Daniel Dickinson <crazycsh...@gmail.com>
> Subject: [OpenWrt-Devel] [RFC] preinit/failsafe customization/modularization
> To: openwrt-devel@lists.openwrt.org
> Date: Tuesday, August 11, 2009, 5:31 AM
> I have done a significant reworking
> of /etc/preinit to make it more
> modular and customizable.  It is now possible to
> configured things like
> the failsafe ip.  It is also possible to easily
> customize what happens
> in preinit and failsafe.  

Daniel,

At a glance, I would say a preinit that's configurable at build time is a good 
idea. I haven't gotten very far with my work on the Linksys NAS200 but I 
already noticed that the current (old) preinit was going to need some changes. 
For example, the NAS200 being basically a storage server, not a router, so the 
fallback IP address should probably NOT be 192.168.1.1 because it's likely that 
that address is already in use by another system on the network (e.g. a router 
running OpenWRT ;-).

On the other hand, I would say the preinit should be very small and 
self-contained, to minimize the chance of bugs or security problems. After all 
a simple mistake can brick a device at preinit time. As far as I understand, 
preinit should provide fail-safe/fallback mechanisms, and I wonder if your 
system (which iterates files in /etc/preinit.d/conf.d and other locations) 
might invite problems. I can easily imagine users bricking their devices by 
adding, deleting or changing files in unexpected ways, and I see opportunities 
for evildoers to "plug in" malicious software, and that would be bad at preinit 
time because when something is wrong with your system, you'll want a preinit to 
behave in a perfectly predictable way to bring the system back to working order.

It would be better to store all the settings in one file, perhaps hard-code 
them at the top of the script at build time, and maybe (for targets that 
support this) allow a removable device like a USB stick to hold override 
settings. That way, even though the configuration can be changed at runtime (by 
plugging in a USB stick or whatever), it's always possible to revert to the 
flash settings by unplugging it.

I also wonder how much extra space a modularized preinit might use up on small 
devices. Maybe there should be a "master switch" in the configuration between 
Ye Olde non-modular preinit, or the New Shiny preinit stuff?

So... my vote is "Yes" on the configurable preinit, but a firm "Hmmm maybe not" 
on modularizing it.

Feel free to flame back if this doesn't make sense -- I'm still a beginner with 
OpenWRT and as I said I only glanced at your code so I may be totally off on 
some (or all?) of my arguments. 

Thanks for the good work!

===Jac

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to