# mkinitramfs(8) - man - phpman

[MKINITRAMFS(8)](https://www.chedong.com/phpMan.php/man/MKINITRAMFS/8/markdown)                          System Administration                         [MKINITRAMFS(8)](https://www.chedong.com/phpMan.php/man/MKINITRAMFS/8/markdown)



## NAME
       mkinitramfs - low-level tool for generating an initramfs image


## SYNOPSIS
       **mkinitramfs** [_option_]...  **-o** _outfile_ [_version_]
### mkinitramfs -h


## DESCRIPTION
       The  **mkinitramfs** script generates an initramfs image.  The initramfs is a compressed cpio ar‐
       chive. The archive can be used on a different box of the same  arch  with  the  corresponding
       Linux  kernel.   **mkinitramfs**  is meant for advanced usage. On your local box **update-initramfs**
       calls **mkinitramfs** with the relevant parameters.  **update-initramfs** keeps sha1sum of  generated
       initramfs. It takes care to generate backups and eventually runs the bootloader.

       At  boot  time,  the kernel unpacks that archive into RAM disk, mounts and uses it as initial
       root file system. All finding of the root device happens in this early userspace.


## OPTIONS
### -c
              Override the **COMPRESS** setting in _initramfs.conf_.


### -d
              Set an alternate configuration directory.


### -k


### -o
              Write the image to _outfile_.


### -r
              Override the **ROOT** setting in _initramfs.conf_.


### -v


       _version_
              Set the kernel version of the initramfs image (defaults to the running kernel).


### -h --help
              Display usage information and exit.


## ENVIRONMENT
       **mkinitramfs** honours the **TMPDIR** environment variable. If set, it uses  subdirectories  in  the
       given directory to create its temporary working directories. Else it uses _/var/tmp_ as default
       value for that purpose. The given directory should be on a filesystem which allows the execu‐
       tion of files stored there, i.e.  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)](https://www.chedong.com/phpMan.php/man/initramfs.conf/5/markdown) for a description
              of the available configuration parameter.


       _/etc/initramfs-tools/modules_
              Specified modules will be put in the generated image and loaded when the system boots.
              The  format  - one per line - is identical to that of _/etc/modules,_ which is described
              in [**modules**(5)](https://www.chedong.com/phpMan.php/man/modules/5/markdown).


       _/etc/initramfs-tools/conf.d_
              The conf.d directory allows one to hardcode bootargs at initramfs build time via  con‐
              fig  snippets.  This  allows one to set ROOT or RESUME.  This is especially useful for
              bootloaders, which do not pass an root bootarg.


       _/etc/initramfs-tools/DSDT.aml_
              If this file exists, it will be appended to the initramfs in a way that causes  it  to
              be loaded by ACPI.


## EXAMPLES
       Create an initramfs for current running kernel:


### mkinitramfs -o ~/tmp/initramfs-$(uname -r)

       Create an initramfs for specific kernel and keep builddirs:


### mkinitramfs -k -o ~/tmp/initramfs-2.6.21-686 2.6.21-686

       Debug initramfs creation (check out 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 <jbai‐
       <ley@raspberryginger.com>> and numerous others.


## SEE ALSO
          [_initramfs.conf_(5)](https://www.chedong.com/phpMan.php/man/initramfs.conf/5/markdown),   [_initramfs-tools_(7)](https://www.chedong.com/phpMan.php/man/initramfs-tools/7/markdown),    [_update-initramfs_(8)](https://www.chedong.com/phpMan.php/man/update-initramfs/8/markdown),    [_lsinitramfs_(8)](https://www.chedong.com/phpMan.php/man/lsinitramfs/8/markdown),    _un__‐
       [_mkinitramfs_(8)](https://www.chedong.com/phpMan.php/man/mkinitramfs/8/markdown).



initramfs-tools                              2018/07/18                               [MKINITRAMFS(8)](https://www.chedong.com/phpMan.php/man/MKINITRAMFS/8/markdown)
