Commit Graph

31 Commits (d0096de764e73f372f9ca93063f0270fc6b02c20)

Author SHA1 Message Date
Harald Hoyer d3be5a89e5 netroot: do not die, if arping failed 2011-10-19 14:24:07 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer fb59f4c967 get rid of absolute PATHs 2011-04-08 13:49:06 +02:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Pádraig Brady c8584872be network: don't die if gateway is down and root server is local
modules.d/40network/netroot: Don't arping the gateway if we don't need to
2010-10-28 17:11:34 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer c98bcec89c add preliminary IPv6 support 2010-02-04 16:05:19 +01:00
Warren Togami 157a8ddf5c Revert to per-device resolv.conf by Seewer's suggestion. 2009-10-13 14:19:49 -04:00
Philippe Seewer 98f25e9694 Add simple STP timeout handler
This patch adds STP timeout error handling with arping. It's rather
simple since it only cares about the primary interface and blindly
assumes that if no gateway is available the root server is on the
same subnet.
2009-10-06 15:16:52 +02:00
Harald Hoyer a1dd79d4fe network/netroot: remove flock
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Harald Hoyer 0519556070 network/netroot: do not redirect output on rdnetdebug
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Warren Togami 984a819b92 There is only one resolv.conf. 2009-07-30 09:27:09 -04:00
Harald Hoyer b8f39ef152 renamed dracut-lib to dracut-lib.sh 2009-06-19 13:00:09 +02:00
Harald Hoyer d1baa0225b add PATH 2009-06-17 15:43:52 +02:00
Philippe Seewer 8ecd9d010a multinic support: Add bootdev cmdline argument
This introduces a new cmdline argument bootdev, to support the case
where multiple nics need to be up before the netroot handler is called.
Cases involved might be bonding, iscsi multipathing, bonding, ...
This argument is required to decide which interface is the primary to
use for dhcp root-path, default gw, etc.

When multiple ip= items are present on the cmdline, the ip= parser
now enforces the presence of <dev> further demands that the new argument
bootdev contains the name of the primary interface. Configurtion if of
course still delegated to netroot but in is enhance to ensure that netroot
"waits" for all required interfaces to be up.

Example: root=dhcp ip=eth0:dhcp ip=client-ip:::netmask::eth1:off bootdev=eth0

First, the ip= cmdline parser ensures that all ip items contain a <dev> then
checks the ip items and checks as well that an ip= item for the given bootdev
was found.

When the first netroot starts, probably for eth1, it checks wheter interface
configuration for all interfaces is available. If not it exits. The second
start of netroot (eth0, which was a bit delayed because of dhcp) sees that
all interfaces are present, configures them and continues.
2009-06-17 08:37:40 +02:00
Philippe Seewer db8158439d 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.
2009-06-17 08:37:40 +02:00
Philippe Seewer 50e7ff76de netroot: Introduce detailed cmdline parsers
This introduces detailed cmdline parsing, warning or aborting if the
cmdline does not contain arguments according to the spec.

Makeing sure the parsers don't just call getarg for netroot et al,
allows their reuse inside netroot to analyse dhcp root-path as well.
Hence we can get rid of the current netroot hooks. The hook itself stays
in order to add further modules which should run before netroot handlers
are called.

This has one drawback: nfsroot needs some more logic to handle nfs
specific data inside dhcp root-path.

The parsers have been writting according to current discussions about
cmdline arguments. This lead to the "discovery" that some test-cases
violate the spec. These tests have not been removed, but change to
"must fail".
2009-06-17 08:37:40 +02:00
Philippe Seewer 580bb5417c netroot and others: Style changes
Multiline conditionals ( && { ... } ) should use if, function
declarations go to the top of the file, add/update comments and remove
some unnecessary clutter.
2009-06-17 08:37:39 +02:00
Philippe Seewer 0c26abfa81 netroot: Always write an override file if an ip= line is present
Even if we use dhcp, ip= lines are allowed to contain the server-ip
for nfsroot, so we should store those variables for later use.
2009-06-17 08:37:39 +02:00
Philippe Seewer 9f73fedfd1 netroot: Move writing ifcfg config files to a pre-pivot script
This is mostly about style: Doing stuff after a successful mount
should go into pre-pivot.

In addition this corrects the case where the used netif is not eth0
2009-06-17 08:37:39 +02:00
Philippe Seewer a55d10c05c netroot: Use same method to check for already mounted root as init
base/init uses [ -d "$NEWROOT/proc" ] to check if root is mounted
or not. Netroot should do the same. In addition this gets rid of
another file in /tmp, since /tmp/netroot.done isn't needed anymore.
2009-06-17 08:37:39 +02:00
Philippe Seewer 2734a87537 netroot: Use root.info instead of netroot.info
Having two files which are used more or less at the same time isn't
that easy to handle and read. Instead, move the contents of netroot.info
to root.info and only use root.info. This is cleaner and makes debugging
easier.
2009-06-17 08:37:39 +02:00
Philippe Seewer 05e2c5923c netroot: Check argument
There's no sense in running netroot without a valid first argument
and further running netroot with no interface config present isn't
good as well.
2009-06-17 08:37:39 +02:00
Philippe Seewer 9cdfd735a8 netroot: Don't export NEWROOT
Exporting NEWROOT to handlers when we already pass them two other
arguments doesn't make sense. Passing it as a third argument is
better.
2009-06-17 08:37:39 +02:00
David Dillow aec48753c2 network: add support for netroot=...
This adds support for a command line option netroot=, which is currently
equivalent to root=. This will allow us to break out handling in NBD and
iSCSI to support constructs such as "root=LABEL=/ netroot=dhcp" to make
use of our block device handling with network attached devices.

iSCSI has not been changed in this patch as I don't currently have a way
to test it.
2009-06-11 01:47:11 -04:00
Warren Togami f3d9b04d1a .override also becomes net.* file only after successful rootfs mount. 2009-06-10 14:02:45 -04:00
Warren Togami 9a9777a19c Write ifcfg style file upon successful netboot.
TODO: static must be implemented, example in comments.
2009-06-10 13:16:50 -04:00
Warren Togami f2287b3626 Write MAC address to a file at successful netroot mount, NetworkManager wants this. 2009-06-10 11:12:14 -04:00
Warren Togami bf4626d933 dhclient.* files become net.* only after successful netboot.
This is an attempt to avoid confusing post-boot scripts by having them
consider only net.* files.
2009-06-10 10:21:11 -04:00
David Dillow 7d7efa4a3d netroot: add common handler for network root devices
/sbin/netroot is a jumping off point to allow various network
root devices to share infrastructure. It will loop over scriptlets
in the netroot handler, looking for a handler to run for this type
of netroot. Handlers can do choose to act based on command line
options to the kernel, or via DHCP options received on this interface.
They should massage root= into a form suitable for their handler.
2009-06-01 00:42:43 -04:00