Commit Graph

138 Commits (c60dbcc0aabb94e9e458c8b9b0b4b43cf9cb1dce)

Author SHA1 Message Date
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
Harald Hoyer f57b5bc735 network: move netroot to initqueue
Schedule netroot for the initqueue inside ifup and dhclient.
2009-10-01 14:45:24 +02:00
Harald Hoyer 689f9b8af7 create /var/run in 99base 2009-09-17 12:10:48 +02:00
Hans de Goede 04a8f224c1 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC
with MAC <MAC>.
Note that if you use this option you *must* specify an ifname=
argument for all interfaces used in ip= or fcoe= arguments
2009-09-16 15:01:08 +02:00
Hans de Goede 68f28d6976 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you *must* specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
2009-09-15 15:13:21 +02:00
Harald Hoyer 5a8d8dfbb6 switch modules to initqueue-finished 2009-09-15 11:17:22 +02:00
Harald Hoyer 650da7bada removed initrdargs from parse-*.sh 2009-09-10 17:34:15 +02:00
Harald Hoyer 84c2266f1a network/installkernel: it's eth_type_trans and not eth_type_transfer 2009-08-27 13:06:46 +02:00
Victor Lowther 240cc7c480 Abstract out hostonly vs. generic module installation differences.
This introduces filter_kernel_modules, which should be used to install
all kernel modules that match whatever criteria you want.

If running in --hostonly, filter_kernel_modules will only consider
modules that are loaded in the kernel, otherwise it will consider
all the modules installed on the system for the appropriate kernel.

This drastically reduces initramfs generation time when using --hostonly
by eliminating lots of unneeded filesystem activity.
2009-08-20 15:52:45 -05:00
Victor Lowther 4e207ec862 The network check script sources , so it must use /bin/bash 2009-08-16 15:29:49 -05:00
Harald Hoyer 88838bf238 network: exclude kernel modules, which need iw_handler_get_spy 2009-08-14 16:21:03 +02:00
Harald Hoyer 123e04b23e 40network/installkernel: do not install isdn and uwb modules 2009-07-31 12:40:53 +02:00
Harald Hoyer 5ea16f2790 kernel-modules: add modules for virtio devices 2009-07-31 12:40:53 +02:00
Warren Togami 984a819b92 There is only one resolv.conf. 2009-07-30 09:27:09 -04:00
Warren Togami edae4b5efb Mark the other ifcfg file when bridges are used. 2009-07-29 16:54:53 -04:00
Warren Togami 2098ebf712 Need some way of differentiating these interfaces as being netboot. 2009-07-29 14:07:08 -04:00
Warren Togami 645bde35d3 Use standard ifcfg filenames, put them into an ifcfg directory. 2009-07-27 15:54:21 -04:00
Warren Togami 47b5c0f290 With NFS root, it is possible /tmp/net.ifaces might not exist during pre-pivot.
- udevadm settle will wait for it if necessary.
- Move write-ifcfg.sh later during pre-pivot to reduce likelihood of settling being necessary.
2009-07-24 15:26:33 -04:00
Harald Hoyer 3e6d2b31ea removed all direct references to /proc/cmdline
use getarg() and getargs() from /lib/dracut-lib.sh instead of
reinventing the wheel
2009-07-24 11:54:08 +02:00
Harald Hoyer b03edf372f 40network/parse-bridge: add bridge to $initrdargs 2009-07-24 11:54:08 +02:00
David Dillow e663608c40 dash compatible substitution 2009-07-23 23:16:31 -04:00
Warren Togami ef380e9de8 Turns out this is really a misconfigured DHCP server, apply the same workaround as Debian and upstream dhclient-script. 2009-07-23 16:22:00 -04:00
Warren Togami 39f3a51d65 Fix multiple search domains with proper quoting (thanks dcbw)
Otherwise \032 appears instead of spaces.
2009-07-23 14:31:58 -04:00
Harald Hoyer c1b2cc48d6 40network/check: source dracut-functions over exported variable 2009-07-23 18:20:11 +02:00
Marc Grimme c993cfb32f 40network/check: output which binary is missing for the network module 2009-07-23 12:17:57 +02:00
Harald Hoyer 33ee031c4a dracut: add --kernel-only and --no-kernel arguments
--kernel-only
              only install kernel drivers and firmware files

       --no-kernel
              do not install kernel drivers and firmware files

All kernel module related install commands moved from "install"
to "installkernel".

