Minor tweaks to all dhcp modules - basically better quoting so that
the eval calls work better
pump can now be backgrounded
Tweaked the dhcp helpers so that more code is shared
A few tweaks to runscript.sh and rc-services.sh to avoid races

dhclient now parses dhclient_eth0 for -cf parameter to set
dhclient now strips lines starting with script and send host-name
from and adds send host-name uberlaptop; at the top
To stop this behaviour, add dhclient_edit_config=no to /etc/conf.d/net
Fixes #96322
Removed killing udhcpc hard as it now dies nicely

wpa_supplicant now respects the background=no option if
wpa_suppliant>=0.4.0 is installed
fixed network dependencies some more
You can now restart a script marked starting/inactive
Documented the use of the RC_USE_CONFIG_PROFILE variable in conf.d/rc
udhcpc now removes stale pidfiles

Fixed VLAN documentation for working with eth0.1 style names #95121
tarball.sh now works with svn
dhclient and udhcpc now report any errors to stdout
RC_DEVICE_TARBALL now defaults to no
STYLE updates to iwconfig

You can now configure all options via the MAC address of your network card
and the MAC address of AP you connect to like so
config_001122334455=( "192.168.0.2/24 brd +")
Fixes the last part of #52975
The old way of configuring for the MAC address of the AP is no longer
supported

Merged Paul Pacheco's parallel startup #69854 and modules update
#55329 patches
If RC_PARALLEL_STARTUP==yes then we no longer output einfo/ebegin
messages as they don't line up on screen correctly - instead we output
service ${myservice} starting/started/stopping/stopped/failed

Fix get_service_index() being off by one. Fix trace_dependencies() to also
take net into regard if its a net_service. This fixes two problems, first
shutdown should bring services down that uses net before the net.* services,
and secondly '/etc/init.d/net.eth0 needsme', etc should now work properly.
All changes to sbin/rc-services.sh.

Changed "sed -ne" to "sed -n -e" for portability.
Added auto_interface (default yes).
if auto_interface is yes then we
*) default to dhcp
*) automatically calculate a metric (this may need work)
*) select the best interface based on metric
(restore resolv.conf, ntp.conf and yp.conf we have saved)
otherwise we
*) default to null
wpa_supplicant no longer kills itself when we're not stopping the interface
it's running on.
wpa_supplicant now uses wpa_monitor (yet to be released) if available.
Added a new module called system which enables the definition of domain
name, dns servers, ntp servers, nis domain and nis servers per interface.
essidnet and dhcp helpers have been re-coded around this module.

Fixed ifconfig and iproute2 erroring from new lo code - fixes #88006
If /proc/net/netlink does not exist then iproute2 will fail the
check_installed function with an appropriate error - Thanks to
Jeremy Huddleston for the patch.
If /proc/net/packet does not exist then wpa_supplicant will fail
check_installed function with an appropriate error
Background fixes for net.lo, udhcpc and wpa_supplicant

removed ${devnull} from net.lo and net-script modules
updated all modules not to re-direct stderr where appropriate
iwconfig and wpa_supplicant now save their current ESSID via save_options
and reload it in their pre_stops so that ${ESSID} and ${ESSIDVAR} can be
used in users custom postdown functions

RC_DAEMON_syslog_ng allows syslog-ng to be started with the specified
launcher - like valgrind or strace. Handy for debugging/auditing.
Thanks to Rob Holland for the idea.
Stopped setting ESSID in predown functions in iwconfig and wpa_supplicant
as there is no guarantee that the current ESSID is the one we started with
Also, we may not have an ESSID at all...

bridge stops removing IP addresses from bridge ports.
iwconfig no longer tries to get an ESSID from non-wireless interfaces.
ifconfig no longer errors when deleting addresses on a non-existant
interface.

rc-services.sh now does a /sbin/depscan.sh -u if we have not got
our deptree loaded
removed net_start/stop function from net.lo, bridge and bonding
net.lo now supports depend() per interface like so
depend_br0() { need net.eth0 net.eth1 }

net.lo now supports fallback_route - fixes #75676
due to bash limitations, only one fallback route is supported
cleaned up dhcp helper
iproute now appends routes instead of adding them - this allows multiple
default routes
RC_STRICT_NET_CHECKING now supports the none "option" which means
that the net service is always up

It's now possible to configure addresses and routes for the loopback
interface if required - however you cannot override our defaults
wpa_supplicant and iwconfig now loop for 5 seconds if essid is
not returned straight away
fixed depends error in run_script

