initramfs-tools/unmkinitramfs.8
Ben Hutchings a797b423d2 unmkinitramfs: Rewrite in C to make it acceptably fast
Parsing uncompressed cpio archives in this shell script requires
running multiple processes for each archive member.

This was not too bad when there were usually only a few microcode
blobs in an uncompressed archive, but now that we put compressed
kernel modules in an uncompressed archive, it became very slow indeed.

Rewrite it in C so that it's acceptably fast.

This should have no functional changes, except that it adds support
for an initramfs with no compressed part.

Fixes: 81fd41f72dd8 ("Put compressed kernel modules and firmware in an uncompressed cpio")
Signed-off-by: Ben Hutchings <benh@debian.org>
2025-04-22 02:37:00 +02:00

67 lines
1.6 KiB
Groff

.TH UNMKINITRAMFS 8 "2025/03/20" "initramfs\-tools" "System Administration"
.SH NAME
unmkinitramfs \- extract content from an initramfs image
.SH SYNOPSIS
.B unmkinitramfs
.RB [ -v ]
.IR initramfs-file " " directory
.br
.BR unmkinitramfs " " -h
.SH DESCRIPTION
The
.B unmkinitramfs
command extracts the content of a given initramfs image using
.B cpio
and the appropriate decompressor command.
The initramfs image may be a single compressed cpio archive, or the
concatenation of any number of uncompressed cpio archives optionally
followed by a compressed cpio archive.
When the initramfs image includes one or more "early initramfs"
archives, that is uncompressed archives with microcode or other files
that the kernel uses directly, these are extracted to sub\-directories
named "\fBearly\fR", "\fBearly2\fR", etc., and the other archives are
extracted to a sub\-directory named "\fBmain\fR".
In a future version of initramfs\-tools this behaviour may change so
that all archives are extracted directly into the given directory.
.SH OPTIONS
.TP
.B -h
Display usage information and exit.
.TP
.B -v
Display verbose messages about extraction.
.SH USAGE EXAMPLES
Extract initramfs content of current running kernel:
.PP
.B unmkinitramfs /boot/initrd.img-$(uname -r) initramfs/
.SH BUGS
.BR unmkinitramfs
does not support initramfs images with more than one compressed cpio
archive.
.SH AUTHOR
The initramfs-tools are written by Maximilian Attems <maks@debian.org>
and numerous others.
.SH SEE ALSO
.BR
.IR initramfs-tools (7),
.IR lsinitramfs (8),
.IR mkinitramfs (8),
.IR update-initramfs (8).