diff options
author | 2014-10-26 10:42:59 +0000 | |
---|---|---|
committer | 2014-10-26 10:42:59 +0000 | |
commit | 1c862eaf9f7b1cb2f4a10eee65a07cca756a3a0b (patch) | |
tree | 23c09d1e5b094456d1914bd529065c141c288c37 | |
parent | Read the section header string table in the boot blocks' memory, not in the (diff) | |
download | wireguard-openbsd-1c862eaf9f7b1cb2f4a10eee65a07cca756a3a0b.tar.xz wireguard-openbsd-1c862eaf9f7b1cb2f4a10eee65a07cca756a3a0b.zip |
Append 512 bytes of zero to the kernel image intended to be put into lif.fs,
so that valid bytes exist at the end of the kernel image.
Since the lif image stores files size in 256-byte unit, we can not report EOF
while reading the kernel image until the remainder of the 256-byte sector has
been read. But these zero bytes would cause the gzip readahead machinery in
libsa to believe the kernel is followed by an uncompressed file, and switch to
transparent mode, preventing backwards seeks into the kernel image from working.
This fixes the ``read section header string table failed(0)'' errors when
attempting to boot lif.fs since loadfile_elf.c 1.9.
-rw-r--r-- | distrib/hppa/ramdisk/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/distrib/hppa/ramdisk/Makefile b/distrib/hppa/ramdisk/Makefile index b0060eab9c0..1a8de8262b1 100644 --- a/distrib/hppa/ramdisk/Makefile +++ b/distrib/hppa/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.27 2013/10/23 03:43:27 deraadt Exp $ +# $OpenBSD: Makefile,v 1.28 2014/10/26 10:42:59 miod Exp $ CBIN= instbin ARCHDIR= ${.CURDIR}/.. @@ -70,7 +70,7 @@ bsd.rd: obsd ${IMAGE} rdsetroot @${STRIP} bsd.rd bsd: bsd.rd - ${GZIPCMD} ${GZIPFLAGS} < bsd.rd > bsd + (cat bsd.rd ; dd if=/dev/zero count=1) | ${GZIPCMD} ${GZIPFLAGS} > bsd rdsetroot: ${.CURDIR}/../../common/elfrdsetroot.c \ ${.CURDIR}/../../common/elf32.c ${.CURDIR}/../../common/elf64.c |