From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: jaben.carsey@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Tue, 07 May 2019 10:40:36 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 10:40:34 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 07 May 2019 10:40:33 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 7 May 2019 10:40:32 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.162]) by fmsmsx111.amr.corp.intel.com ([169.254.12.101]) with mapi id 14.03.0415.000; Tue, 7 May 2019 10:40:32 -0700 From: "Carsey, Jaben" To: "devel@edk2.groups.io" , "tim.lewis@insyde.com" , "Gao, Zhichao" , "Ni, Ray" , "jwatt@jwatt.org" CC: "Bi, Dandan" Subject: Re: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option Thread-Topic: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option Thread-Index: AQHVBAwgBZMJ5pxvi0a+WqdyZp11UKZeleQAgAFMRoD//9mpsIAAkvQA//+g7iA= Date: Tue, 7 May 2019 17:40:32 +0000 Message-ID: References: <047401d504f0$c6020160$52060420$@insyde.com> In-Reply-To: <047401d504f0$c6020160$52060420$@insyde.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzhjMTY4MjEtMmIxNC00YzM2LThiYmYtYmQxMTVmYmZiMjhhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS0RZQmhSNjd4UlVkQnZyKzYzV2tqck9WWDhiUE5pb1ZFWFwveHVtemphWkJwRko2QlozSEEwWDQ5dmlRSXZpTGsifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Return-Path: jaben.carsey@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It will break existing scripts. Do you have such scripts in your environme= nt dependent on this parameter? > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Tim Lewis > Sent: Tuesday, May 07, 2019 9:20 AM > To: devel@edk2.groups.io; Carsey, Jaben ; Gao, > Zhichao ; Ni, Ray ; > jwatt@jwatt.org > Cc: Bi, Dandan > Subject: Re: [edk2-devel] [PATCH v1 1/1] > ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option > Importance: High >=20 > The question is whether this will break compatibility with existing shel= l > scripts. In order to maintain that compatibility, it may be necessary to= add > a new option rather than trying to update an existing one. >=20 > Tim >=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Carsey, > Jaben > Sent: Tuesday, May 7, 2019 7:36 AM > To: Gao, Zhichao ; devel@edk2.groups.io; Ni, Ray > ; jwatt@jwatt.org > Cc: Bi, Dandan > Subject: Re: [edk2-devel] [PATCH v1 1/1] > ShellPkg/UefiShellBcfgCommandLib: > Fix '-opt' option >=20 > Zhichao, > I can help submit errata for shell spec if needed. >=20 > Per patch, > I agree. This looks good. > Reviewed-by: Jaben Carsey >=20 >=20 > > -----Original Message----- > > From: Gao, Zhichao > > Sent: Tuesday, May 07, 2019 2:52 AM > > To: devel@edk2.groups.io; Ni, Ray ; jwatt@jwatt.org > > Cc: Carsey, Jaben ; Bi, Dandan > > > > Subject: RE: [edk2-devel] [PATCH v1 1/1] > > ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option > > Importance: High > > > > This patch looks good for me. > > Reviewed-by: Zhichao Gao > > > > But when I view the command in UEFI SHELL 2.2 spec: > > ... > > bcfg driver|boot [-opt # [[filename]|["data"]] | [KeyData > UnicodeChar>*]] > > ... > > -opt > > Modify the optional data associated with a driver or boot option. > > Followed either by the filename of the file which contains the binary > > data to be associated with the driver or boot option optional data, or > > else the quote- delimited data that will be associated with the driver > > or boot option optional data. > > ... > > > > This description lack the comment of '#' parameter and that may make > > the consumer confused. Usually consumers would regard it as the same > > in other option, such as ' bcfg driver|boot [rm #]'. The '#' is > > clearly descripted as a hexadecimal parameter: > > rm > > Remove an option. The # parameter lists the option number to remove in > > hexadecimal. > > > > So I think we should update the shell spec by the way. > > > > Thanks, > > Zhichao > > > > > -----Original Message----- > > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf > > > Of > > Ni, > > > Ray > > > Sent: Monday, May 6, 2019 10:02 PM > > > To: jwatt@jwatt.org; devel@edk2.groups.io > > > Cc: Carsey, Jaben ; Bi, Dandan > > > > > > Subject: Re: [edk2-devel] [PATCH v1 1/1] > > ShellPkg/UefiShellBcfgCommandLib: > > > Fix '-opt' option > > > > > > Dandan, > > > Can you please help to review? > > > > > > Thanks, > > > Ray > > > > > > > -----Original Message----- > > > > From: jwatt@jwatt.org [mailto:jwatt@jwatt.org] > > > > Sent: Monday, May 6, 2019 9:03 PM > > > > To: devel@edk2.groups.io > > > > Cc: Carsey, Jaben ; Ni, Ray > > > > > > > > Subject: [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-op= t' > > > > option > > > > > > > > From: Jonathan Watt > > > > > > > > For all other bcfg commands the "#" (option number) argument(s) > > > > are treated as hexedecimal values regardless of whether or not > > > > they are prefixed by "0x". This change fixes '-opt' to handle its= "#" > > > > (option number) argument consistently with the other commands. > > > > > > > > Making this change removes a potential footgun whereby a user that > > > > has been using a number without a "0x" prefix with other bcfg > > > > commands finds that, on using that exact same number with '-opt', > > > > it has this time unexpectedly been interpreted as a decimal number > > > > and they have modified > > > > (corrupted) an unrelated load option. For example, a user may > > > > have been specifying "10" to other commands to have them act on > > > > the 16th option (because simply "10", without any prefix, is how > > > > 'bcfg boot dump' displayed the option number for the 16th option). > > > > Unfortunately for them, if they also use '-opt' with "10" it would > > > > unexpectedly and inconsistently act on the 10th option. > > > > > > > > CC: Jaben Carsey > > > > CC: Ray Ni > > > > Signed-off-by: Jonathan Watt > > > > --- > > > > > > > > > ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c > > | > > > > 2 > > > > +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git > > > > > > a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c > > > > > > b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c > > > > index d033c7c1dc59..e8b48b4990dd 100644 > > > > --- > > > > > > a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c > > > > +++ > > > > > > b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c > > > > @@ -1019,7 +1019,7 @@ BcfgAddOpt( > > > > // > > > > // Get the index of the variable we are changing. > > > > // > > > > - Status =3D ShellConvertStringToUint64(Walker, &Intermediate, > > > > FALSE, TRUE); > > > > + Status =3D ShellConvertStringToUint64(Walker, &Intermediate, > > > > + TRUE, TRUE); > > > > if (EFI_ERROR(Status) || (((UINT16)Intermediate) !=3D > > > > Intermediate) > > > > || StrStr(Walker, L" ") =3D=3D NULL || ((UINT16)Intermediate) > > > > > ((UINT16)OrderCount)) { > > > > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > > > (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option > Index"); > > > > ShellStatus =3D SHELL_INVALID_PARAMETER; > > > > -- > > > > 2.21.0 > > > > > > > > > >=20 >=20 >=20 >=20 >=20 >=20 >=20