initramfs
The initramfs contains all the tooling and code to boot the system and mount the root file system to continue from early userspace. You can customize it by including kernel modules in it to have them availble in the boot process as early as possible (e.g. btrfs
, amdgpu
) and define hooks to add more capabilities to early userspace (e.g. udev
, systemd
, lvm2
, encrypt
, sd-encrypt
, plymouth
).
To customize your initramfs edit /etc/mkinitcpio.conf
.
CAUTION: Keep in mind that adding to the initramfs increases the size of the resulting kernel image on disk. Unless you have created your boot partition (more specifically the EFI System partition at either /efi
, /boot
or /boot/efi
) with generous space, you should limit yourself to the most necessary.
NOTE: To enable early KMS start also include your GPU's kernel modules:
Vendor | Kernel Modules |
---|---|
Intel | i915 |
AMD | amdgpu |
nVidia |
|
VirtIO | virtio-gpu |
NOTE: If you plan on using LUKS full disk encryption, consider including the hid_apple
module if you plan on using keyboards with an Apple, Inc. identifier. Alternatively, put the keyboard
hook before the autodetect
hook.
MODULES=(btrfs hid_apple amdgpu)
HOOKS=(base udev ... block lvm2 filesystems)
For a systemd based initramfs simply replace udev
with systemd
:
HOOKS=(base systemd ... block lvm2 filesystems)
ATTENTION: If you've chosen to use LUKS disk encryption make sure to include the following hooks instead!
For busybox-based initramfs:
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck)
For systemd-based initramfs:
HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt lvm2 filesystems fsck)
After configuring your mkinitcpio.conf
to your liking, re-create the initramfs with:
mkinitcpio -P