Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Mar 2017 20:23:14 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314620 - head/usr.sbin/efivar
Message-ID:  <201703032023.v23KNEaj063296@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Mar  3 20:23:14 2017
New Revision: 314620
URL: https://svnweb.freebsd.org/changeset/base/314620

Log:
  Implement -d / --device-path to print the ascii representation of a variable that contains a UEFI device path.
  
  Sponsored by: Netflix

Modified:
  head/usr.sbin/efivar/efivar.c

Modified: head/usr.sbin/efivar/efivar.c
==============================================================================
--- head/usr.sbin/efivar/efivar.c	Fri Mar  3 20:23:10 2017	(r314619)
+++ head/usr.sbin/efivar/efivar.c	Fri Mar  3 20:23:14 2017	(r314620)
@@ -45,6 +45,8 @@ static struct option longopts[] = {
 	{ "attributes",		required_argument,	NULL,	't' },
 	{ "binary",		no_argument,		NULL,	'b' },
 	{ "delete",		no_argument,		NULL,   'D' },
+	{ "device",		no_argument,		NULL,   'd' },
+	{ "device-path",	no_argument,		NULL,   'd' },
 	{ "fromfile",		required_argument,	NULL,	'f' },
 	{ "guid",		no_argument,		NULL,	'g' },
 	{ "hex",		no_argument,		NULL,	'H' },
@@ -197,6 +199,13 @@ bindump(uint8_t *data, size_t datalen)
 }
 
 static void
+devpath_dump(uint8_t *data, size_t datalen)
+{
+
+	fprintf(stderr, "junk %p %zu\n", data, datalen);
+}
+
+static void
 pretty_guid(efi_guid_t *guid, char **gname)
 {
 	char *pretty = NULL;
@@ -232,6 +241,8 @@ print_var(efi_guid_t *guid, char *name)
 			asciidump(data, datalen);
 		else if (bflag)
 			bindump(data, datalen);
+		else if (dflag)
+			devpath_dump(data, datalen);
 		else
 			hexdump(data, datalen);
 	} else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703032023.v23KNEaj063296>