Static interfaces are still configured on the fly as we add them, but
discussions on the mailing list have suggested that we need to have finer
control over bringing up dhcp interfaces.
The default hook just runs all the requested dhclients in parallel and waits
for them to all return. If you need something more complicated than this, or
need to have more control over bringing interfaces up, you will probably need
to override some stuff in the 40network hook.
for s in $new_domain_name_servers; do
echo "nameserver $s" >> /etc/resolv.conf
done
- set |grep -e '^new_[a-z_]=' >/net.$interface.dhcpopts
+ set |grep -e '^new_[a-z_]=' |while read line; do
+ echo "${line%%=*}=\'${line#*=}\'">>/net.$interface.dhcpopts
+ done
>/net.$interface.up ;;
*) ;;
esac
--- /dev/null
+#!/bin/sh
+for i in /net.*.dhcp; do
+ dev=${i#net.}; dev=${i%.dhcp}
+ dhclient -1 -q $dev &
+done
+wait
+
\ No newline at end of file
#!/bin/sh
->/net.$1
# loopback is always handled the same way
[ "$1" = "lo" ] && {
p=${p#ip=}
case $p in
none|off) exit 0;; # we were told to not configure anything
- dhcp|on|any) dhclient -nw "$1"; exit 0;;
+ dhcp|on|any) >/net.$1.dhcp; exit 0;;
bootp|rarp|both) exit 0;; #dunno how to do this
*) echo ${ip#ip=} | \
(IFS=':' read client server gw netmask hostname device autoconf
if [ -z "$device" -o "$device" = "$1" ]; then
case $autoconf in
- dhcp|on|any) dhclient -nw "$1";;
+ dhcp|on|any) >/net.$1.dhcp ;;
none|off|'') # do some basic configuration
ip link set $1 up
ip addr add $client/$netmask dev $1
instmods =networking ecb arc4
inst_rules "$dsrc/rules.d/60-net.rules"
inst_hook pre-pivot 10 "$dsrc/hooks/kill-dhclient.sh"
+inst_hook pre-mount 70 "$dsrc/hooks/run-dhclient.sh"