For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.

The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.

Grub and the kernel can handle multiple images, so grub entry can
look like this:

title Fedora (2.6.29.5-191.fc11.i586)
        root (hd0,0)
        kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
        initrd /initrd-20090722.img
        initrd /initrd-kernel-2.6.29.5-191.fc11.i586.img
        initrd /initrd-config.img

initrd-20090722.img
  the image provided by the initrd rpm
  one old backup version is kept like with the kernel

initrd-kernel-2.6.29.5-191.fc11.i586.img
  the image provided by the kernel rpm

initrd-config.img
  optional image with local configuration files
2009-07-22 15:07:11 +02:00
Harald Hoyer 441d31b927 use kernel module directory specified on command line in modules also 2009-07-21 17:37:41 +02:00
Warren Togami beb097d9f1 Bridged network boot
* SYNTAX
bridge=<bridgename>:<ethname>
If bridge without parameters, assume bridge=br0:eth0
* When <ethname> would be configured by network scripts, instead create a bridge named <bridgename> then add <ethname> to that bridge.
* Then $netif becomes <bridgename> instead of <ethname> and all existing scripts process netroot mount via this new $netif instead of <ethname>.
* Include a few test cases in NFS and NBD
2009-07-16 16:58:19 -04:00
Harald Hoyer 1c709728ec removed warning "No ip= argument(s) for netroot provided..." 2009-07-13 15:03:11 +02:00
Harald Hoyer 9719024132 Defer mount to the real mount loop
Udev rules set a /dev/root symlink to the real root and add
a mount script to /mount/. This enables the proper use of pre-mount
scripts and prevents mount being killed by a udev timeout.
2009-07-03 12:38:43 +02:00
Harald Hoyer eab677a216 switch to initqueue handling of events
Jobs are no longer handled inside the udev events.
/sbin/initqueue is called with the commands to queue.
init will work on these jobs sequentially, so that we prevent jobs
from being killed by udev timeouts.
This serialization also prevents some problems introduced by
the udev event parallelization.
2009-07-02 11:47:28 +02:00
Seewer Philippe 2d21db6def Bugfix: Fix BOOTIF argument translation 2009-06-25 23:28:38 -04:00
Harald Hoyer b8f39ef152 renamed dracut-lib to dracut-lib.sh 2009-06-19 13:00:09 +02:00
Seewer Philippe 02a187e161 removed exit on fail "sh -e" for dhclient-script
The Bug causing dhclient to recall BIND has been identified:
dhclient-script runs with #!/bin/sh -e, causing setup_interface
to fail if no hostname is provided by dhcp as it is the last statement
in that function.
2009-06-18 15:35:00 +02:00
Seewer Philippe 00c0d5b869 fix check for dhclient-script, if interface is already up 2009-06-18 10:36:32 +02:00
Harald Hoyer d1baa0225b add PATH 2009-06-17 15:43:52 +02:00
Philippe Seewer 8ca4f85770 dhclient.conf points to the wrong location. Caused by not paying
attention while rebasing.
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 3029be4df8 netroot: Add pxelinux BOOTIF support
Having BOOTIF as an argument is a clear pointer which interface should be
used for netroot. This changes network rule generation accordingly.
2009-06-17 08:37:40 +02:00
Philippe Seewer 761ffdddb9 netroot: Only start interface configuration if really needed
Currently network configuration is launched by udev as soon as it
discovers a driver. This isn't such a good idea since we don't know
if network configuration is actually required. Change this by writing
the udev rules on the fly if required.
2009-06-17 08:37:40 +02:00
Philippe Seewer 1b31fc140b netroot: Add ip= cmdline checker
As with other netroot boot arguments ip= lines should be parsed and
checked. Having this has the advantage that other cmdline scripts
can tell the ip= parser if dhcp or ip=:srv:... is needed, like
parse-root.sh (renamed dhcp-fallback) or parse-nfsroot do.

