Skip to contentSkip to conversation

How to extract the cpio archive in the kernel image?

DISCUSSION Michael Opdenacker 1 participant 1 message May 31, 2006

lore
Share & tools
lore
#0 lore raw

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.

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