Commit Graph

69 Commits (3ae2f09a04f5d003ef1ae01fbe50e45d16909bb7)

Author SHA1 Message Date
Warren Togami 984a819b92 There is only one resolv.conf. 2009-07-30 09:27:09 -04:00
Warren Togami 645bde35d3 Use standard ifcfg filenames, put them into an ifcfg directory. 2009-07-27 15:54:21 -04:00
Harald Hoyer 0375106c78 add source_conf for static configuration variables
source_conf sources all *.conf files of a directory

init will now source all /etc/conf.d/*.conf files
2009-07-25 11:09:34 +02:00
Harald Hoyer 4809126378 99base/init: fix argument stripping 2009-07-23 18:57:20 +02:00
Harald Hoyer 53e1c5b996 init: add "pre-trigger" and "initqueue" breakpoints 2009-07-17 14:47:49 +02:00
Warren Togami 81f83dab0a More informative failure messages or rdbreak. 2009-07-15 21:10:16 -04:00
Warren Togami c3cd4c76d7 Standardize boot failed language. 2009-07-15 16:42:34 -04:00
Harald Hoyer 52c3715fd4 change the way init arguments are stripped from the command line
$initrdargs now holds all command line options we want to strip from the
command line. Command line parsers can extend this space separated list.
2009-07-15 18:27:20 +02:00
Harald Hoyer aceddbe8a4 do not pass rdshell option to real init 2009-07-13 16:24:41 +02:00
Harald Hoyer 2a652c0b95 add environment variables for different udev versions 2009-07-13 15:03:11 +02:00
Harald Hoyer 89056045f5 check for root after udevadm settle returns 2009-07-13 15:03:11 +02:00
Harald Hoyer d72eec354a test for empty udev queue with timeout=1 instead of 0
older udev versions do not support timeout=0
2009-07-13 12:10:47 +02:00
Warren Togami dacba77805 rdbreak should imply rdshell. If sleeping forever say so, so the user doesn't wonder. 2009-07-08 13:51:43 -04:00
Harald Hoyer a75c29be45 remove redirection of output to /dev/kmesg
until we have a way to mark our messages to come from dracut.
2009-07-04 09:57:10 +02:00
Harald Hoyer a3a3448d8c rdshell 2009-07-03 18:28:09 +02:00
Harald Hoyer 58dbb43eac initqueue now loops until /dev/root exists or root is mounted
init now has the following points to inject scripts:

/cmdline/*.sh
   scripts for command line parsing

/pre-udev/*.sh
   scripts to run before udev is started

/pre-trigger/*.sh
   scripts to run before the main udev trigger is pulled

/initqueue/*.sh
   runs in parallel to the udev trigger
   Udev events can add scripts here with /sbin/initqueue.
   If /sbin/initqueue is called with the "--onetime" option, the script
   will be removed after it was run.
   If /initqueue/work is created and udev >= 143 then this loop can
   process the jobs in parallel to the udevtrigger.
   If the udev queue is empty and no root device is found or no root
   filesystem was mounted, the user will be dropped to a shell after
   a timeout.
   Scripts can remove themselves from the initqueue by "rm $job".

/pre-mount/*.sh
   scripts to run before the root filesystem is mounted
   NFS is an exception, because it has no device node to be created
   and mounts in the udev events

/mount/*.sh
   scripts to mount the root filesystem
   NFS is an exception, because it has no device node to be created
   and mounts in the udev events
   If the udev queue is empty and no root device is found or no root
   filesystem was mounted, the user will be dropped to a shell after
   a timeout.

/pre-pivot/*.sh
   scripts to run before the real init is executed and the initramfs
   disappears
   All processes started before should be killed here.

The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev
queue is empty. After a scan, it removes itsself from the queue.
2009-07-03 18:11:38 +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 83701d66f6 output everything to /dev/kmesg and add dmesg for the emergency_shell 2009-07-03 12:34:51 +02:00
Harald Hoyer e0364f95bc beautified devtmpfs mount 2009-07-02 11:59:46 +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
Harald Hoyer 7e87a0bfa0 try harder to kill udev 2009-07-02 11:47:27 +02:00
Harald Hoyer 3473f5d938 prepare init to mount devtmpfs instead of tmpfs on /dev 2009-07-01 10:53:02 +02:00
Harald Hoyer b8f39ef152 renamed dracut-lib to dracut-lib.sh 2009-06-19 13:00:09 +02:00
Victor Lowther d0e2110a9c Make /dev/shm in the initramfs.
Pretty much everyone uses it, and things break of userspace
does not make it because of a case of mistaken identities.

/sbin/start_udev on FC11, I am looking at you.
2009-06-18 23:13:04 -05: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 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 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
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 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
David Dillow 9fe7bc1bba dracut init: add rdnetdebug to exclude list 2009-06-07 18:17:03 -04: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 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
Harald Hoyer 1eeddd31af run udevadm trigger for graphics for plymouth in pre-trigger hook 2009-06-03 17:07:23 +02: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 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 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
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
Harald Hoyer 4127130480 prefixed more internal command line options with "rd"
break -> rdbreak
netdebug -> rdnetdebug
2009-05-27 14:56:20 +02:00
Andreas Thienemann 5fa499403f cleanup environment before calling real init 2009-05-26 18:08:19 +02:00
Harald Hoyer 65f14ce19c renamed internal command line options to rd* namespace
ramfsdebug -> rdinitdebug
udevinfo -> rdudevinfo
udevdebug -> rdudevdebug
2009-05-25 17:59:21 +02:00
David Dillow df44688f3e lib: create a library for useful shell functions
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>
2009-05-25 12:13:54 +02:00
Harald Hoyer a4aee9e573 add emergency hook 2009-05-20 14:25:35 +02:00
Harald Hoyer 155c171d88 recreate /dev/null after /dev mounting 2009-05-20 11:59:34 +02:00
Harald Hoyer b6e0fea80c change file descriptor for flock locking
dash does not like filedescriptors > 9
2009-05-15 12:48:11 +02:00
Harald Hoyer fea5683693 sleep 0.5 seconds instead of 1 2009-03-24 11:35:52 +01:00