multnic support: move actual interface configuration to netroot
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Tue, 16 Jun 2009 18:21:41 +0000 (20:21 +0200)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Wed, 17 Jun 2009 06:37:40 +0000 (08:37 +0200)
commitdb8158439dac10e7462203d3de44fd794bd35e2b
treea8aabdd8f47a44ca3b903b2431b85ebb16ba593f
parent3029be4df8a8b5abdab2a4a96c7fd80de4686427
multnic support: move actual interface configuration to netroot

Instead of configuring devices when they are ready, ifup and
dhclient-script write script files which are then sourced by
netroot.

This solves the problem of having multiple interfaces and not knowing
which one to use for dhcp or default route. This way, netroot (which
is serialized anyway) configures the interface before calling the root
handler and deconfigures it if the handler failed.

Example: root=nfs:server:path and ip=dhcp with eth0 and eth1 receiving
a dhcp reply, but eth0 is the correct one to use.

Assuming eth1 is the first to receive the dhcp-reply, netroot starts
and configures eth1. nfsroot is run but fails, so eth1 is deconfigured. If
eth0 has received a dhcp-reply (or not, then we wait) the other locked
netroot process starts and tries with eth0 and succeeds.
modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/40network/netroot