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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
|
'\" t
.\" Title: mkinitcpio
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.21
.\" Date: 2024-04-27
.\" Manual: mkinitcpio manual
.\" Source: \ \&
.\" Language: English
.\"
.TH "MKINITCPIO" "8" "2024-04-27" "\ \&" "mkinitcpio manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
mkinitcpio \- Create an initial ramdisk environment
.SH "SYNOPSIS"
.sp
\fImkinitcpio\fP [options]
.SH "DESCRIPTION"
.sp
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
file systems and root file systems on a software RAID array. mkinitcpio allows
for easy extension with custom hooks, has autodetection at runtime, and many
other features.
.SH "OPTIONS"
.sp
\fB\-A\fP, \fB\-\-addhooks\fP \fIhooks\fP
.RS 4
Add the additional \fIhooks\fP 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.
.RE
.sp
\fB\-c\fP, \fB\-\-config\fP \fIconfig\fP
.RS 4
Use \fIconfig\fP file to generate the ramdisk. Default: \fI/etc/mkinitcpio.conf\fP.
If specified, drop\-in files in \fI/etc/mkinitcpio.conf.d/\fP will be ignored.
.RE
.sp
\fB\-d\fP, \fB\-\-generatedir\fP \fIdirectory\fP
.RS 4
Set \fIdirectory\fP as the location where the initramfs is built. This might be
useful to generate a shutdown ramfs in \fI/run/initramfs/\fP.
.RE
.sp
\fB\-D\fP, \fB\-\-hookdir\fP \fIdirectory\fP
.RS 4
Set \fIdirectory\fP as the location where hooks will be searched for when
generating the image.
.RE
.sp
\fB\-g\fP, \fB\-\-generate\fP \fIfilename\fP
.RS 4
Generate a CPIO image as \fIfilename\fP. Default: no; this means nothing will be
written to the file system unless this option is specified.
.RE
.sp
\fB\-H\fP, \fB\-\-hookhelp\fP \fIhookname\fP
.RS 4
Output help for hookname \fIhookname\fP.
.RE
.sp
\fB\-h\fP, \fB\-\-help\fP
.RS 4
Output a short overview of available command\-line switches.
.RE
.sp
\fB\-k\fP, \fB\-\-kernel\fP \fIkernelversion\fP
.RS 4
Use \fIkernelversion\fP, instead of the current running kernel. This may be a
path to a kernel image (only supported for x86\-based architectures), a
specific kernel version or the special keyword \fInone\fP. In the latter case,
no kernel modules are added to the image.
.RE
.sp
\fB\-L\fP, \fB\-\-listhooks\fP
.RS 4
List all available hooks.
.RE
.sp
\fB\-M\fP, \fB\-\-automods\fP
.RS 4
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.
.RE
.sp
\fB\-n\fP, \fB\-\-nocolor\fP
.RS 4
Disable color output.
.RE
.sp
\fB\-U\fP, \fB\-\-uki\fP \fIfilename\fP
.RS 4
Generate a unified kernel image as \fIfilename\fP. If a CPIO image is
successfully built, it will be used to generate a unified kernel image for
UEFI booting. This combines the initramfs, the kernel, and the kernel
cmdline into one executable. This is useful for boot chain integrity where
the file is signed. Default: no.
For a list of relevant options see \fIOptions for unified kernel image\fP below.
.RE
.sp
\fB\-P\fP, \fB\-\-allpresets\fP
.RS 4
Process all presets contained in \fI/etc/mkinitcpio.d\fP. See the \fB\-p\fP option
for more detail about presets.
.RE
.sp
\fB\-p\fP, \fB\-\-preset\fP \fIpreset\fP
.RS 4
Build initramfs image(s) according to specified \fIpreset\fP. This may be a file
in /etc/mkinitcpio.d (without the .preset extension) or a full, absolute
path to a file. This option may be specified multiple times to process
multiple presets.
.RE
.sp
\fB\-R\fP, \fB\-\-remove\fP
.RS 4
Remove initramfs image(s) generated by the specified preset(s).
If used in combination with \fB\-P\fP|\fB\-\-allpresets\fP, removes the images for all
presets. This option can only be used with either \fB\-p\fP|\fB\-\-presets\fP or
\fB\-P\fP|\fB\-\-allpresets\fP.
.RE
.sp
\fB\-r\fP, \fB\-\-moduleroot\fP \fIroot\fP
.RS 4
Specifies the root directory to find modules in, defaulting to \fI/\fP.
.RE
.sp
\fB\-S\fP, \fB\-\-skiphooks\fP \fIhooks\fP
.RS 4
Skip \fIhooks\fP when generating the image. Multiple hooks should be
comma\-separated. This option can be specified multiple times.
.RE
.sp
\fB\-s\fP, \fB\-\-save\fP
.RS 4
Saves the build directory for the initial ramdisk. Default: no; This means
the directory will not be retained if this option is not specified. Useful
for debugging purposes.
.RE
.sp
\fB\-t\fP, \fB\-\-builddir\fP \fItmpdir\fP
.RS 4
Use \fItmpdir\fP as the temporary build directory instead of \fI/tmp\fP. \fItmpdir\fP
must exist. The \fITMPDIR\fP environment variable is also honored to set this
location, but the command line option will take precedence.
.RE
.sp
\fB\-V\fP, \fB\-\-version\fP
.RS 4
Display version information.
.RE
.sp
\fB\-v\fP, \fB\-\-verbose\fP
.RS 4
Verbose output. Outputs more information about what is happening during
creation of the ramdisk.
.RE
.sp
\fB\-z\fP, \fB\-\-compress\fP \fIcompress\fP
.RS 4
Override the compression method with the \fIcompress\fP program.
.RE
.SH "OPTIONS FOR UNIFIED KERNEL IMAGE"
.sp
\fB\-\-cmdline\fP \fIfilename\fP
.RS 4
Use kernel command line with unified kernel image. If none is specified,
try one of the files \fI/etc/kernel/cmdline\fP, \fI/usr/lib/kernel/cmdline\fP
or \fI/proc/cmdline\fP.
.RE
.sp
\fB\-\-no\-cmdline\fP
.RS 4
Omit embedding a kernel command line string in the unified kernel image.
Kernel command line options will need to be passed via the kernel command
line.
Overrides the \fB\-\-cmdline\fP option.
.RE
.sp
\fB\-\-splash\fP \fIfilename\fP
.RS 4
UEFI executables can show a bitmap file on boot.
.RE
.sp
\fB\-\-uefistub\fP \fIfilename\fP
.RS 4
UEFI stub image used for unified kernel image generation. Has no effect
if \fIukify\fP is being used.
Default: Attempts to look for a systemd\-boot or gummiboot
stub loader.
.RE
.sp
\fB\-\-ukiconfig\fP \fIfilename\fP
.RS 4
Configuration file to pass to \fIukify\fP. If none is specified, try one of the
files \fI/etc/kernel/uki.conf\fP or \fI/usr/lib/kernel/uki.conf\fP. If neither of
those exists, \fIukify\fP will use its internal default.
.RE
.sp
\fB\-\-no\-ukify\fP
.RS 4
Do not use \fIukify\fP to build UKIs even if it is available. This is not
recommended.
.RE
.sp
\fB\-\-kernelimage\fP \fIfilename\fP
.RS 4
Include a kernel image for the unified kernel image. Default: one of
\fI/lib/modules/${KERNELVERSION}/vmlinuz\fP, \fI/boot/vmlinuz\-${KERNELVERSION}\fP,
or \fI/boot/vmlinuz\-linux\fP.
.RE
.sp
\fB\-\-osrelease\fP \fIfilename\fP
.RS 4
Include a os\-release file for the unified kernel image.
Default: \fI/etc/os\-release\fP or \fI/usr/lib/os\-release\fP.
.RE
.SH "ABOUT PRESETS"
.sp
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 \fB\-p\fP switch
to generate an initial ramdisk according to your preset.
.sp
Typically, presets are files located in \fI/etc/mkinitcpio.d/\fP with the extension
\fI.preset\fP, e.g. \fI/etc/mkinitcpio.d/linux.preset\fP for the \fBlinux\fP preset.
It is possible to use files in other locations, too. Then the path to this
file needs to be specified.
.sp
Presets files are shell scripts that get sourced by mkinitcpio and the following
variables will influence its behavior.
.sp
Note, that mkinitcpio calls itself for each preset and passes the options
defined in the preset file file via command line arguments. Those are mentioned
in the description of the options below, so refer to the manual of the command
line arguments for more information about a particular option.
.sp
\fBPRESETS\fP
.RS 4
An array of preset names defined in this file. These names will be
used as prefix to other options to provide preset\-specific options.
For example, if a
\fIPRESET=(\*(Aqcustom\*(Aq)\fP is given, then the image is specified via
\fIcustom_image=\*(Aq/boot/custom.img\*(Aq\fP.
.RE
.sp
\fB<preset>_kver\fP (defaults to value of \fBALL_kver\fP \(em one of the two is \fBrequired\fP)
.RS 4
Specify the Kernel version (via \fB\-k\fP in mkinitcpio).
.RE
.sp
\fB<preset>_config\fP (defaults to value of \fBALL_config\fP \(em one of the two is \fBrequired\fP)
.RS 4
Path to the configuration file (passed via \fB\-c\fP to mkinitcpio).
.RE
.sp
\fB<preset>_uki\fP (one of \fB<preset>_uki\fP and \fB<preset>_image\fP is \fBrequired\fP)
.RS 4
Output file path for a unified kernel image (passed via \fB\-U\fP to mkinitcpio).
.RE
.sp
\fB<preset>_image\fP (one of \fB<preset>_uki\fP and \fB<preset>_image\fP is \fBrequired\fP)
.RS 4
Output file path for the generated image (passed via \fB\-g\fP to mkinitcpio).
.RE
.sp
\fB<preset>_options\fP
.RS 4
Further command line arguments to pass to mkinitcpio as a string or array.
They will get appended at the end of the call to mkinitcpio (after all the
options mentioned above), so this can be used to overwrite options (for
example pass a \fB\-S\fP \fIhook\fP here to skip a hook).
.RE
.SH "ABOUT INSTALL HOOKS"
.sp
Install hooks are bash scripts which are sourced during mkinitcpio runtime in
order to add modules, binaries, and other files to the image. A variety of
functions exist to facilitate this.
.sp
\fBadd_module\fP \fImodname\fP
.RS 4
Adds the module specified by \fImodname\fP to the image. Dependencies are
derived and added automatically.
.RE
.sp
\fBadd_binary\fP \fIbinary\fP [ \fIdestination\fP ] [ \fImode\fP ]
.RS 4
Adds a binary to the image. The argument \fIbinary\fP need not be an absolute
path and, if needed, a lookup will be performed. If the binary is a
dynamically linked ELF binary, dependencies will be automatically added. If
it is a symlink, both the symlink and the target binary will be added.
Optionally, a destination within the initramfs image as well as a file mode
can be specified. By default, the destination and mode be taken from the
source derived from \fIbinary\fP.
.RE
.sp
\fBadd_file\fP \fIpath\fP [ \fIdestination\fP ] [ \fImode\fP ]
.RS 4
Adds a file and any needed parent directories to the image. If it is a
symlink, both the symlink and the target file will be added. Optionally, a
destination within the initramfs image as well as a file mode can be
specified. By default, the destination and mode will be taken from the
source and mode of the file specified by the \fIpath\fP.
.RE
.sp
\fBadd_file_early\fP \fIpath\fP [ \fIdestination\fP ] [ \fImode\fP ]
.RS 4
Adds a file and any needed parent directories to the early uncompressed
image. Works the same way as \fBadd_file\fP.
.RE
.sp
\fBadd_dir\fP \fIpath\fP
.RS 4
Adds a directory and its parents to the image.
.RE
.sp
\fBadd_dir_early\fP \fIpath\fP
.RS 4
Adds a directory and its parents to the early uncompressed image. Works the
same way as \fBadd_dir\fP.
.RE
.sp
\fBadd_full_dir\fP \fIdirectory\fP [ \fIglob\fP ] [ \fIstrip_prefix\fP ]
.RS 4
Recursively adds a directory to the image by walking the given path and
calling \fBadd_file\fP, \fBadd_dir\fP, and \fBadd_symlink\fP accordingly. This function
will not follow symlinks, nor will it add the targets of symlinks.
.br
If the \fIglob\fP argument is passed, only files and symlinks matching this glob
will be added.
.br
If the \fIstrip_prefix\fP argument is passed, it will be used to strip the
destination path (path in the initramfs image) from the prefix specified by
the \fIstrip_prefix\fP argument. This can be useful when writing rootfs\-overlay
hooks.
.RE
.sp
\fBadd_symlink\fP \fIpath\fP [ \fIlink\-target\fP ]
.RS 4
Adds a symlink to the image at the specified \fIpath\fP, optionally pointing to
the specified \fIlink\-target\fP. If the \fIlink\-target\fP is not provided, it is
assumed that this symlink exists in the real file system, and the target
will be read using \fBreadlink\fP(1). There is no checking done to ensure that
the target of the symlink exists, and symlinks will not be followed
recursively.
.RE
.sp
\fBadd_all_modules\fP [ \fB\-f\fP \fIfilter\fP ] \fIpattern\fP
.RS 4
Adds modules to the image, without regard for the autodetect whitelist.
\fIpattern\fP should be a subdirectory within the kernel tree describing a
subset of modules to be included. Further refinement can be provided via
the \fB\-f\fP flag with an extended regular expression.
.RE
.sp
\fBadd_checked_modules\fP [ \fB\-f\fP \fIfilter\fP ] \fIpattern\fP
.RS 4
Similar to \fBadd_all_modules\fP with the constraint that only modules matching
the whitelist generated by the autodetect hook will be added to the image.
If the autodetect hook is not present in the image, this function is
identical to \fBadd_all_modules\fP.
.RE
.sp
\fBadd_runscript\fP \fIscriptname\fP
.RS 4
Adds a runtime hook to the image, which is a busybox ash compatible shell
script. The name of the script is guaranteed to match the name of the hook
the script is called from.
.RE
.sp
\fBadd_udev_rule\fP \fIrule\-file\fP
.RS 4
Adds a udev rule to the image. Dependencies on binaries will be discovered
and added. The argument can be a rule file name (discovered from well known
udev paths) or an absolute path.
.RE
.sp
\fBadd_all_modules_from_symbol\fP \fIsymbol\fP \fIpaths\fP
.RS 4
Adds modules from the \fIpaths\fP directories containing the \fIsymbol\fP to the
image.
.RE
.sp
\fBadd_checked_modules_from_symbol\fP \fIsymbol\fP \fIpaths\fP
.RS 4
Similar to \fBadd_all_modules_from_symbol\fP with the constraint that only
modules matching the whitelist generated by the autodetect hook will be
added to the image. If the autodetect hook is not present in the image, this
function is identical to \fBadd_all_modules_from_symbol\fP.
.RE
.SH "ABOUT EARLY CPIO"
.sp
mkinitcpio has support for early CPIO. These are uncompressed CPIO archives
prepended to the main compressed CPIO archive. They are used for early loading
CPU microcode or loading ACPI table overrides.
.sp
Install hooks can install files to this archive by adding them to \fI$EARLYROOT\fP.
.SH "ABOUT RUNTIME HOOKS"
.sp
Runtime hooks added to the image via the \fBadd_runscript\fP function from an
install hook are able to provide extra functionality during early userspace.
Specific functions in these files will run at different times. A hook can
define one or more of these. At each hook point, hooks are run in the order
that they are defined in the HOOKS variable, except for cleanup hooks which are
run in reverse.
.sp
\fBrun_earlyhook\fP
.RS 4
Functions of this name will be run once the API mounts have been setup and
the kernel command line has been parsed. Daemons needed for early userspace
should be started from this hook point.
.RE
.sp
\fBrun_hook\fP
.RS 4
Functions of this name will be run after any early hooks, and after user
defined modules have been installed. This is the most common hook point, and
functionality such as scanning for LVM volumes and mapping encrypted volumes
should be performed here.
.RE
.sp
\fBrun_latehook\fP
.RS 4
Functions of this name will be run after root has been mounted. This is
generally used for further necessary setup in the real root, such as
mounting other system partitions.
.RE
.sp
\fBrun_cleanuphook\fP
.RS 4
Functions of this name are run as late as possible. Any daemons started
from a \fBrun_earlyhook\fP function should be shut down here in preparation for
switching to the real root.
.RE
.sp
\fBrun_emergencyhook\fP
.RS 4
Functions of this name are run before the emergency shell launched in case
of boot failure. For example this allows boot splash screens to terminate
their process, so users will notice the failure.
.RE
.sp
\fBgetarg\fP \fIargument\fP [ \fIdefault\fP ]
.RS 4
This function can be used in runtime hooks to get an argument from the
kernel cmdline. If \fIargument\fP exists with a value, the value is returned. If
\fIargument\fP exists without a value, \fIy\fP is returned. If \fIargument\fP does not
exist, \fIdefault\fP is returned. If \fIdefault\fP is not specified, nothing is
returned.
.RE
.SH "ABOUT POST HOOKS"
.sp
Post hooks are executables or scripts that get executed after the image has been
successfully generated and can be used for further processing (i.e. signing).
They receive the kernel as the first argument, the image as second and
optionally the unified kernel image as a third.
.sp
Note that the first argument will be empty when the mkinitcpio has been invoked
with \fB\-k\fP \fInone\fP or \fB\-k\fP \fIversion\fP and the kernel image cannot be found on the
file system.
.sp
The following enviroment variables are passed:
.sp
\fBKERNELVERSION\fP
.RS 4
Contains the full version of the kernel the image has been built from.
.RE
.sp
\fBKERNELDESTINATION\fP
.RS 4
The default location where the kernel should be located for booting. This
usually is the same as the first argument but might differ if mkinitcpio has
not been invoked with \fB\-k\fP \fI/boot/*\fP. If no kernel image has been found this
variable will be empty as well.
.RE
.SH "EARLY INIT ENVIRONMENT"
.sp
mkinitcpio gives special treatment to certain environment variables passed on
the kernel command line:
.sp
\fBbreak\fP[=\fI<premount|postmount>\fP]
.RS 4
If specified, mkinitcpio will start a shell during early init. The optional
parameter controls when this occurs: when \fIpremount\fP or no parameter are
specified, the shell will be launched prior to mounting root. If \fIpostmount\fP
is specified, the shell will be launched after mounting root.
.RE
.sp
\fBdisablehooks=\fP\fIhooklist\fP
.RS 4
This is a comma separated list of hooks which will be skipped during early
init.
.RE
.sp
\fBearlymodules=\fP\fImodulelist\fP
.RS 4
This is a comma separated list of modules which will be loaded prior to any
others. This is generally not needed, and usually points to a configuration
or kernel problem.
.RE
.sp
\fBquiet\fP
.RS 4
Causes mkinitcpio to output fewer messages during boot. Errors will not be
suppressed.
.RE
.sp
\fBro\fP
.RS 4
Specifies that root should be mounted with readonly permissions. This is the
default behavior.
.RE
.sp
\fBrw\fP
.RS 4
Specifies that root should be mounted with readwrite permissions. This is
generally only useful if your initramfs uses the \fIfsck\fP hook.
.RE
.sp
\fBroot=\fP\fIrootdevice\fP
.RS 4
This variable describes the root partition which early init will mount
before passing control to the real init. mkinitcpio understands a variety of
formats, the most basic of which is the path to the block device, either
directly such as \fI/dev/sda2\fP, or using a udev symlink such as
\fI/dev/disk/by\-label/CorsairF80\-root\fP. Support for identification by LABEL or
UUID tags are also supported, such as, \fILABEL=CorsairF80\-root\fP. As of
util\-linux 2.22, PARTUUID and PARTLABEL are also supported. Identification
via hex encoded major/minor device ID is supported for legacy reasons, but
should be avoided as it tends to be fragile.
.RE
.sp
\fBrootdelay\fP[=\fIseconds\fP]
.RS 4
Sets the delay, in seconds, that mkinitcpio is willing to wait for the root
device to show up, if it is not available immediately. This defaults to \fI10\fP
seconds. If an invalid integer is passed, this variable will have no effect.
.RE
.sp
\fBrootflags=\fP\fIflaglist\fP
.RS 4
A comma\-separated list of flags which will be passed onto the \fBmount\fP(8)
command when mounting the root file system. Acceptable values are file
system specific.
.RE
.sp
\fBrootfstype=\fP\fIfstype\fP
.RS 4
Overrides the type of file system being mounted as root. This should almost
never be needed as \fBmount\fP(8) usually detects this on its own.
.RE
.sp
\fBrd.debug\fP
.RS 4
Enables shell debug (xtrace). If \fIrd.log\fP is not also a parameter on the
kernel command line, this parameter implies \fIrd.log=console\fP.
.RE
.sp
\fBrd.log\fP[\fI=<console|file|kmsg|all>\fP]
.RS 4
Enables logging of early userspace messages. If specified, the optional
parameter describes where this information is logged. Multiple options can
be \fBOR\fP\-d together using the pipe (|) character. Messages are always
logged to the console unless the \fIquiet\fP parameter is passed. If the
optional parameter is not specified, \fIkmsg|console\fP is assumed. If \fIrd.log\fP
is not present on the kernel command line, no logging will take place.
.br
.sp
\fBconsole\fP
.RS 4
Writes output to \fI/dev/console\fP.
.RE
.sp
\fBfile\fP
.RS 4
Writes output to \fI/run/initramfs/init.log\fP.
.RE
.sp
\fBkmsg\fP
.RS 4
Writes output to the \fI/dev/kmsg\fP device (introduced in Linux 3.5). This
option is a no\-op if your kernel lacks support for \fI/dev/kmsg\fP.
.RE
.sp
\fBall\fP
.RS 4
Writes output to all known log targets.
.RE
.RE
.sp
These are only the variables that the core of mkinitcpio honor. Additional
hooks may look for other environment variables and should be documented by the
help output for the hook.
.SH "REPRODUCIBILITY"
.sp
mkinitcpio aims to create reproducible initramfs images by default.
.sp
This means that two subsequent runs of mkinitcpio should produce two files
that are identical at the binary level.
.sp
Timestamps within the initramfs are set to the Unix epoch of 1970\-01\-01.
.sp
Note that in order for the build to be fully reproducible, the compressor
specified (e.g. gzip, xz) must also produce reproducible archives. At the time
of writing, as an inexhaustive example, the lzop compressor is incapable of
producing reproducible archives due to the insertion of a runtime timestamp.
.sp
More information can be found at \c
.URL "https://reproducible\-builds.org" "" "."
.SH "FILES"
.sp
\fI/etc/mkinitcpio.conf\fP
.RS 4
Default configuration file for mkinitcpio.
.RE
.sp
\fI/etc/mkinitcpio.conf.d\fP
.RS 4
Directory containing drop\-in configuration files.
.RE
.sp
\fI/etc/mkinitcpio.d\fP
.RS 4
Directory containing mkinitcpio presets.
.RE
.sp
\fI/etc/initcpio/install\fP, \fI/usr/lib/initcpio/install\fP
.RS 4
Search path for build time hooks.
.RE
.sp
\fI/etc/initcpio/hooks\fP, \fI/usr/lib/initcpio/hooks\fP
.RS 4
Search path for early userspace runtime hooks.
.RE
.sp
\fI/etc/initcpio/post\fP, \fI/usr/lib/initcpio/post\fP
.RS 4
Search path for post generation hooks.
.RE
.SH "EXAMPLES"
.sp
\fBmkinitcpio\fP
.RS 4
Perform a dry\-run. This will generate an initial ramdisk but will not
write anything. Use \fB\-g\fP to create the real image.
.RE
.sp
\fBmkinitcpio \-p linux\fP
.RS 4
Create an initial ramdisk based on the \fIlinux\fP preset.
.RE
.sp
\fBmkinitcpio \-g /boot/initramfs\-linux.img \-k /boot/vmlinuz\-linux\fP
.RS 4
Create an initial ramdisk for the kernel at /boot/vmlinuz\-linux. The
resulting image will be written to /boot/initramfs\-linux.img.
.RE
.sp
\fBmkinitcpio \-U /efi/EFI/Linux/systemd\-linux.efi\fP
.RS 4
Create an initial ramdisk for the kernel along with a unified kernel image.
The resulting executable will be written to
\fI/efi/EFI/Linux/systemd\-linux.efi\fP.
.RE
.sp
\fBmkinitcpio \-U /efi/EFI/Linux/systemd\-linux.efi \-\-splash /usr/share/systemd/bootctl/splash\-arch.bmp\fP
.RS 4
Create an initial ramdisk for the kernel and a unified kernel image. This
also includes a splash image which will be used during boot.
.RE
.SH "SEE ALSO"
.sp
A more thorough article on configuring mkinitcpio:
.URL "https://wiki.archlinux.org/title/mkinitcpio" "" ""
.sp
\fBinitrd\fP(4), \fBlsinitcpio\fP(1), \fBmkinitcpio.conf\fP(5), \fBbootparam\fP(7)
.SH "BUGS"
.sp
Upon writing this man page, there were no noticeable bugs present. Please visit
.URL "https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/\-/issues" "" ""
for an
up to date list.
.SH "AUTHORS"
.sp
mkinitcpio is maintained by the Arch Linux community. Refer to the \fIAUTHORS\fP
file for a full list of contributors.
.SH "COPYRIGHT"
.sp
Copyright 🄯 mkinitcpio contributors. GPL\-2.0\-only.
|