From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C2D2021A00AC2 for ; Mon, 3 Jul 2017 11:12:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFC16A0B41; Mon, 3 Jul 2017 18:13:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AFC16A0B41 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AFC16A0B41 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-25.phx2.redhat.com [10.3.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 171166928F; Mon, 3 Jul 2017 18:13:45 +0000 (UTC) To: Udit Kumar , "edk2-devel@lists.01.org" References: From: Laszlo Ersek Message-ID: <06f5fd7b-bb17-5bfe-e30d-ffc766c02a1c@redhat.com> Date: Mon, 3 Jul 2017 20:13:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Jul 2017 18:13:46 +0000 (UTC) Subject: Re: Accessing global variables from Shell X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2017 18:12:09 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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