]> git.ipfire.org Git - thirdparty/dracut.git/blob - README
network-manager: remove useless use of basename
[thirdparty/dracut.git] / README
1 dracut
2 ------
3 dracut is an event driven initramfs infrastructure.
4
5 dracut (the tool) is used to create an initramfs image by copying tools
6 and files from an installed system and combining it with the
7 dracut framework, usually found in /usr/lib/dracut/modules.d.
8
9 Unlike existing initramfs's, this is an attempt at having as little as
10 possible hard-coded into the initramfs as possible. The initramfs has
11 (basically) one purpose in life -- getting the rootfs mounted so that
12 we can transition to the real rootfs. This is all driven off of
13 device availability. Therefore, instead of scripts hard-coded to do
14 various things, we depend on udev to create device nodes for us and
15 then when we have the rootfs's device node, we mount and carry on.
16 This helps to keep the time required in the initramfs as little as
17 possible so that things like a 5 second boot aren't made impossible as
18 a result of the very existence of an initramfs. It's likely that
19 we'll grow some hooks for running arbitrary commands in the flow of
20 the script, but it's worth trying to resist the urge as much as we can
21 as hooks are guaranteed to be the path to slow-down.
22
23 Most of the initramfs generation functionality in dracut is provided by a bunch
24 of generator modules that are sourced by the main dracut script to install
25 specific functionality into the initramfs. They live in the modules.d
26 subdirectory, and use functionality provided by dracut-functions to do their
27 work.
28
29 Some general rules for writing modules:
30 * Use one of the inst family of functions to actually install files
31 on to the initramfs. They handle mangling the pathnames and (for binaries,
32 scripts, and kernel modules) installing dependencies as appropriate so
33 you do not have to.
34 * Scripts that end up on the initramfs should be POSIX compliant. dracut
35 will try to use /bin/dash as /bin/sh for the initramfs if it is available,
36 so you should install it on your system -- dash aims for strict POSIX
37 compliance to the extent possible.
38 * Hooks MUST be POSIX compliant -- they are sourced by the init script,
39 and having a bashism break your user's ability to boot really sucks.
40 * Generator modules should have a two digit numeric prefix -- they run in
41 ascending sort order. Anything in the 90-99 range is stuff that dracut
42 relies on, so try not to break those hooks.
43 * Hooks must have a .sh extension.
44 * Generator modules are described in more detail in README.modules.
45 * We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
46 as a kernel parameter, the initramfs will drop to a shell just before
47 switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
48 will break just before hooks in that hookpoint run.
49
50 Also, there is an attempt to keep things as distribution-agnostic as
51 possible. Every distribution has their own tool here and it's not
52 something which is really interesting to have separate across them.
53 So contributions to help decrease the distro-dependencies are welcome.
54
55 Currently dracut lives on github.com and kernel.org.
56
57 The tarballs can be found here:
58 http://www.kernel.org/pub/linux/utils/boot/dracut/
59 ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/
60
61 Git:
62 git://git.kernel.org/pub/scm/boot/dracut/dracut.git
63 http://git.kernel.org/pub/scm/boot/dracut/dracut.git
64 https://git.kernel.org/pub/scm/boot/dracut/dracut.git
65
66 git@github.com:dracutdevs/dracut.git
67
68 Git Web:
69 https://github.com/dracutdevs/dracut.git
70
71 http://git.kernel.org/?p=boot/dracut/dracut.git
72
73 Project Documentation:
74 http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
75
76 Project Wiki:
77 http://dracut.wiki.kernel.org
78
79 See the TODO file for things which still need to be done and HACKING for
80 some instructions on how to get started. There is also a mailing list
81 that is being used for the discussion -- initramfs@vger.kernel.org.
82 It is a typical vger list, send mail to majordomo@vger.kernel.org with body
83 of 'subscribe initramfs email@host.com'
84
85
86 Licensed under the GPLv2