Finish implementing -d/--device/--device-path flag to print variable
as if it were a device path. Remove language about a=b syntax on the command line. This will not be implemented due to its limited usefulness. UEFI variables are binary blobs, on the whole, and a simple work around exists for strings. Clarify that the new value of the variable is taken from stdin. Update manual with history. Sponsored by: Netflix
This commit is contained in:
parent
7270962aa5
commit
2f2f5c6728
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314927
@ -1,4 +1,4 @@
|
|||||||
.\" Copyright (c) 2003 Netflix, Inc
|
.\" Copyright (c) 2017 Netflix, Inc
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
@ -24,7 +24,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd September 29, 2016
|
.Dd March 4, 2017
|
||||||
.Dt EFIVAR 8
|
.Dt EFIVAR 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -40,6 +40,7 @@
|
|||||||
.Op Fl -attributes
|
.Op Fl -attributes
|
||||||
.Op Fl -binary
|
.Op Fl -binary
|
||||||
.Op Fl -delete
|
.Op Fl -delete
|
||||||
|
.Op Fl -device-path
|
||||||
.Op Fl -fromfile Ar file
|
.Op Fl -fromfile Ar file
|
||||||
.Op Fl -guid
|
.Op Fl -guid
|
||||||
.Op Fl -hex
|
.Op Fl -hex
|
||||||
@ -51,7 +52,6 @@
|
|||||||
.Op Fl -print-decimal
|
.Op Fl -print-decimal
|
||||||
.Op Fl -raw-guid
|
.Op Fl -raw-guid
|
||||||
.Op Fl -write
|
.Op Fl -write
|
||||||
.Ar name Ns Op = Ns Ar value
|
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
This program manages
|
This program manages
|
||||||
.Dq Unified Extensible Firmware Interface
|
.Dq Unified Extensible Firmware Interface
|
||||||
@ -117,6 +117,9 @@ flags.
|
|||||||
No
|
No
|
||||||
.Ar value
|
.Ar value
|
||||||
may be specified.
|
may be specified.
|
||||||
|
.It Fl d Fl -device Fl -device-path
|
||||||
|
Interpret the variables printed as UEFI device paths and print the
|
||||||
|
UEFI standard string representation.
|
||||||
.It Fl g Fl -guid
|
.It Fl g Fl -guid
|
||||||
flag is specified, guids are converted to names if they are known (and
|
flag is specified, guids are converted to names if they are known (and
|
||||||
show up in
|
show up in
|
||||||
@ -138,33 +141,45 @@ flag is also listed, their values will be displayed.
|
|||||||
Do not display the variable name.
|
Do not display the variable name.
|
||||||
.It Fl p Fl -print
|
.It Fl p Fl -print
|
||||||
Print the value of the variable.
|
Print the value of the variable.
|
||||||
.It Fl d Fl -print-decimal
|
|
||||||
Treat the value of the variable as a number and print it as a
|
|
||||||
decimal.
|
|
||||||
This is currently unimplemented.
|
|
||||||
.It Fl R Fl -raw-guid
|
.It Fl R Fl -raw-guid
|
||||||
Do not substitute well known names for GUID numeric values in output.
|
Do not substitute well known names for GUID numeric values in output.
|
||||||
.It Fl w Fl -write
|
.It Fl w Fl -write
|
||||||
Write (replace) the variable specified with the value specified.
|
Write (replace) the variable specified with the value specified from
|
||||||
|
standard input.
|
||||||
|
No command line option to do this is available since UEFI variables
|
||||||
|
are binary structures rather than strings.
|
||||||
|
.Xr echo 1
|
||||||
|
.Fl n
|
||||||
|
can be used to specify simple strings.
|
||||||
.It Ar name
|
.It Ar name
|
||||||
Display the
|
Display the
|
||||||
.Ar name
|
.Ar name
|
||||||
environment variable.
|
environment variable.
|
||||||
.It Ar name Ns = Ns Ar value
|
|
||||||
Set the specified
|
|
||||||
.Ar name
|
|
||||||
to
|
|
||||||
.Ar value .
|
|
||||||
This is not yet implemented.
|
|
||||||
If the
|
|
||||||
.Sh COMPATIBILITY
|
.Sh COMPATIBILITY
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
program is intended to be compatible (strict superset) with a progam
|
program is intended to be compatible (strict superset) with a progam
|
||||||
of the same name included in the Red Hat libefivar package.
|
of the same name included in the Red Hat libefivar package.
|
||||||
|
.Pp
|
||||||
|
Except the
|
||||||
|
.Fl d
|
||||||
|
and
|
||||||
|
.Fl -print-decimal
|
||||||
|
flags are not implmenented and never will be.
|
||||||
|
The
|
||||||
|
.Fl d
|
||||||
|
flag is a short-hand for
|
||||||
|
.Fl -device-path .
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
Appendix A of the UEFI specification has the format for GUIDs.
|
Appendix A of the UEFI specification has the format for GUIDs.
|
||||||
All GUIDs
|
All GUIDs
|
||||||
.Dq Globally Unique Identifiers
|
.Dq Globally Unique Identifiers
|
||||||
have the format described in RFC 4122.
|
have the format described in RFC 4122.
|
||||||
.El
|
.El
|
||||||
|
.Pp
|
||||||
|
.Xr efivar 8
|
||||||
|
.Sh HISTORY
|
||||||
|
The
|
||||||
|
.Nm
|
||||||
|
utility first appeared in
|
||||||
|
.Fx 12.0 .
|
||||||
|
@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <efivar.h>
|
#include <efivar.h>
|
||||||
|
#include <efivar-dp.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -201,8 +202,13 @@ bindump(uint8_t *data, size_t datalen)
|
|||||||
static void
|
static void
|
||||||
devpath_dump(uint8_t *data, size_t datalen)
|
devpath_dump(uint8_t *data, size_t datalen)
|
||||||
{
|
{
|
||||||
|
char buffer[1024];
|
||||||
|
|
||||||
fprintf(stderr, "junk %p %zu\n", data, datalen);
|
efidp_format_device_path(buffer, sizeof(buffer),
|
||||||
|
(const_efidp)data, datalen);
|
||||||
|
if (!Nflag)
|
||||||
|
printf(": ");
|
||||||
|
printf("%s\n", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user