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