Commit Graph

285 Commits (3b51f4f30bc84130bdea8d50003a98538504fb81)

Author SHA1 Message Date
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 9f10836d63 Add warn() function to log warnings but not die() 2009-06-17 08:37:40 +02:00
Philippe Seewer 0fd1ab9d87 Log error messages to /dev/kmsg
When die()'ing inside scripts that are udev run, a simple echo isn't
good, udev usually swallows that. Routing messages to /dev/kmsg
ensures they appear on screen and in addition are easily saved through
dmesg.
2009-06-17 08:37:40 +02:00
Philippe Seewer 311a2769a0 Add 'die()' for easier error handling
Printing out an errormessage and quitting is easier if there's a function
to call. If the script calling die has exit trapped, like in init, the
emergency_shell is automatically called.
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 268de90f82 netroot handlers: Add argument checking
This is probably not necessary, but paranoia dictates that the actual
netroot handlers should check if all three required arguments (netif,
root, NEWROOT) are there and useable.
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
Philippe Seewer d1a55b113d Exporting fstype, rflags and root is no longer necessary
Exporting these variables is no longer needed. All scripts that need
these are sourced and they're not used inside udev.
2009-06-17 08:37:39 +02:00
Philippe Seewer 115a35c175 nfsroot: statd is only needed for nfs4
rpc.statd is only needed for NFSv4, because it's required for
locking. We don't support locking for NFSv2/3, so start it only
if we are mount from NFSv4.
2009-06-17 08:37:39 +02:00
Philippe Seewer f2b44e351b Install debian renamed udev rules as well
Sadly, debian has reworked/renamed the udev default rules. If dracut
is to boot debian as well we need those rules.
2009-06-17 08:37:38 +02:00
Philippe Seewer 3da03a6036 NFS: Add support for debian based distros
This patch enhances nfsroot and the nfs test-suite with compatibility
for debian based distros. This is mainly the difference of using
portmap instead of rpcbind and the missing file /etc/netconfig
2009-06-17 08:37:38 +02:00
Warren Togami 1a945a576c move dhclient.conf to /etc 2009-06-16 11:43:13 -04:00
Seewer Philippe 1df0c915c6 Fix case where mdmon isn't available. 2009-06-15 23:03:02 -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
Warren Togami 21df4aa429 grep is installed by 95debug for the moment, remove this to simplify. 2009-06-12 23:48:54 -04:00
David Dillow 8bd5873ffc NBD root: add support for LVM/LUKS
With this change, we can now use LUKS and LVM over NBD. There are
some decisions to be made regarding where we should get the fstype
and fsoptions from (DHCP root vs rootfstype= etc), but the basic
functionality is there.
2009-06-11 01:47:11 -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
Warren Togami e1ee93539f Copy netboot state into /dev/.initramfs/ before switch_root
If cmdline "rdcopystate", then copy all of /tmp/* into /dev/.initramfs/ for later debugging examination.
2009-06-08 16:51:13 -04:00
Harald Hoyer 169363e827 add ipv6 rpc.idmapd and various conf files for NFS
rpcbind on Fedora does not seem work for NFS4 without IPv6
2009-06-08 14:50:22 +02:00
Harald Hoyer 6b28bb54b6 add more tools to the debug module 2009-06-08 14:49:23 +02:00
David Dillow 61752d529a NBD: fix parsing of Debian-style nbdroot config 2009-06-08 00:25:20 -04:00
David Dillow 9fe7bc1bba dracut init: add rdnetdebug to exclude list 2009-06-07 18:17:03 -04:00
David Dillow abe9ccc89a NFS root: add support for default root path and %s substitution
This implements a default path of /tftpboot/%s if no path is provided,
and adds host name substitution for %s, with a fall back to the IP address,
as provided by the kernel's nfsroot handling.

The test suite is updated to test this functionality.
2009-06-07 17:17:48 -04:00
David Dillow 4107be9f9f NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format
Reported-by: Seewer Philippe <philippe.seewer@bfh.ch>
2009-06-07 14:59:38 -04:00
David Dillow a2810bf24a root option parsing belongs in 99base now
We use this for NFS root as well, and NFSv4 was getting broken when
it wasn't present.
2009-06-06 02:31:45 -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 5fd2decfec Merge branch 'master' of ssh://dracut.git.sourceforge.net/gitroot/dracut 2009-06-05 08:51:31 +02:00
Harald Hoyer 7e05060f77 Merge commit 'dillow/master'
Conflicts:
	test/TEST-20-NFS/make-client-root
2009-06-05 08:47:51 +02:00
David Dillow 2129ffe93e nfs: cleanup currently needs grep 2009-06-05 00:26:10 -04:00
Victor Lowther fa0f73f438 Ugh, using backticks instead of $()
Get that evilness out of dracut, please.
2009-06-04 22:02:37 -05:00
Victor Lowther 8158ad29ec make udevtriggeropts just use an environment variable
No point in making a file and then reading from it when hooks are sourced.
2009-06-04 22:02:37 -05:00
Harald Hoyer 2e7f65d96e try to install switch_root from system 2009-06-04 17:44:26 +02:00
Harald Hoyer 53759538cb fix udevtriggeropts 2009-06-04 17:44:21 +02:00
Harald Hoyer 91b1157500 add support to specify additional udev trigger options 2009-06-04 13:07:01 +02:00
Warren Togami 2c02c8318c Ensure KMS drivers are loaded before plymouth. 2009-06-03 14:25:50 -04:00
Warren Togami dff7ea6864 No longer needed, already ran in pre-trigger 2009-06-03 13:10:57 -04:00
Harald Hoyer 27a101f47c simplify plymouth startup 2009-06-03 17:31:48 +02:00
Harald Hoyer 071bd6e1a0 don't run plymouth --show-splash from udev rule
we have to run it no matter what, so don't rely on a rule
2009-06-03 17:12:07 +02:00
Harald Hoyer 1eeddd31af run udevadm trigger for graphics for plymouth in pre-trigger hook 2009-06-03 17:07:23 +02:00
Warren Togami 0a56724cd6 plymouth0.7: Launch plymouth --show-splash from udev event, and once before switch_root in case it didn't start 2009-06-02 20:20:44 -04:00
Warren Togami e9b1426eb7 Detect KMS capable drm drivers instead of hard coded list. 2009-06-02 16:51:49 -04:00
Harald Hoyer 87ce134e08 preserve the original root= variable 2009-06-02 18:01:52 +02:00
Harald Hoyer 92bfa4c6e3 use iscsi-iname to generate the initiator name, if not specified 2009-06-02 16:10:36 +02:00
Harald Hoyer 61537c7de6 override commandline/conf options by root_path 2009-06-02 16:10:04 +02:00
Harald Hoyer 34cb684936 removed debug code 2009-06-02 13:32:11 +02:00
Harald Hoyer ac4ded9128 add iSCSI module 2009-06-02 13:22:29 +02:00
Harald Hoyer 4332e5f71f install cat for network module 2009-06-02 13:21:16 +02:00
Harald Hoyer cff3457e32 fixed fstype mount options 2009-06-02 09:25:24 +02:00
Warren Togami d0c7d42b3e plymouth-0.7: details.so must be copied as well 2009-06-01 22:57:08 -04:00
David Dillow ebd5615489 strip block: off root= when using the mount hooks
I'm not sure they are still used, but if so they need to
trim the prefix.
2009-06-01 21:43:07 -04:00
David Dillow b4dc8ad346 Allow NFS and NBD to be built into the kernel
Probe for NFS and NBD capability before trying to load their modules
in case they are built into the kernel. Ugly use of flag files, but
avoids the need for grep to be on the image.
2009-06-01 19:59:22 -04:00
David Dillow 7132e6a346 Remove dependency on /bin/echo
Actually cut the last dependency on //bin/echo for resume.
2009-06-01 19:46:43 -04:00
David Dillow 92997caf35 cleanup shebangs in sourced scripts
All of the scripts are sourced, so there is no need to have
will pick up on the .sh extension.
2009-06-01 19:17:48 -04:00
Warren Togami 4f0e32751f nfs needs sunrpc 2009-06-01 18:38:53 -04: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
Warren Togami e902c65391 plymouth-0.7: fully install default theme and associated plugin 2009-06-01 16:09:24 -04:00
Warren Togami e26cb36fca Merge branch 'master' of ../dracut-dillow 2009-06-01 14:54:59 -04:00
Victor Lowther 4eba843dde Revert --resolve-names=never in init
That flag is too new to work on most shipping distros, so fall back to
including /etc/group and the libnss_files.
2009-06-01 04:04:34 -05:00
David Dillow 2b117123ec Add NBD support
This adds basic support for root on a network block device to
the netroot framework.
2009-06-01 00:59:52 -04:00
David Dillow 5103130352 nfsroot: move to netroot framework
Parse and convert commandline options in the cmdline hook, and
fill in the missing pieces in the netroot hook. This also allows
root=dhcp to work as expected.
2009-06-01 00:56:01 -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
David Dillow ae5bc1fd8a dracut-lib: add source_all to library
The network root handler will need this.
2009-06-01 00:39:56 -04:00
David Dillow 9810ce7e38 resume: add support for labeled resume devices
I noticed when doing the block root= parser that resume
didn't support labeled resume devices. Fix that up and
get rid of a dependency on /bin/echo in the process.
2009-06-01 00:27:06 -04:00
David Dillow d15c7a1ab7 cmdline: cleanup handling and block: handler
Now init checks that we understood the root= option, and can
act upon it, presenting and error if not. Also, clean up the
generation of udev rules such that we don't require /bin/echo.
2009-06-01 00:21:53 -04:00
David Dillow e450281431 dracut: add cmdline hook
This hook is where each module should parse kernel command line
options and perform any legacy translation.
2009-06-01 00:07:26 -04:00
David Dillow 5c123162ed block root: split out resume parsing and udev rules
We have a resume module, and these rules should live in it. Modify
the sort order a bit to ensure the resume rules continue to execute
first.
2009-05-31 23:19:31 -04:00
David Dillow 145ca9e5b3 nfsroot: move to same sort order as block methods
There is no reason for this to be a 40nfsroot rather than 95nfs
once other network root handlers are added. Go ahead and move it.
2009-05-31 22:45:12 -04:00
Victor Lowther e314863e67 Several updates to make dracut a bit more robust.
First, add a check script to 99base to ensure that it will load its
prerequisites.

Second, disable the udev magic dracut normally uses when generating
test images -- it was causing random failures when creating the test
root filesystem, presumably due to race conditions between the
rootfs creation scripts and udev.

Third, consolidate the rootfs creation scripts into one script.
2009-05-30 16:53:12 -05:00
Victor Lowther 5033486389 Have udevd never try to resolve user or group ownership of devices.
This gets rid of the need to have potentially security-sensitive files
like /etc/passwd and /etc/group in the initramfs, and makes the initramfs
a bit smaller.  We trust the final userspace to do The Right Thing when
assigning user/group ownership to devices.
2009-05-30 11:45:47 -05: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
Victor Lowther 3774d3cc15 Removed 90kernel-modules-loaded.
Sure, it will load all the modules that are currently installed into the
initramfs.  Why was this a good thing, again?
2009-05-29 23:07:56 -05:00
Victor Lowther 66ac3cd1f0 Update check scripts in modules to make them work again.
Also got rid of "dracutmodules=hostonly".  We have --hostonly, and it
does the same thing.
2009-05-29 23:07:15 -05:00
Warren Togami 2c54bc996a Victor pointed out --hostonly doesn't go into check. 2009-05-29 23:56:55 -04:00
Warren Togami 2d7d2fdbbb Properly detect -H and --hostonly mode 2009-05-29 18:38:49 -04:00
Warren Togami adfe014640 Remove redundant modprobe.d copy 2009-05-29 13:20:33 -04:00
Warren Togami 642e160c0e Install KMS drivers. It sucks to have a hard coded list, but there is no clean way of doing this distro-neutral at the moment. 2009-05-29 01:14:59 -04:00
Victor Lowther 06558b3ee4 Make nfsroot work with hostonly mode. 2009-05-28 21:02:14 -05:00
Warren Togami c1143d3d6c Filesystem modules already included in =fs, no runtime detection allowed in default dracut 2009-05-28 16:29:22 -04: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
Warren Togami 6941b1b556 Make /sbin/nfsroot executable 2009-05-27 14:35:15 -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
Harald Hoyer ee0deb9918 better handling of mount moving rpc_pipefs 2009-05-27 14:21:52 +02:00
Harald Hoyer 77f6725c4e install umount for nfsroot 2009-05-26 18:08:56 +02:00