dh_installinitramfs - Linux


Overview

dh_installinitramfs prepares a Debian package for inclusion in an initramfs, typically used during system boot and repair. It intercepts package installation, extracts essential files, and places them within the initramfs image.

Syntax

dh_installinitramfs [--add=<package>] [--[no-]early] [--[no-]whole-package]

Options/Flags

  • –add=: Specify a specific package to be included in the initramfs.
  • –early: Mark the package as necessary for early boot.
  • –no-early: Undo the marking for early boot.
  • –whole-package: Include all package files in the initramfs (not recommended for large packages).
  • –no-whole-package: Exclude all package files from the initramfs (default).

Examples

Include a specific package for early boot:

dh_installinitramfs --add=linux-image-amd64 --early

Exclude a package from the initramfs:

dh_installinitramfs --no-whole-package

Common Issues

  • Missing Files: Ensure that the package contains the necessary files for initramfs.
  • Dependency Conflicts: Packages with conflicting dependencies may result in errors.

Integration

dh_installinitramfs can be integrated with the Debian package build process using the debian/rules file:

override_dh_installinitramfs:
        dh_installinitramfs --add=linux-image-amd64

Related Commands

  • dh_installkernel
  • dh_installdeb