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.
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.
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.
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
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.
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.
/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.
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.
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.
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.
There are several snippits of shell code that are useful to multiple
scripts. Start by moving getarg() into the library.
Signed-off-by: David Dillow <dave@thedillows.org>
Otherwise it would succeed silently when we KNOW it would fail, which is not cool.
Usually this means you didn't build switch_root in your dracut checkout and you used dracut -l.
(This currently cannot be done in a check script, because of the current design of check.
Andreas intends on discussing a redesign on the list.)
On Mon, 2009-03-09 at 16:00 +0100, Harald Hoyer wrote:
> Victor Lowther wrote:
> > How does it handle nfsroot?
>
> not yet.. thus the old hooks are still called. :-/
Hmmm... your udev based resume and root mounting do not work at all for
me. If I do not install the shell-based mount hooks, the root
filesystem never gets mounted -- I have to mount it manually.
Also,