Bug 202614 - [EFI] boot/loader.efi: Fix and improve the 'nvram' command
Summary: [EFI] boot/loader.efi: Fix and improve the 'nvram' command
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Warner Losh
Keywords: patch, uefi
Depends on:
Blocks: 203349
  Show dependency treegraph
Reported: 2015-08-24 08:40 UTC by Ganael LAPLANCHE
Modified: 2017-06-23 05:16 UTC (History)
7 users (show)

See Also:

patch-sys-boot-efi-loader-main.c (3.46 KB, text/x-csrc)
2015-08-24 08:40 UTC, Ganael LAPLANCHE
no flags Details
patch-sys-boot-efi-loader-main.c (3.43 KB, patch)
2016-03-11 09:10 UTC, Ganael LAPLANCHE
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ganael LAPLANCHE 2015-08-24 08:40:08 UTC
Created attachment 160296 [details]


The embedded 'nvram' command of loader.efi (-CURRENT, r286279) fails to list EFI variables with the following message :

??=<error retrieving variable>

Find attached a patch that brings the following :

- Fix variables enumeration (to initiate the search, the 'VariableName' argument of GetNextVariableName() should be a pointer to NULL, not a NULL pointer [1])
- Add a '-v' (verbose) option to display variables' contents (now hidden by default, as the output is un-readable with too many variables)
- Add the ability to specify a variable name to restrict display to variable(s) matching this name only
- Print GUID along with each variable name
- Simplify contents' rendering by *always* printing them in hex (most of the contents were un-readable in ascii)

Best Regards,

[1] UEFI Specification Version v2.5, p239: http://www.uefi.org/sites/default/files/resources/UEFI%202_5.pdf
Comment 1 Ganael LAPLANCHE 2016-03-11 09:10:50 UTC
Created attachment 167999 [details]

Updated patch for r296648
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2017-06-22 20:31:12 UTC
Canonicalize assignment.
Comment 3 Warner Losh freebsd_committer 2017-06-22 22:26:26 UTC
Is this still needed after my efi work?
Comment 4 Ganael LAPLANCHE freebsd_committer 2017-06-23 05:16:01 UTC
Hi Warner,

No, I think that PR can be closed.