From: kn Date: Wed, 24 Aug 2022 21:08:51 +0000 (+0000) Subject: Forgotten to commit as part of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=55a219b1c01f97b1ad481d058b39aebbf248822f;p=openbsd Forgotten to commit as part of ---------------------------- /usr/src/usr.sbin/installboot/Makefile revision 1.25 date: 2022/08/15 17:06:43; author: kn; state: Exp; lines: +5 -1; commitid: 36Ayh2RViNOotnQJ; Add initial piece for softraid(4) support on arm64 arm64 is the only currently supported OpenBSD platform which both a) supports booting off root on softraid(4) (kernel and bootloader) and b) is an EFI platform (as far as installboot(8) is concerned). Currently, installboot treats softraid root volumes as regular devices, ignoring ignores chunk devices completely. Teach installboot the first bits of softraid support for EFI: installing the single-stage boot loader on chunks rather than the volume. Copy over sparc64's softraid stage-1 code as-is and make its stage-2 a NOOP: # ./obj/installboot -v sd4 Using / as root installing bootstrap on /dev/rsd4c using first-stage /usr/mdec/BOOTAA64.EFI sd4: softraid volume with 1 disk(s) sd0a: installing boot blocks on /dev/rsd0c copying /usr/mdec/BOOTAA64.EFI to /tmp/installboot.KuBD4zkfpM/efi/boot/bootaa64.efi writing /tmp/installboot.KuBD4zkfpM/efi/boot/startup.nsh arm64 miniroot fits and boots with this. OK stsp As of now, EFI partitions must still be created manually as installboot's '-p' does not support softraid at all (next missing piece for root on softraid on arm64 installations to work out-of-the-box). ---------------------------- Reminded by miod, thanks --- diff --git a/distrib/special/installboot/Makefile b/distrib/special/installboot/Makefile index 4ab1041b759..cfc4d7bdefd 100644 --- a/distrib/special/installboot/Makefile +++ b/distrib/special/installboot/Makefile @@ -1,10 +1,9 @@ -# $OpenBSD: Makefile,v 1.16 2022/02/03 10:27:33 visa Exp $ +# $OpenBSD: Makefile,v 1.17 2022/08/24 21:08:51 kn Exp $ .PATH: ${.CURDIR}/../../../usr.sbin/installboot PROG= installboot SRCS= installboot.c util.c -MAN= installboot.8 CPPFLAGS= -I${.CURDIR}/../../../usr.sbin/installboot LDADD= -lutil @@ -16,6 +15,10 @@ SRCS += i386_installboot.c SRCS += i386_nlist.c SRCS += i386_softraid.c .elif ${MACHINE} == "armv7" || ${MACHINE} == "arm64" || ${MACHINE} == "riscv64" +. if ${MACHINE} == "arm64" +CFLAGS += -DSOFTRAID +SRCS += efi_softraid.c +. endif SRCS += efi_installboot.c .elif ${MACHINE} == "hppa" CFLAGS += -DBOOTSTRAP