From 090dc14ea16d6eb655bc1440f0ba87c3773e445a Mon Sep 17 00:00:00 2001 From: kn Date: Fri, 6 Oct 2023 09:34:19 +0000 Subject: [PATCH] clean up old 6.7 softraid migration code ofwboot still passes an old/small .openbsd.bootdata size from before 6.7 when boothowto was added. Report the exact size from now on such that a future diff can rectify the corresponding check in autoconf.c:bootstrap(). All this was done to keep old/new bootloaders working with new/old kernels, but 6.7 is long gone and we should all be running current code. OK stsp --- sys/arch/sparc64/stand/ofwboot/elf64_exec.c | 12 +++--------- sys/arch/sparc64/stand/ofwboot/vers.c | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c index 0b57c98dfa3..eba60994465 100644 --- a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c +++ b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf64_exec.c,v 1.16 2023/06/03 21:37:53 krw Exp $ */ +/* $OpenBSD: elf64_exec.c,v 1.17 2023/10/06 09:34:19 kn Exp $ */ /* $NetBSD: elfXX_exec.c,v 1.2 2001/08/15 20:08:15 eeh Exp $ */ /* @@ -106,15 +106,9 @@ elf64_exec(int fd, Elf_Ehdr *elf, u_int64_t *entryp, void **ssymp, void **esymp) if (phdr.p_filesz < BOOTDATA_LEN_SOFTRAID) continue; - /* - * Kernels up to and including OpenBSD 6.7 - * check for an exact match if the length. - * Lie here to make sure we can still boot - * older kernels with softraid. - */ obd = (struct openbsd_bootdata *)(long)phdr.p_paddr; obd->version = BOOTDATA_VERSION; - obd->len = BOOTDATA_LEN_SOFTRAID; + obd->len = sizeof(struct openbsd_bootdata); #ifdef SOFTRAID /* @@ -134,7 +128,7 @@ elf64_exec(int fd, Elf_Ehdr *elf, u_int64_t *entryp, void **ssymp, void **esymp) #endif - if (phdr.p_filesz < BOOTDATA_LEN_BOOTHOWTO) + if (phdr.p_filesz < sizeof(struct openbsd_bootdata)) continue; obd->boothowto = boothowto; diff --git a/sys/arch/sparc64/stand/ofwboot/vers.c b/sys/arch/sparc64/stand/ofwboot/vers.c index a94dcf18489..fa4762b2541 100644 --- a/sys/arch/sparc64/stand/ofwboot/vers.c +++ b/sys/arch/sparc64/stand/ofwboot/vers.c @@ -1 +1 @@ -const char version[] = "1.25"; +const char version[] = "1.26"; -- 2.20.1