]> git.ipfire.org Git - thirdparty/dracut.git/blame - README.md
Documentation: dynamically set current version
[thirdparty/dracut.git] / README.md
CommitLineData
ce0344d3
CW
1dracut
2====
7e8f8ddb 3
ce0344d3 4dracut is an event driven initramfs infrastructure.
1363167d
HH
5
6[![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut)
7
ce0344d3
CW
8dracut (the tool) is used to create an initramfs image by copying tools
9and files from an installed system and combining it with the
10dracut framework, usually found in /usr/lib/dracut/modules.d.
11
12Unlike existing initramfs's, this is an attempt at having as little as
13possible hard-coded into the initramfs as possible. The initramfs has
14(basically) one purpose in life -- getting the rootfs mounted so that
15we can transition to the real rootfs. This is all driven off of
16device availability. Therefore, instead of scripts hard-coded to do
17various things, we depend on udev to create device nodes for us and
18then when we have the rootfs's device node, we mount and carry on.
19This helps to keep the time required in the initramfs as little as
20possible so that things like a 5 second boot aren't made impossible as
21a result of the very existence of an initramfs. It's likely that
22we'll grow some hooks for running arbitrary commands in the flow of
23the script, but it's worth trying to resist the urge as much as we can
24as hooks are guaranteed to be the path to slow-down.
25
26Most of the initramfs generation functionality in dracut is provided by a bunch
27of generator modules that are sourced by the main dracut script to install
28specific functionality into the initramfs. They live in the modules.d
29subdirectory, and use functionality provided by dracut-functions to do their
30work.
31
32Some 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
53Also, there is an attempt to keep things as distribution-agnostic as
54possible. Every distribution has their own tool here and it's not
55something which is really interesting to have separate across them.
56So contributions to help decrease the distro-dependencies are welcome.
57
58Currently dracut lives on github.com and kernel.org.
59
60The 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
64Git:
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
71Git Web:
72 https://github.com/dracutdevs/dracut.git
73
74 http://git.kernel.org/?p=boot/dracut/dracut.git
75
76Project Documentation:
77 http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
78
79Project Wiki:
80 http://dracut.wiki.kernel.org
81
82See the TODO file for things which still need to be done and HACKING for
83some instructions on how to get started. There is also a mailing list
84that is being used for the discussion -- initramfs@vger.kernel.org.
85It is a typical vger list, send mail to majordomo@vger.kernel.org with body
86of 'subscribe initramfs email@host.com'
87
88
89Licensed under the GPLv2