diff options
| author | Michael Brown | 2013-06-05 15:01:40 +0200 |
|---|---|---|
| committer | Michael Brown | 2013-06-05 15:11:43 +0200 |
| commit | c825a9b39dddcdc8e403435f9984ef8be11967bc (patch) | |
| tree | 999d31291a0b16b4035e4f930b0c9d7709997ef1 /src/arch/i386/include | |
| parent | [crypto] Accept OCSP responses containing multiple certificates (diff) | |
| download | ipxe-c825a9b39dddcdc8e403435f9984ef8be11967bc.tar.gz ipxe-c825a9b39dddcdc8e403435f9984ef8be11967bc.tar.xz ipxe-c825a9b39dddcdc8e403435f9984ef8be11967bc.zip | |
[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>
Diffstat (limited to 'src/arch/i386/include')
| -rw-r--r-- | src/arch/i386/include/initrd.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/i386/include/initrd.h b/src/arch/i386/include/initrd.h index c25d0924b..a5659f43c 100644 --- a/src/arch/i386/include/initrd.h +++ b/src/arch/i386/include/initrd.h @@ -13,9 +13,10 @@ FILE_LICENCE ( GPL2_OR_LATER ); /** Minimum alignment for initrds * - * Chosen to maximise memcpy() speeds + * Some versions of Linux complain about initrds that are not + * page-aligned. */ -#define INITRD_ALIGN 4 +#define INITRD_ALIGN 4096 /** Minimum free space required to reshuffle initrds * |
