DragonFly On-Line Manual Pages
MKINITRD(8) DragonFly System Manager's Manual MKINITRD(8)
NAME
mkinitrd -- build an initial ramdisk image for use as early userland
SYNOPSIS
mkinitrd [-b bootdir] [-c contentsdir] [-t tmpdir] [-s size]
[-S max_size]
DESCRIPTION
The mkinitrd script builds a ramdisk (md) image based on the UFS filesys-
tem containing only the most basic tools, such as a minimal init(8),
sh(1), various mount(8) utilities, lvm(8), cryptsetup(8), tcplay(8), as
well as some basic networking tools. And the ramdisk is required to help
mount the encrypted root partition.
The contents of /usr/share/initrd will be copied onto the ramdisk, main-
taining the same hierarchy. This directory can be changed with the -c
option.
By default mkinitrd will calculate the contents size and create a ramdisk
just big enough. The -s option accepting an integer (number of MB) can
specify the required size of the ramdisk. The special value of 0 can be
given to ignore the INITRD_SIZE setting from the configuration file as
described below. The -S option also accepts an integer (number of MB)
and constrains the maximum allowed size of the ramdisk. Specifying a
value of 0 will ignore the INITRD_SIZE_MAX setting from the configuration
file.
On completion, the final image will be copied to
/boot/kernel/initrd.img.gz, ready to be used as an early userland. The
base directory for kernel/initrd.img.gz can be changed with the -b option
to an optional bootdir (the default is /boot). The temporary directory
to be used for setting up the image can be specified using the -t option
(the default is /tmp).
The mkinitrd script will read /etc/mkinitrd.conf if it exists and use the
configuration from this file to override the following variables
(defaults are in /etc/defaults/mkinitrd.conf):
BUILD_DIR
INITRD_SIZE_MAX
INITRD_DIRS
CONTENT_DIRS
Adding the following lines to /boot/loader.conf will enable the use of
the created initrd image:
initrd.img_load="YES"
initrd.img_type="md_image"
vfs.root.mountfrom="ufs:md0s0"
The format for vfs.root.realroot in /boot/loader.conf that allows the
user to specify what system to mount as the new root in the initrd is
specified in its general form below:
vfs.root.realroot="<type>:[arg1[:arg2[:argN]]]"
Currently, three types of real root are supported, local, tcplay and
crypt. The local type allows to mount any local file system that does
not require any special setup apart from the initial discovery and call-
ing the mount program. The general format is as follows:
vfs.root.realroot="local:<FS TYPE>:<DEVICE PATH>[:<OPTIONS>]"
The crypt type allows to mount volumes supported by cryptsetup. The
device will be set up by prompting the user for his key, and this volume
will then be mounted as the new root.
vfs.root.realroot="crypt:<FS TYPE>:<DEVICE PATH>:<VOLUME NAME>[:<OPTIONS>]"
The tcplay type allows to mount volumes supported by tcplay(8). The
device will be set up by prompting the user for his key, and this volume
will then be mounted as the new root.
vfs.root.realroot="tcplay:<FS TYPE>:<DEVICE PATH>:<VOLUME NAME>[:<OPTIONS>]"
EXAMPLES
vfs.root.realroot="local:ufs:/dev/vg00/lv0[:OPTIONS]"
vfs.root.realroot="crypt:ufs:/dev/ad0s0a:secvolume[:OPTIONS]"
vfs.root.realroot="crypt:hammer2:/dev/serno/XXXXXX.s1d:root[:OPTIONS]"
SEE ALSO
md(4), loader.conf(5)
HISTORY
The mkinitrd command first appeared in DragonFly 2.7.
AUTHORS
mkinitrd was written by Alex Hornung <ahornung@gmail.com>.
DragonFly 5.3 March 30, 2018 DragonFly 5.3