summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-05-07 10:40:17 +0000
committerkettenis <kettenis@openbsd.org>2017-05-07 10:40:17 +0000
commitfb93a1f72c9fa7b6197ae803605bdf67058a9137 (patch)
tree7265a34263c35e704088f68eba7437ef8e2a7ced /usr.sbin/installboot
parentChange test from [] to [[]] and simplify pattern. (diff)
downloadwireguard-openbsd-fb93a1f72c9fa7b6197ae803605bdf67058a9137.tar.xz
wireguard-openbsd-fb93a1f72c9fa7b6197ae803605bdf67058a9137.zip
Add arm64 support.
ok tom@
Diffstat (limited to 'usr.sbin/installboot')
-rw-r--r--usr.sbin/installboot/Makefile4
-rw-r--r--usr.sbin/installboot/armv7_installboot.c19
2 files changed, 20 insertions, 3 deletions
diff --git a/usr.sbin/installboot/Makefile b/usr.sbin/installboot/Makefile
index 1362c36c36f..a88d84e8b4e 100644
--- a/usr.sbin/installboot/Makefile
+++ b/usr.sbin/installboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.19 2016/08/14 13:47:52 krw Exp $
+# $OpenBSD: Makefile,v 1.20 2017/05/07 10:40:17 kettenis Exp $
PROG= installboot
SRCS= installboot.c util.c
@@ -15,7 +15,7 @@ CFLAGS += -DSOFTRAID
SRCS += i386_installboot.c
SRCS += i386_nlist.c
SRCS += i386_softraid.c
-.elif ${MACHINE} == "armv7"
+.elif ${MACHINE} == "armv7" || ${MACHINE} == "arm64"
SRCS += armv7_installboot.c
.elif ${MACHINE} == "hppa"
CFLAGS += -DBOOTSTRAP
diff --git a/usr.sbin/installboot/armv7_installboot.c b/usr.sbin/installboot/armv7_installboot.c
index 17fa948b90b..7242fbf00db 100644
--- a/usr.sbin/installboot/armv7_installboot.c
+++ b/usr.sbin/installboot/armv7_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_installboot.c,v 1.2 2016/06/02 06:21:10 jsg Exp $ */
+/* $OpenBSD: armv7_installboot.c,v 1.3 2017/05/07 10:40:17 kettenis Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -182,6 +182,22 @@ write_efisystem(struct disklabel *dl, char part)
goto umount;
}
+#ifdef __aarch64__
+ /*
+ * Copy BOOTAA64.EFI to /efi/boot/bootaa64.efi.
+ */
+ pathlen = strlen(dst);
+ if (strlcat(dst, "/bootaa64.efi", sizeof(dst)) >= sizeof(dst)) {
+ rslt = -1;
+ warn("unable to build /bootaa64.efi path");
+ goto umount;
+ }
+ src = fileprefix(root, "/usr/mdec/BOOTAA64.EFI");
+ if (src == NULL) {
+ rslt = -1;
+ goto umount;
+ }
+#else
/*
* Copy BOOTARM.EFI to /efi/boot/bootarm.efi.
*/
@@ -196,6 +212,7 @@ write_efisystem(struct disklabel *dl, char part)
rslt = -1;
goto umount;
}
+#endif
srclen = strlen(src);
if (verbose)
fprintf(stderr, "%s %s to %s\n",