diff options
author | Warner Losh <imp@FreeBSD.org> | 2018-03-16 18:12:50 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2018-03-16 18:12:50 +0000 |
commit | 1ce0264e67677bd38f3badf61ff2600bb1192763 (patch) | |
tree | aaf4c7bc65b1d58c761dcd5dfe29086573d8710c /stand/efi/boot1/boot1.c | |
parent | bf22ec69efaffe71541cd26095aa3d02e44d6a5c (diff) | |
download | src-1ce0264e67677bd38f3badf61ff2600bb1192763.tar.gz src-1ce0264e67677bd38f3badf61ff2600bb1192763.zip |
Only print boot order / boot current if we can get the variables from
the loader. Some UEFI implementations don't return all of them.
Sponsored by: Netflix
Notes
Notes:
svn path=/head/; revision=331067
Diffstat (limited to 'stand/efi/boot1/boot1.c')
-rw-r--r-- | stand/efi/boot1/boot1.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c index 471795bbbd19..112ca5439522 100644 --- a/stand/efi/boot1/boot1.c +++ b/stand/efi/boot1/boot1.c @@ -467,16 +467,18 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) 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"); + if (efi_global_getenv("BootCurrent", &boot_current, &sz) == EFI_SUCCESS) { + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + if (efi_global_getenv("BootOrder", &boot_order, &sz) == EFI_SUCCESS) { + 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"); + } + } #ifdef TEST_FAILURE /* |