removed udhcpc-* and dhclient-* helper modules and replaced them with a
generic dhcp module which caters for all interfaces and dhcp clients that
need it.
We now prefer iproute2 over ifconfig if both are installed.

Tweak init.d/halt.sh to support new text based udev_db ('udevinfo -d' do
not work anymore, and there is no space after '(S|N):'). Also check if
devices.tar.bz2 is empty before trying to create it, bug #71143.

macchanger defaults to setting the interface down, and then trying
with it up - fixes #71929
macchanger converts mac_${IFACE} to lowercase - fixes #73549
iproute2 now configures the interface up everytime we add an address
removed "need interface" from all modules depends as net.lo requires
interface anyway

wpa_supplicant module added
config-system now creates files as .tmp instead of .new and loads the
wpa_supplicant module if needed
ifconfig now addes aliases to devices other than eth0
dhcpcd, dhclient, pump and udhcpc now expose the dhcp_${IFACE} variable
instead of the old peer_dns_${IFACE}, peer_ntp_${IFACE}, peer_nis_${IFACE}
ones

fixed dhclient-ifconfig to look for dhclient-udhcpc-wrapper in the correct
place and changed hardcoded eth1 to ${interface} in udhcpc-ifconfig.
Fixes #73327 - thanks to Benoit Boissinot
essidnet gets the essid itself instead of relying on ${ESSID}

iproute2 does not need to create dummy interfaces for aliases
unlike ifconfig so we no longer do this
We now bring down all aliases and addresses properly
Split off some functions from net.lo into helpers.d/functions
so that our DHCP helper scripts can use them too :)
Deprecated interface specific setup in favour of a generic config
macchanger brings interface up now - fixes #71929
DHCP over VLAN now works - fixes #71860
Disabled modified function checking as it's far too expensive on CPU
and still isn't 100% reliable
When specifing a module that isn't emerged, you now get an error
telling you what to emerge
Removed -p option from the diff call used for function removal

tests for hostname (none) when sending hostname via dhcpcd, udhpc or pump
udhcpc now does correct signal handling so we can release leases and
terminate cleanly
Improved pump process detection
Rewrote udhcpc helper scripts around udhcpc and wrapped dhclient to udhcpc
scripts. This makes things much saner as udhcpc is much saner - also fixed
essidnet and ipv6 local link for them.

We no longer default a fallback to APIPA when no config is given
net.example fleshed out a bit more for dhcpcd - fixes #60845
Improved forced module handling a touch
modules_sort and modules_check_user in net.lo buffer _provides,
_before and _after in arrays to avoid shelling out

Split modules_load into smaller more managable functions in net.lo
Added modules_force option to net.lo with a big phat warning in
net.example about it potentially breaking networking
Fixed indentation problem in ifconfig

net-scripts/init.d/net.lo
- added use dependany on wlan incase we're using linux-wlan-ng drivers
fixes bug #64978
- moved start() to run_start() and stop() to run_stop()
created run() and new start()/stop() functions
this is so that we have one single entry point to localise variables
and to remove any added functions loaded by our modules
- removed redundant interface_exists() as it's provided by
ifconfig and/or iproute2
net-scripts/net.modules.d/ifconfig and iproute2
- added ifconfig_tunnel and iproute2_tunnel functions
addred gre/ipip tunnel support via the the tunnel module
- fixes bug #50765

net.lo - added get_type function to return the type of the interface
- eth, ippp, etc
ipppd, tuntap
- start() moved to pre_start() and we now test by type
this means you no longer need ifconfig_ippp0=( "isdn" "dhcp" )
as ippp0 is always an isdn device
bridge - fixed stop function and moved start() to pre_start()
and automatically start if the variable bridge_${iface} exists
net.example - fixed up documentation for changed behaviour above

Do not delete depscan and envupdate caches on reboot, as this should
improve bootup times - works nicely with the '-u' parameters of both.
Also move the '-u' parameter test of depscan.sh after the directory
exist test, else /started/, etc do not exist.

In net-scripts/net.modules.d/ifconfig:
- Simplify ifconfig_is_up()
- Fix ifconfig_get_aliases_rev() to actually work... you can't
specify an interface name to ifconfig if you want to see the
aliases.
- Workaround a couple ifconfig bugs dealing with aliases
- Correct a return status in ifconfig_interface_del_addresses()

Add v-e-commands (veinfo, vbegin, etc) to sbin/functions.sh that
depend on RC_VERBOSE which defaults to no. Add --verbose to args
understood by runscript.sh.
Use veinfo and friends in net-scripts/init.d/net.lo when loading
modules since this information is confusing to users.
Always load global "modules" setting in following "modules_iface"
since this is a little easier for users to understand.

