I believe this would be a good, simple solution for the old where-to-configure-my-wireless-card-before-ifconfigging question. The patch simply adds a "preifup_$IFACE" option to /etc/conf.d/net, specifying an executable to be run immediately before any ifconfig calls. In my personal use case (a common one, I expect, judging by forum traffic concerning wireless), I just need to run a quick iwconfig script before dhcpcd is called for the wireless interface.
(Another nice thing is that this offers an obvious, simple way for people to add more complicated scripts that, for instance, configure differently for different ESSIDs, etc.)
Steps to Reproduce:
Created attachment 23817 [details, diff]
Modified net.eth0 to run script before ifconfig step
Created attachment 23818 [details, diff]
New /etc/conf.d/net with comments on new preifup option
speaking of which, jay :P
Someone close this bug as net.eth0 in baselayout >= 1.8.8 has this functionality by allowing custom preup() and predown() functions
*** Bug 52763 has been marked as a duplicate of this bug. ***
Created attachment 35994 [details]
ifupdown proof of concept
I've created a small python script, which imitates the debian ifup/ifdown
mechanism and is more flexible than the current shellscript.
This script is more a proof of concept than a ready-to-ship tool. At the moment
it lacks a proper error handling, pre-up and post-down scripting mechanisms and
a proper handling of other kind of devices (pppoe, plip, ...). It relies
heavily on /sbin/ip, which does the real work (setting addresses, routes,
bringing devices up and down).
The tgz includes a small example of the configuration file, which illustrates
the possibilites of ifup/ifdown. Note: make ifdown a link to ifup