Re: Initramfs from existing vmlinuz

From: Willy Tarreau
Date: Mon Jan 05 2009 - 06:47:52 EST


On Mon, Jan 05, 2009 at 11:12:26AM +0000, Ian Campbell wrote:
> On Wed, 2008-12-24 at 00:34 +0100, Willy Tarreau wrote:
> > You first have to extract and uncompress the ELF image from vmlinuz.
> > For this, look for the gzip signature 1F 8B 08 in your vmlinuz, and
> > feed all data starting from this point to zcat.
>
> Since v2.6.26 (I think, it was v2.08 of the x86 bzImage format anyhow,
> which was the same point the payload became ELF formatted) you can find
> it directly using the payload_offset and payload_length fields in the
> bzImage header. Attached bzexplode.c demonstrates this. e.g. "bzexplode
> vmlinuz | zcat > vmlinux.elf"

Thanks Ian.

Indeed, I'm sure this will be useful from time to time!

Cheers,
Willy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/