summaryrefslogtreecommitdiffstats
path: root/mkinitcpio.8.txt
blob: 4b0d77020f9317d4f6125351260a563265919e69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/////
vim:set ts=4 sw=4 syntax=asciidoc noet:
/////
mkinitcpio(8)
=============

Name
----
mkinitcpio - Create an initial ramdisk environment

Synopsis
--------
'mkinitcpio' [options]

Description
-----------
Creates an initial ramdisk environment for booting the linux kernel. The
initial ramdisk is in essence a very small environment (early userspace) which
loads various kernel modules and sets up necessary things before handing over
control to init. This makes it possible to have, for example, encrypted root
filesystems and root filesystems on a software RAID array. mkinitcpio allows
for easy extension with custom hooks, has autodetection at runtime, and many
other features.

Options
-------
*-A, \--add* 'hooks'::
	Add the additional 'hooks' to the image. These will be processed in order
	after all other hooks from the config file. Multiple hooks should be
	comma-separated. This option can be specified multiple times.

*-b, \--basedir* 'basedir'::
	Use 'basedir' as a starting point for gathering information about the
	currently running system. Default: /.

*-c, \--config* 'config'::
	Use 'config' file to generate the ramdisk. Default: /etc/mkinitcpio.conf

*-g, \--generate* 'filename'::
	Generate a CPIO image as 'filename'. Default: no; this means nothing will be
	written to the filesystem unless this option is specified.

*-H, \--hookhelp* 'hookname'::
	Output help for hookname 'hookname'.

*-h, \--help*::
	Output a short overview of available command-line switches.

*-k, \--kernel* 'kernelversion'::
	Use 'kernelversion', instead of the current running kernel. This may be a
	path to a kernel image or a specific kernel version. If specified as a path to
	an image, this will always be prefixed by the 'basedir'.

*-L, \--listhooks*::
	List all available hooks.

*-M, \--automods*::
	Display modules found via autodetection. mkinitcpio will automatically try to
	determine which kernel modules are needed to start your computer. This option
	lists which modules were detected.

*-n, \--nocolor*::
	Disable color output.

*-p, \--preset* 'preset'::
	Build initramfs image(s) according to specified 'preset'. This may be a file in
	/etc/mkinitcpio.d (without the .preset extension) or a full, absolute path to a
	file.

*-S, \--skiphooks* 'hooks'::
	Skip 'hooks' when generating the image. Multiple hooks should be comma-separated.
	This option can be specified multiple times.

*-s, \--save*::
	Saves the build directory for the initial ramdisk. Default: no; This means
	the directory will not be retained if this option isn't specified. Useful for
	debugging purposes.

*-t, \--builddir* 'tmpdir'::
	Use 'tmpdir' as the temporary build directory instead of /tmp. 'tmpdir'
	must exist. The 'TMPDIR' environment variable is also honored to set this
	location, but the command line option will take precedence.

*-v, \--verbose*::
	Verbose output. Outputs more information about what's happening during
	creation of the ramdisk.

*-z, \--compress* 'compress'::
	Override the compression method with the 'compress' program.

About Hooks
-----------
A hook is a script that executes in the initial ramdisk. Scripts are listed in
order of execution as a space separated string in the *HOOKS* variable in the
mkinitcpio configuration file. Hooks can, for example, set up the udev device
filesystem, load IDE modules, etc.

About Presets
-------------
A preset is a pre-defined definition on how to create an initial ramdisk.
Instead of specifying the configuration file and which output file, every time
you generate a new initial ramdisk, you define a preset and use the -p switch
to generate an initial ramdisk according to your preset. Presets are located in
/etc/mkinitcpio.d

Files
-----
'/etc/mkinitcpio.conf'::
	Default configuration file for mkinitcpio.

'/etc/mkinitcpio.d'::
	Folder containing mkinitcpio presets.

'/usr/lib/initcpio'::
'/lib/initcpio'::
	Files related to creating an initial ramdisk.

Examples
--------
*mkinitcpio*::
	Perform a 'dry-run'. This will generate an initial ramdisk but will not
	write anything. Use -g to create the real image.

*mkinitcpio -p linux*::
	Create an initial ramdisk based on the 'linux' preset.

*mkinitcpio -b /mnt -g /mnt/boot/initramfs-linux.img -k /boot/vmlinuz-linux*::
	Create an initial ramdisk for the root at /mnt, with the kernel at
	/mnt/boot/vmlinuz-linux. The resulting image will be written to
	/mnt/boot/initramfs-linux.img.

See also
--------
A more thorough article on configuring mkinitcpio:
<http://wiki.archlinux.org/index.php/Configuring_mkinitcpio>

*initrd*(4), *lsinitcpio*(1)

Bugs
----
Upon writing this manpage, there were no noticeable bugs present. Please visit
<http://bugs.archlinux.org/> for an up to date list.

Authors
-------
mkinitcpio is created by the Arch Linux Developer community.

Manpage written by:::
* Glenn 'RedShift' Matthys <glenn@opengate.be>

Manpage contributions by:::
* Jens 'byte' Adam <j_adam@web.de>
* Geir 'gejr' Vaagland
* Joerie 'Thralas' de Gram <j.de.gram@gmail.com>

Copyright
---------
Copyright (c) Arch Linux