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