]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[bzimage] Report exact initrd length via bzImage header
authorMichael Brown <mcb30@ipxe.org>
Tue, 4 Mar 2014 14:30:45 +0000 (14:30 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 4 Mar 2014 14:38:16 +0000 (14:38 +0000)
commit0fac05511967e791bff56996227047ade16a8533
treef713a294af080711b4b27c81dc19bc06f7aa2f62
parente191298a1d62446646922b1f3d899dfb16da73ff
[bzimage] Report exact initrd length via bzImage header

iPXE currently pads initrd images to a multiple of 4kB and inserts
zero padding between images, as required by some versions of the Linux
kernel.  The overall length reported via the ramdisk_size field in the
bzImage header includes this zero padding.

This causes problems when using memdisk to load a gzip-compressed disk
image.  memdisk treats the ramdisk_size field as containing the exact
length of the initrd image, and uses this length to locate the 8-byte
gzip footer.  This will generally cause memdisk to fail to decompress
the disk image.

Fix by reporting the exact length of the initrd image set, including
any padding inserted between images but excluding any padding added at
the end of the final image.

Reported-by: Levente LEVAI <levail@aviatronic.hu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/image/bzimage.c