]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[bzimage] Align initrd images to page boundary
authorMichael Brown <mcb30@ipxe.org>
Wed, 5 Jun 2013 13:01:40 +0000 (14:01 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 5 Jun 2013 13:11:43 +0000 (14:11 +0100)
commitc825a9b39dddcdc8e403435f9984ef8be11967bc
tree999d31291a0b16b4035e4f930b0c9d7709997ef1
parent0036fdd5c5a232662d07c6d1310241f4c5b6ab83
[bzimage] Align initrd images to page boundary

Some versions of Linux apparently complain if initrds are not aligned
to a page boundary.  Fix by changing INITRD_ALIGN from 4 bytes to 4096
bytes.

The amount of padding at the end of each initrd will now often be
sufficient to allow the cpio header to be prepended without crossing
an alignment boundary.  The final location of the initrd may therefore
end up being slightly higher than the post-shuffle location.
bzimage_load_initrd() must therefore now copy the initrd body prior to
copying the cpio header, otherwise the start of the initrd body may be
overwritten by the cpio header.  (Note that the guarantee that an
initrd will never need to overwrite an initrd at a higher location
still holds, since the overall length of each initrd cannot decrease
as a result of adding a cpio header.)

Reported-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/image/bzimage.c
src/arch/i386/include/initrd.h