CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2022/09/07 04:21:03

Modified files:
        usr.sbin/installboot: efi_installboot.c 

Log message:
Fix passing explicit stage files

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).

Reply via email to