mkinitramfs generates bootable initramfs images for Linux systems.
It is a fork of illiliti's tinyramfs at commit 8abfcc9
(Fri May 21 2021), with the following changes:
- Bash completion support
- GNU-style options and usage output
- Command-line parsing via GNU
getopt(1) - Use of
localto prevent namespace pollution - Support for
rootdelaykernel parameter - Experimental
smdevhook lukshook: prompts for password if header/keyfile is missingextrafilesdirective: copy arbitrary files into imageresumehook: supports hibernation resume from swap partitions or files- Split
keymaphook intoloadkmapandloadkeys(supports BusyBox and kmod)
See the git log for full history.
The original sources can be downloaded from:
- https://github.com/illiliti/tinyramfs
- https://github.com/illiliti/tinyramfs/archive/8abfcc9/tinyramfs-8abfcc9.zip
The following advantages can be distinguished:
- No bashisms, only POSIX
sh(1p)(withlocalexception) - Portable, no distribution-specific
- Simple configuration
- Build-time and init-time hooks
- LUKS (detached header, key, password), LVM
- smdev, mdev, mdevd, eudev, systemd-udevd
The kernel must be built with:
General setup
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
CONFIG_BLK_DEV_INITRD=y
Device Drivers
Generic Driver Options
[*] Maintain a devtmpfs filesystem to mount at /dev
CONFIG_DEVTMPFS=y
For encrypted root support, enable:
Device Drivers --->
Multiple devices driver support (RAID and LVM) --->
[*] Device mapper support
[*] Crypt target support
Cryptographic API --->
<*> XTS support
<*> SHA224 and SHA256 digest algorithm
<*> AES cipher algorithms
<*> AES cipher algorithms (x86_64)
<*> User-space interface for hash algorithms
<*> User-space interface for symmetric key cipher algorithms
- POSIX
sh(1p),make(1p), and "mandatory utilities" scdoc(1)to generate manual pages
- Any POSIX-compatible shell with
localsupport (e.g.,dash(1), Busyboxash(1)) - GNU
getopt(1),switch_root(8),mount(8),cpio(1)
Optional runtime dependencies:
ldd(1)for copying binary dependenciesstrip(1p)for reducing image size by stripping binariesblkid(8)for UUID, LABEL, PARTUUID supportsmdevORmdevORmdevdOReudevORsystemd-udevdorCONFIG_UEVENT_HELPERlvm(8)for LVM supportcryptsetup(8)for LUKS support- Busybox
loadkmapor kbdloadkeys(8)for keymap support kmod(8)OR Busybox modutils+patch for non-monolithic kernels
To install:
# as root
make installConfiguration parameters are defined in config.mk.
Configure /etc/mkinitramfs/config conform your needs (see
mkinitramfs.config(5)).
Generate the initramfs:
# as root
mkinitramfs -o "/boot/initramfs-$(uname -r).img"Update your bootloader configuration (example for GRUB2):
# as root
grub-mkconfig -o /boot/grub/grub.cfgReboot.
Provided in /man and installed under the system manual hierarchy.
Original developers:
- illiliti https://github.com/illiliti
- E5ten https://github.com/E5ten
- dylanaraps https://github.com/dylanaraps
Support the original author:
- illiliti / (BTC) 1BwrcsgtWZeLVvNeEQSg4A28a3yrGN3FpK
- https://patreon.com/illiliti
mkinitramfs is licensed under the
GNU General Public License v3 or later.
See COPYING for license terms and COPYRIGHT for notices.