From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: insyde.com, ip: 210.71.195.45, mailfrom: tim.lewis@insyde.com) Received: from out01.hibox.biz (out01.hibox.biz [210.71.195.45]) by groups.io with SMTP; Tue, 07 May 2019 10:43:20 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D0AgC+wdFc/ws0GKxkHAEBAQQBAQc?= =?us-ascii?q?EAQGBZYJ6gQQojQuMKTUBgwOLBRGESCOHExAjCQGEOgQCAoI5OBMBAwEBBQE?= =?us-ascii?q?BAQECbRwMhUoBAQUIAjAUCAgbDAEFBgMNBAQBASggGBUJCAIEARILBQ0EgwK?= =?us-ascii?q?CCg+vNxoCg2oBKwERQ4UpgTKBD1GLRT+BEYMSPoQNhhkEixeHfD2TDWUHAgK?= =?us-ascii?q?CCVkBhUOEMogAG4IQYoVig10DiSOMJIEhhSyOUYFmIYFWcIM8CTaCB4Ing3W?= =?us-ascii?q?CBYUzAVYiMIEhCBOOKYJSAQE?= X-IronPort-AV: E=Sophos;i="5.60,442,1549900800"; d="scan'208";a="35781987" Received: from unknown (HELO hb3-BKT201.hibox.biz) ([172.24.52.11]) by out01.hibox.biz with ESMTP; 08 May 2019 01:43:15 +0800 Received: from unknown (HELO hb3-BKT103.hibox.biz) ([172.24.51.13]) by hb3-BKT201.hibox.biz with ESMTP; 08 May 2019 01:43:14 +0800 Received: from unknown (HELO hb3-IN03.hibox.biz) ([172.24.12.13]) by hb3-BKT103.hibox.biz with ESMTP; 08 May 2019 01:43:15 +0800 X-Remote-IP: 73.116.1.175 X-Remote-Host: c-73-116-1-175.hsd1.ca.comcast.net X-SBRS: -10.0 X-MID: 23881276 X-Auth-ID: tim.lewis@insyde.com X-EnvelopeFrom: tim.lewis@insyde.com hiBox-Sender: 1 Received: from c-73-116-1-175.hsd1.ca.comcast.net (HELO TIMSLAPTOP) ([73.116.1.175]) by hb3-IN03.hibox.biz with ESMTP/TLS/AES256-SHA; 08 May 2019 01:43:13 +0800 From: "Tim Lewis" To: "'Carsey, Jaben'" , , "'Gao, Zhichao'" , "'Ni, Ray'" , Cc: "'Bi, Dandan'" In-Reply-To: Subject: Re: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option Date: Tue, 7 May 2019 10:43:09 -0700 Message-ID: <056401d504fc$57b2e830$0718b890$@insyde.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFwqIN8lXqUg01hfMuLG9RVDYaOCKcop1jQ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: en-us Yes. And we have been recommending the usage of bcfg to our customers for years. Tim -----Original Message----- From: Carsey, Jaben Sent: Tuesday, May 7, 2019 10:41 AM 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 It will break existing scripts. Do you have such scripts in your environment 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 > > The question is whether this will break compatibility with existing > shell scripts. In order to maintain that compatibility, it may be > necessary to add a new option rather than trying to update an existing one. > > Tim > > -----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 > > Zhichao, > I can help submit errata for shell spec if needed. > > Per patch, > I agree. This looks good. > Reviewed-by: Jaben Carsey > > > > -----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 '-opt' > > > > 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 = ShellConvertStringToUint64(Walker, &Intermediate, > > > > FALSE, TRUE); > > > > + Status = ShellConvertStringToUint64(Walker, &Intermediate, > > > > + TRUE, TRUE); > > > > if (EFI_ERROR(Status) || (((UINT16)Intermediate) != > > > > Intermediate) > > > > || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > > > > > ((UINT16)OrderCount)) { > > > > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN > > > > (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option > Index"); > > > > ShellStatus = SHELL_INVALID_PARAMETER; > > > > -- > > > > 2.21.0 > > > > > > > > > > > > > > > >