MKINITRAMFS(8)

๐Ÿ“ฆ
version 0.151ubuntu3 ยท 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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 ๐ŸŽ€

  • -c compress โ€” overrides the COMPRESS setting in initramfs.conf ๐Ÿ“
  • -d confdir โ€” sets an alternate configuration directory ๐ŸŒˆ
  • -k โ€” keeps the temporary directory used to make the image ๐Ÿซง
  • -l compresslevel โ€” overrides the COMPRESSLEVEL setting in initramfs.conf ๐Ÿ’œ
  • -m modules โ€” overrides the MODULES setting in initramfs.conf ๐ŸŽถ
  • -o outfile โ€” writes the image to outfile ๐Ÿ’Œ
  • -r root โ€” overrides the ROOT setting in initramfs.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. See initramfs.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 in modules(5) ๐ŸŽ€
  • /etc/initramfs-tools/conf.d โ€” this directory lets you hardcode bootargs at initramfs build time via config snippets. That means you can set ROOT or RESUME! 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 ๐Ÿ’œโœจ