2 .\" Copyright (c) 2010, 2018
3 .\" The DragonFly Project. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in
13 .\" the documentation and/or other materials provided with the
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\" contributors may be used to endorse or promote products derived
17 .\" from this software without specific, prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .Nd build an initial ramdisk image for use as early userland
41 .Op Fl c Ar contentsdir
48 script builds a ramdisk (md) image based on the UFS filesystem containing
49 only the most basic tools, such as a minimal
58 as well as some basic networking tools.
59 And the ramdisk is required to help mount the encrypted root partition.
63 will be copied onto the ramdisk, maintaining the same hierarchy.
64 This directory can be changed with the
70 will calculate the contents size and create a ramdisk just big enough.
73 option accepting an integer (number of MB) can specify the required
77 can be given to ignore the
79 setting from the configuration file as described below.
82 option also accepts an integer (number of MB) and constrains the maximum
83 allowed size of the ramdisk.
88 setting from the configuration file.
90 On completion, the final image will be copied to
91 .Pa /boot/kernel/initrd.img.gz ,
92 ready to be used as an early userland.
93 The base directory for
94 .Pa kernel/initrd.img.gz
95 can be changed with the
98 .Ar bootdir (the default is
100 The temporary directory to be used for setting up the image can be specified
103 option (the default is
109 .Pa /etc/mkinitrd.conf
110 if it exists and use the configuration from this file to override the
111 following variables (defaults are in
112 .Pa /etc/defaults/mkinitrd.conf ) :
113 .Bd -literal -offset indent
120 Adding the following lines to
121 .Pa /boot/loader.conf
122 will enable the use of the created initrd image:
123 .Bd -literal -offset indent
124 initrd.img_load="YES"
125 initrd.img_type="md_image"
126 vfs.root.mountfrom="ufs:md0s0"
129 The format for vfs.root.realroot in
130 .Pa /boot/loader.conf
131 that allows the user to specify what system to mount as the
132 new root in the initrd is specified in its general form below:
133 .Bd -literal -offset indent
134 vfs.root.realroot="<type>:[arg1[:arg2[:argN]]]"
137 Currently, three types of real root are supported,
144 type allows to mount any local file system that does not require any
145 special setup apart from the initial discovery and calling the
147 program. The general format is as follows:
148 .Bd -literal -offset indent
149 vfs.root.realroot="local:<FS TYPE>:<DEVICE PATH>[:<OPTIONS>]"
154 type allows to mount volumes supported by cryptsetup. The device will
155 be set up by prompting the user for his key, and this volume will then
156 be mounted as the new root.
157 .Bd -literal -offset indent
158 vfs.root.realroot="crypt:<FS TYPE>:<DEVICE PATH>:<VOLUME NAME>[:<OPTIONS>]"
163 type allows to mount volumes supported by
165 The device will be set up by prompting the user for his key, and this
166 volume will then be mounted as the new root.
167 .Bd -literal -offset indent
168 vfs.root.realroot="tcplay:<FS TYPE>:<DEVICE PATH>:<VOLUME NAME>[:<OPTIONS>]"
171 .Bd -literal -offset indent
172 vfs.root.realroot="local:ufs:/dev/vg00/lv0[:OPTIONS]"
174 vfs.root.realroot="crypt:ufs:/dev/ad0s0a:secvolume[:OPTIONS]"
176 vfs.root.realroot="crypt:hammer2:/dev/serno/XXXXXX.s1d:root[:OPTIONS]"
184 command first appeared in
189 .An Alex Hornung Aq Mt ahornung@gmail.com .