Every platform ought to set `stages', `stage1' and optionally `stage2'
in md_init(), otherwise passing explicit files results won't work as
`stages' is zero-initialised and no default path is set:
# installboot -v sd0 /root/BOOTAA64.EFI
usage: installboot [-npv] [-r root] disk [stage1]
This is correct synopsis and ought to work, but efi_installboot.c has an
empty md_init(). Set stage bits to fix this:
# ./obj/installboot -nv sd0 /root/BOOTAA64.EFI
Using / as root
would install bootstrap on /dev/rsd0c
using first-stage /root/BOOTAA64.EFI
would copy /root/BOOTAA64.EFI to /tmp/installboot.2bGhLGT1eF/efi/boot/bootaa64.efi
would write /tmp/installboot.2bGhLGT1eF/efi/boot/startup.nsh
This makes regress/usr.sbin/installboot pass on armv7, arm64 and riscv64
(while being lucky or carrying miod's fix for the kernel disklabel race
manifesting on vnd).
-/* $OpenBSD: efi_installboot.c,v 1.3 2022/08/31 20:52:15 krw Exp $ */
+/* $OpenBSD: efi_installboot.c,v 1.4 2022/09/07 10:21:03 kn Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
void
md_init(void)
{
+ stages = 1;
+ stage1 = "/usr/mdec/" BOOTEFI_SRC;
}
void