Index: stand/efi/boot1/boot1.c =================================================================== --- stand/efi/boot1/boot1.c +++ stand/efi/boot1/boot1.c @@ -37,6 +37,11 @@ static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); +/* Bogus; we have none loaded, but this satisfies libefi. */ +struct devsw *devsw[] = { + NULL +}; + const boot_module_t *boot_modules[] = { #ifdef EFI_ZFS_BOOT Index: stand/efi/include/efilib.h =================================================================== --- stand/efi/include/efilib.h +++ stand/efi/include/efilib.h @@ -113,6 +113,8 @@ EFI_STATUS main(int argc, CHAR16 *argv[]); void efi_exit(EFI_STATUS status) __dead2; +void efi_reboot(void); + /* EFI environment initialization. */ void efi_init_environment(void); Index: stand/efi/libefi/libefi.c =================================================================== --- stand/efi/libefi/libefi.c +++ stand/efi/libefi/libefi.c @@ -57,3 +57,15 @@ return (BS->OpenProtocol(handle, protocol, interface, IH, NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL)); } + +void +efi_reboot(void) +{ + int i; + + for (i = 0; devsw[i] != NULL; ++i) + if (devsw[i]->dv_cleanup != NULL) + (devsw[i]->dv_cleanup)(); + + RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); +} Index: stand/efi/loader/main.c =================================================================== --- stand/efi/loader/main.c +++ stand/efi/loader/main.c @@ -1226,13 +1226,8 @@ static int command_reboot(int argc, char *argv[]) { - int i; - - for (i = 0; devsw[i] != NULL; ++i) - if (devsw[i]->dv_cleanup != NULL) - (devsw[i]->dv_cleanup)(); - RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); + efi_reboot(); /* NOTREACHED */ return (CMD_ERROR);