public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Udit Kumar <udit.kumar@nxp.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: Accessing global variables from Shell
Date: Mon, 3 Jul 2017 20:13:45 +0200	[thread overview]
Message-ID: <06f5fd7b-bb17-5bfe-e30d-ffc766c02a1c@redhat.com> (raw)
In-Reply-To: <DB3PR04MB0761C798CA38A3A82ABB8A7E91D60@DB3PR04MB0761.eurprd04.prod.outlook.com>

On 07/03/17 09:18, Udit Kumar wrote:
> Dear Edk2, 
> 
> I am trying to create one global variables, and access that from shell. 
> If I am using gEfiGlobalVariableGuid to create variable then I could access it perfectly ok ,  If I use other Guid (even vendor guid) then I couldn't access from shell. 
> 
> Original code 
> STATIC CONST CHAR16           myVar[] = L"MacUniqueId";
> Status = gRT->SetVariable ((CHAR16 *)myVar,
>                     &gEfiCallerIdGuid,
>                     EFI_VARIABLE_NON_VOLATILE |
>                      EFI_VARIABLE_BOOTSERVICE_ACCESS |
>                      EFI_VARIABLE_RUNTIME_ACCESS, Size,
> 
> On shell 
> FS0:\> setvar MacUniqueId -guid C9DCF469-A7C4-11D5-87DA-00062945C3B9
> setvar: Unable to get - C9DCF469-A7C4-11D5-87DA-00062945C3B9 - MacUniqueId

This GUID (in the shell command) is not one that you generated afresh
with "uuidgen", namely it is found in
"EdkCompatibilityPkg/Foundation/Guid/StatusCodeCallerId/StatusCodeCallerId.h".

My take is that "gEfiCallerIdGuid" denotes a different GUID from
C9DCF469-... If you take the actual FILE_GUID of the module INF where
your example code is from, and use that GUID in the shell command too,
it should work.

Laszlo


  reply	other threads:[~2017-07-03 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03  7:18 Accessing global variables from Shell Udit Kumar
2017-07-03 18:13 ` Laszlo Ersek [this message]
2017-07-04  4:33   ` Udit Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06f5fd7b-bb17-5bfe-e30d-ffc766c02a1c@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox