Print the load and device path as well as BootCurrent and BootOrder

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2018-03-12 21:40:24 +00:00
parent c25acd4518
commit ac15bcde8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330815

View File

@ -312,6 +312,12 @@ main(int argc, CHAR16 *argv[])
int i, j, vargood, howto;
UINTN k;
int has_kbd;
CHAR16 *text;
UINT16 boot_current;
size_t sz;
UINT16 boot_order[100];
EFI_DEVICE_PATH *imgpath;
EFI_STATUS status;
#if !defined(__arm__)
char buf[40];
#endif
@ -473,6 +479,36 @@ main(int argc, CHAR16 *argv[])
printf("\n%s", bootprog_info);
text = efi_devpath_name(img->FilePath);
if (text != NULL) {
printf(" Load Path: %S\n", text);
efi_setenv_freebsd_wcs("LoaderPath", text);
efi_free_devpath_name(text);
}
status = BS->HandleProtocol(img->DeviceHandle, &devid, (void **)&imgpath);
if (status == EFI_SUCCESS) {
text = efi_devpath_name(imgpath);
if (text != NULL) {
printf(" Load Device: %S\n", text);
efi_setenv_freebsd_wcs("LoaderDev", text);
efi_free_devpath_name(text);
}
}
boot_current = 0;
sz = sizeof(boot_current);
efi_global_getenv("BootCurrent", &boot_current, &sz);
printf(" BootCurrent: %04x\n", boot_current);
sz = sizeof(boot_order);
efi_global_getenv("BootOrder", &boot_order, &sz);
printf(" BootOrder:");
for (i = 0; i < sz / sizeof(boot_order[0]); i++)
printf(" %04x%s", boot_order[i],
boot_order[i] == boot_current ? "[*]" : "");
printf("\n");
/*
* Disable the watchdog timer. By default the boot manager sets
* the timer to 5 minutes before invoking a boot option. If we