The nfs test-suite has one check which uses static ip lines, but
the autoconf param is wrong. Fixed this as well.
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 447f044e8b write-ifcfg: Save static ip configuration
Saveing ip= options in ifup makes the information available for
later use. This solves the problem how to write static ip configuration
in ifcfg files.
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
Warren Togami 1a945a576c move dhclient.conf to /etc 2009-06-16 11:43:13 -04:00
Seewer Philippe d3b0f96893 Use relative path for ip command. 2009-06-15 17:34:36 -04:00
Seewer Philippe 12375368b9 Allow dhcp to work with dhcpv3 where the -R option did not exist. Use dhclient.conf instead. 2009-06-15 16:57:10 -04: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
Warren Togami 1311803770 Write DHCP lease file, dcbw wants it for NetworkManager to take over management of the lease post-netboot. 2009-06-08 17:18:01 -04:00
Peter Jones 3871f8f53b Don't use backticks, use $()
This is a minor style fix.
2009-06-05 10:20:13 -04:00
Seewer Philippe 07b2fbb183 Get rid of cat and grep 2009-06-05 16:10:52 +02:00
Harald Hoyer 4332e5f71f install cat for network module 2009-06-02 13:21:16 +02:00
Warren Togami 9dcf9cef38 Include only wired ethernet drivers, explicitly exclude wireless.
(If you REALLY want wireless boot, you need to write your own module to configure it properly.)
2009-06-01 18:21:40 -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
Victor Lowther f3fb8d8074 Modify the check script so that 40network will only load as a
dependency on another module.
2009-05-29 23:07:56 -05:00
Warren Togami ba126e82af $drivers specified from .conf or --drivers get copied once, instead of multiple times with other calls to instmods() 2009-05-28 15:55:44 -04:00
Warren Togami e19d6bf603 Disambiguate modules and drivers. modules are dracutmodules. drivers are kernel modules. 2009-05-28 14:27:02 -04:00
David Dillow aa43d0b0df More runtime files to /tmp 2009-05-27 22:54:03 -04:00
Warren Togami 3da5856981 Move all files generated during initrd runtime to /tmp 2009-05-27 22:41:18 -04:00
Harald Hoyer 4127130480 prefixed more internal command line options with "rd"
break -> rdbreak
netdebug -> rdnetdebug
2009-05-27 14:56:20 +02:00
Victor Lowther 1e19548857 Add check files for network and nfsroot
This way dracut will not try to install them if the system does not have
the needed prerequisites.
2009-05-25 16:35:57 -05:00
Harald Hoyer 28df9479e1 make root=dhcp work 2009-05-25 16:48:01 +02:00
Harald Hoyer 9223814d59 do not trap if hostname is empty 2009-05-25 15:32:30 +02:00
David Dillow 7e9919b927 network: prepare network configuration engine for udev-based nfsroot
This changes the network config to run dhclient from within udev, and
allows multiple dhclients to run at once. It also sets the hostname and
adds a kernel command line option 'netdebug' to help debug network issues.
2009-05-25 12:19:25 +02:00
Harald Hoyer 6c00df2068 removed debug code 2009-05-18 16:38:32 +02:00
Harald Hoyer c02c339bb5 fixed dhclient dhcp options saving 2009-05-18 16:08:58 +02:00
Harald Hoyer b80a6fda40 fixed wildcard test of run-dhclient.sh 2009-05-18 15:31:07 +02:00
Harald Hoyer 32f32c14b6 fixed 40network module 2009-05-18 15:22:33 +02:00
Harald Hoyer 17edb6aa4e mkdir /var/run for dhclient 2009-05-18 14:08:02 +02:00
Harald Hoyer b300c0354a kill dhclient if pid was found 2009-05-18 14:07:34 +02:00
Harald Hoyer e7b6ed1379 do not run dhclient, if no net device found 2009-05-15 12:43:03 +02:00
Harald Hoyer a011d66860 install all network modules 2009-05-12 15:47:01 +02:00
Harald Hoyer f5f9bfee2d add full patch to /sbin/ip and check for dhclient $pid before kill 2009-03-09 13:08:12 +01:00
Victor Lowther 02d7fdcab4 Minor changes to network scripts to bring inline with my current patch series 2009-03-06 17:04:05 -06:00
Harald Hoyer 9ec23437fa add /sbin to $PATH 2009-03-06 14:36:18 +01:00
Victor Lowther 20abd91484 Create a self-contained structure for dracut modules
All modules now live in a subdirectory /modules.d.  Each module is
self-contained -- it should contain everything that it will install
on the initrd.  All modules must include a script named install, which
will be sourced by dracut.  This script should do the actual file installation
using inst methods.  The moddir variable will point to the full path to the
module dracut is currently working on.

As usual, this patch series applies on top of my previous patch series,
and is available as normalize-modules from http://git.fnordovax.org/dracut.
2009-03-04 16:55:14 +01:00