How to extract the cpio archive in the kernel image?

Michael Opdenacker
2006-05-31T21:16:41Z

Hello,

Does anyone know a simple, command line way to extract the cpio archive
embedded in a (compressed) kernel image?

That would be useful to modify the initramfs included in the kernel
image even if one only has the kernel binary and sources, but not the
initramfs sources.

Of course, it is always possible to get the initramfs contents from the
running kernel and dump them somewhere, or to write a custom program for
this purpose (accessing and uncompressing the embedded cpio archive as
the kernel does), but it would be nice it there was a simpler way with
regular Unix commands (I guess involving gunzip and cpio).

In a nutshell, how to open the penguin and still get the golden egg? ;-)

Cheers,

Michael.

--
Michael Opdenacker, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1000 pages!)