Install net.modules.d to /lib/rcscripts instead of /etc so we
don't have to deal with CONFIG_PROTECT
Fix diff code in modules_load so it can identify which functions
have been modified
Fix fallback mechanism in iface_start so that it works correctly
and doesn't report a bogus error message when trying the fallback
Get rid of need_begin trickery in iface_stop
Simplify eend processing in dhcp modules
Implement eindent, eoutdent, esetdent in functions.sh and adjust
net-scripts to use them.
Re-write einfo, ewarn, eerror, ebegin, eend, ewend to use
RC_INDENTATION and to work better on serial terminals
Remove conf.d/net.ppp0 since that is provided by net-dialup/ppp

Related to bug 38955, don't set INPUTRC. Instead patch bash so that it looks for /etc/inputrc automatically if ~/.inputrc is missing. This is better than using INPUTRC since that will override even after the user creates ~/.inputrc.

Fix dhcp in iface_start_ifconfig: It was re-using the variable
${i} which would result in the following error:
/sbin/runscript.sh: line 441: ((: 16.141.88.153: syntax error
in expression (error token is ".141.88.153")
Use vlan_IFACE instead of iface_IFACE_vlans in net.eth0 for more
consistent vlan configuration. Thanks to robbat2 in bug 55394
(not fully resolved)
Add example for checking if root filesystem is NFS-mounted via
predown function in conf.d/net for bug 53104. This might be
better integrated at some point into net.eth0

Fix bug 34607: provide examples for in conf.d/net for preup, postup, predown, postdown functions. Also pay attention to return value from postdown (previously ignored). Bump version to 1.5.0 to include in new baselayout release

rc-scripts-1.4.16. Only call generate-modprobe.conf with --assume-kernel if modules-update was called with --assume-kernel. This means that only catalyst has the dependency on module-init-tools, not everybody with the newer baselayout

Fix bug 50434: The new version of start-stop-daemon changes directory to / by default unless --chdir is specified. Revert this behavior to maintain working directory. This fixes openvpn startup (probably among other things)

Fix bug 20597: Skip RCS files when updating modules.
Fix bug 49926: Add a --assume-kernel flag to modules-update. This
requires a companion patch in module-init-tools-3.0-r2 to handle the
same flag in generate-modprobe.conf; this dependency won't be handled
in the baselayout ebuild since it only affects livecd building.

In net.eth0, fix many instances of loops like "for ((i = 0; i < 100; i
= i + 1))". The problem here is that the middle comparison is being
interpreted as a bash conditional, which means that it's doing string
comparison by default. It needs to be "i -lt 100"

Patch init.d/checkroot to list / (root) only once in mtab; see bug 38360. Patch from Gustavoz to livecd-functions.sh to run bash instead of login on serial consoles, necessary due to scrambled root password.

Update /sbin/depscan.sh, /sbin/env-update.sh, src/awk/cachedepends.awk,
src/awk/gendepends.awk and src/awk/genenviron.awk to use ENVIRON rather
then gawk -v. Also add some tests to see if we got the environment
variables.

The unmount stuff in /etc/init.d/halt.sh was flawed, in the fact that
it called 'umount -t no<insert_fs_here>', which resulted in /proc, etc
unmounted anyhow. Change it to remount the last filesystems readonly
without trying to unmount any. This fixes a few cases where reboot
would halt due to unmounted /proc, etc.

Bootsplash fixes from Michael Aichler <micha@aichler.net>, (comment #15
and #16 from bug #21019).
Bootsplash coded did not play nice with boot profiles, so I fixed that
as well. Some other style tweaks.

Apply a patch from Mike Frysinger <vapier@gentoo.org> for rc-status.
It now will work with runlevels named with any characters (other than
ones found in default bash IFS). It also adds a few sanity/error
checks, bug #26432.

Add /bin/rc-status and 'show' support to /sbin/rc-update (long overdue),
bug #4222, thanks to Sean E Russell <ser@germane-software.com>,
Michael Frysinger <vapier@gentoo.org> (/bin/rc-status) and for the 'show'
stuff to /sbin/rc-update, Max Kalika <max@gentoo.org>.
Fixed modules-update to only do the /etc/modprobe.conf generation if we
are actually running a 2.5+ kernel.

sort -t: -k3,3 -n /etc/passwd,group. Makes it easier to see whats
going on. I dont like the way several users are currently setup,
and hope to eventually fix them. Sadly, they werent added with
very much thought. Ick.