MKINITRAMFS(8)
๐ mkinitramfs โจ (MKINITRAMFS(8)) ๐
๐ธ NAME ๐ธ
mkinitramfs โ low-level tool for generating an initramfs image ๐ง
๐ SYNOPSIS ๐
mkinitramfs [option]... -o outfile [version]
mkinitramfs --version
mkinitramfs -h
โจ DESCRIPTION โจ
okay so bestie, mkinitramfs is a script that generates an initramfs image ๐ฆ An initramfs is a compressed cpio archive, and it can be used on a different box of the same arch with the matching Linux kernel. ngl this one is meant for advanced usage ๐
On your own box, update-initramfs calls mkinitramfs with the relevant parameters for you. It also keeps a sha1sum of the generated initramfs, takes care of making backups, and eventually runs the bootloader. iykyk ๐ซถ
At boot time the kernel unpacks that archive into a RAM disk, mounts it, and uses it as the initial root file system. All the finding of the root device happens in this early userspace. main character energy ๐
๐ OPTIONS ๐
-ccompress โ overrides theCOMPRESSsetting ininitramfs.conf๐-dconfdir โ sets an alternate configuration directory ๐-kโ keeps the temporary directory used to make the image ๐ซง-lcompresslevel โ overrides theCOMPRESSLEVELsetting ininitramfs.conf๐-mmodules โ overrides theMODULESsetting ininitramfs.conf๐ถ-ooutfile โ writes the image to outfile ๐-rroot โ overrides theROOTsetting ininitramfs.conf๐ท-vโ turns on verbose mode output ๐ฃ- version โ sets the kernel version of the initramfs image (defaults to the running kernel) ๐ฅ
--versionโ displays version information and exits ๐ฆ-h,--helpโ displays usage information and exits ๐
๐ ENVIRONMENT ๐
mkinitramfs honours the TMPDIR environment variable. If it's set, it uses subdirectories in the given directory for its temporary working directories. If not, it defaults to /var/tmp ๐ง The given directory should be on a filesystem that allows executing files stored there, so it should not be mounted with the noexec mount option ๐
โโ๏ธ
If SOURCE_DATE_EPOCH is set, mkinitramfs attempts to generate a reproducible initramfs image ๐
๐ FILES ๐
/etc/initramfs-tools/initramfs.confโ the default configuration file for the script. Seeinitramfs.conf(5)for a description of the available configuration parameters ๐/etc/initramfs-tools/modulesโ specified modules get put in the generated image and loaded when the system boots. The format is one per line and identical to that of/etc/modules, which is described inmodules(5)๐/etc/initramfs-tools/conf.dโ this directory lets you hardcode bootargs at initramfs build time via config snippets. That means you can setROOTorRESUME! It's especially useful for bootloaders that don't pass a root bootarg ๐ ๏ธ/etc/initramfs-tools/DSDT.amlโ if this file exists, it gets appended to the initramfs in a way that causes it to be loaded by ACPI โญ
๐งช EXAMPLES ๐งช
Create an initramfs for the currently running kernel:
mkinitramfs -o ~/tmp/initramfs-$(uname -r)
Create an initramfs for a specific kernel and keep the builddirs:
mkinitramfs -k -o ~/tmp/initramfs-2.6.21-686 2.6.21-686
Debug initramfs creation (check out the written logfile) ๐
sh -x mkinitramfs -o ~/tmp/initramfs-$(uname -r) 2> ~/tmp/log
๐ AUTHOR ๐
The initramfs-tools are written by Maximilian Attems <maks@debian.org>, Jeff Bailey <jbailey@raspberryginger.com> and numerous others ๐ซถ
๐ SEE ALSO ๐
initramfs.conf(5), initramfs-tools(7), update-initramfs(8), lsinitramfs(8), unmkinitramfs(8). ๐
bestie that's the whole page ๐ฅน it's from initramfs-tools, dated 2018/07/18, and it's a whole vibe ๐โจ
๐ฆ where this page comes from
- debian trixie: initramfs-tools-core 0.148.4 ยท GPL-2.0-or-later
- ubuntu questing: initramfs-tools-core 0.150ubuntu3
- ubuntu questing: initramfs-tools-core 0.150ubuntu3.1 ยท GPL-2.0-or-later
- ubuntu resolute: initramfs-tools-core 0.151ubuntu1 ยท GPL-2.0-or-later
- ubuntu stonking: initramfs-tools-core 0.151ubuntu3 ยท GPL-2.0-or-later
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms