Diff below makes installboot(8) work on arm64.  It reuses the armv7
code just like amd64 reuses the i386 code.

ok?


Index: usr.sbin/installboot/Makefile
===================================================================
RCS file: /cvs/src/usr.sbin/installboot/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- usr.sbin/installboot/Makefile       14 Aug 2016 13:47:52 -0000      1.19
+++ usr.sbin/installboot/Makefile       6 May 2017 20:31:22 -0000
@@ -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
Index: usr.sbin/installboot/armv7_installboot.c
===================================================================
RCS file: /cvs/src/usr.sbin/installboot/armv7_installboot.c,v
retrieving revision 1.2
diff -u -p -r1.2 armv7_installboot.c
--- usr.sbin/installboot/armv7_installboot.c    2 Jun 2016 06:21:10 -0000       
1.2
+++ usr.sbin/installboot/armv7_installboot.c    6 May 2017 20:31:22 -0000
@@ -182,6 +182,22 @@ write_efisystem(struct disklabel *dl, ch
                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, ch
                rslt = -1;
                goto umount;
        }
+#endif
        srclen = strlen(src);
        if (verbose)
                fprintf(stderr, "%s %s to %s\n",

Reply via email to