Index: usr.sbin/efivar/efiutil.c =================================================================== --- usr.sbin/efivar/efiutil.c +++ usr.sbin/efivar/efiutil.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2019 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -120,6 +120,7 @@ void efi_print_load_option(uint8_t *data, size_t datalen, int Aflag, int bflag, int uflag) { + char *dev, *relpath, *abspath; uint8_t *ep = data + datalen; uint8_t *walker = data; uint32_t attr; @@ -131,6 +132,7 @@ int len; void *opt; int optlen; + int rv; if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) return; @@ -162,8 +164,15 @@ free(str); while (dp < edp && SIZE(dp, edp) > sizeof(efidp_header)) { efidp_format_device_path(buf, sizeof(buf), dp, SIZE(dp, edp)); + rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); dp = (efidp)((char *)dp + efidp_size(dp)); printf(" %s\n", buf); + if (rv == 0) { + printf(" %*s:%s\n", len + (int)strlen(dev), dev, relpath); + free(dev); + free(relpath); + free(abspath); + } } if (optlen == 0) return; Index: usr.sbin/efivar/efivar.8 =================================================================== --- usr.sbin/efivar/efivar.8 +++ usr.sbin/efivar/efivar.8 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2017 Netflix, Inc. +.\" Copyright (c) 2017-2019 Netflix, Inc. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 22, 2017 +.Dd February 19, 2019 .Dt EFIVAR 8 .Os .Sh NAME @@ -46,6 +46,7 @@ .Op Fl -hex .Op Fl -list-guids .Op Fl -list +.Op Fl -load-option .Op Fl -name Ar name .Op Fl -no-name .Op Fl -print @@ -147,6 +148,8 @@ If the .Fl -print flag is also listed, their values will be displayed. +.It Fl -load-option +Print information about the specified boot option. .It Fl N Fl -no-name Do not display the variable name. .It Fl p Fl -print