-# $OpenBSD: Makefile,v 1.22 2020/07/17 08:03:56 kettenis Exp $
+# $OpenBSD: Makefile,v 1.23 2021/06/27 04:52:01 jsg Exp $
PROG= installboot
SRCS= installboot.c util.c
SRCS += i386_installboot.c
SRCS += i386_nlist.c
SRCS += i386_softraid.c
-.elif ${MACHINE} == "armv7" || ${MACHINE} == "arm64"
+.elif ${MACHINE} == "armv7" || ${MACHINE} == "arm64" || ${MACHINE} == "riscv64"
SRCS += armv7_installboot.c
.elif ${MACHINE} == "hppa"
CFLAGS += -DBOOTSTRAP
-/* $OpenBSD: armv7_installboot.c,v 1.9 2021/06/03 13:14:03 deraadt Exp $ */
+/* $OpenBSD: armv7_installboot.c,v 1.10 2021/06/27 04:52:01 jsg Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
rslt = -1;
goto umount;
}
-#else
+#elif defined(__arm__)
/*
* Copy BOOTARM.EFI to /efi/boot/bootarm.efi.
*/
rslt = -1;
goto umount;
}
+#elif defined(__riscv)
+ /*
+ * Copy BOOTRISCV64.EFI to /efi/boot/bootriscv64.efi.
+ */
+ pathlen = strlen(dst);
+ if (strlcat(dst, "/bootriscv64.efi", sizeof(dst)) >= sizeof(dst)) {
+ rslt = -1;
+ warn("unable to build /bootriscv64.efi path");
+ goto umount;
+ }
+ src = fileprefix(root, "/usr/mdec/BOOTRISCV64.EFI");
+ if (src == NULL) {
+ rslt = -1;
+ goto umount;
+ }
#endif
srclen = strlen(src);
if (verbose)