public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
@ 2021-03-10  8:20 Zhiguang Liu
  2021-03-10  9:55 ` Ni, Ray
  0 siblings, 1 reply; 6+ messages in thread
From: Zhiguang Liu @ 2021-03-10  8:20 UTC (permalink / raw)
  To: devel
  Cc: Eric Dong, Liming Gao, Nate DeSimone, Prince Agyeman, Ray Ni,
	Zhichao Gao

Currently, load option is only sorted when setup is the first priority in boot
option. However, Below change in UefiBootManagerLib puts setup in the end, which
causes the sort function won't be called.
  MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
  SHA-1: 7f34681c488aee2563eaa2afcc6a2c8aa7c5b912

This patch will set a NV variable in the first boot, and sort the boot option
in first boot.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 70 +++++++++++++++++++++++++++++++++++-----------------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index d7612fb80a..5b65e5f3e9 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
@@ -992,37 +992,6 @@ ConnectSequence (
   EfiBootManagerConnectAll ();
 }
 
-
-/**
-  The function is to consider the boot order which is not in our expectation.
-  In the case that we need to re-sort the boot option.
-
-  @retval  TRUE         Need to sort Boot Option.
-  @retval  FALSE        Don't need to sort Boot Option.
-**/
-BOOLEAN
-IsNeedSortBootOption (
-  VOID
-  )
-{
-  EFI_BOOT_MANAGER_LOAD_OPTION  *BootOptions;
-  UINTN                         BootOptionCount;
-
-  BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
-
-  //
-  // If setup is the first priority in boot option, we need to sort boot option.
-  //
-  if ((BootOptionCount > 1) &&
-    (((StrnCmp (BootOptions->Description, L"Enter Setup", StrLen (L"Enter Setup"))) == 0) ||
-    ((StrnCmp (BootOptions->Description, L"BootManagerMenuApp", StrLen (L"BootManagerMenuApp"))) == 0))) {
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-
 /**
   Connects Root Bridge
  **/
@@ -1332,6 +1301,9 @@ BdsAfterConsoleReadyBeforeBootOptionCallback (
   )
 {
   EFI_BOOT_MODE                 LocalBootMode;
+  EFI_STATUS                    Status;
+  BOOLEAN                       IsFirstBoot;
+  UINTN                         DataSize;
 
   DEBUG ((DEBUG_INFO, "Event gBdsAfterConsoleReadyBeforeBootOptionEvent callback starts\n"));
   //
@@ -1376,14 +1348,42 @@ BdsAfterConsoleReadyBeforeBootOptionCallback (
       //
       // PXE boot option may appear after boot option enumeration
       //
+
+      EfiBootManagerRefreshAllBootOption ();
+
+      Status = gRT->GetVariable (
+                      L"IsFirstBoot",
+                      &gEfiCallerIdGuid,
+                      NULL,
+                      &DataSize,
+                      &IsFirstBoot
+                      );
+      if (EFI_ERROR (Status)) {
+        //
+        // If can't find the variable, see it as the first boot
+        //
+        IsFirstBoot = TRUE;
+      }
+
+      if (IsFirstBoot == TRUE) {
+        //
+        // In the first boot, sort the boot option
+        //
+        EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOption);
+        IsFirstBoot = FALSE;
+        Status = gRT->SetVariable (
+                        L"IsFirstBoot",
+                        &gEfiCallerIdGuid,
+                        EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+                        1,
+                        &IsFirstBoot
+                        );
+      }
+
       break;
   }
 
   Print (L"Press F7 for BootMenu!\n");
 
-  EfiBootManagerRefreshAllBootOption ();
 
-  if (IsNeedSortBootOption()) {
-    EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOption);
-  }
 }
-- 
2.30.0.windows.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
  2021-03-10  8:20 [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot Zhiguang Liu
@ 2021-03-10  9:55 ` Ni, Ray
  2021-03-15  1:36   ` 回复: " gaoliming
  0 siblings, 1 reply; 6+ messages in thread
From: Ni, Ray @ 2021-03-10  9:55 UTC (permalink / raw)
  To: Liu, Zhiguang, devel@edk2.groups.io
  Cc: Dong, Eric, Liming Gao, Desimone, Nathaniel L, Agyeman, Prince,
	Gao, Zhichao

1. DataSIze should be set to sizeof (BOOLEAN) before calling GetVariable()

> +      Status = gRT->GetVariable (
> +                      L"IsFirstBoot",

2. Can you please define a macro in this C file for IsFirstBoot string?
e.g.: #define IS_FIRST_BOOT_VAR_NAME L"IsFirstBoot"

> +      if (IsFirstBoot == TRUE) {

3. Please remove "== TRUE". Just use "If (IsFirstBoot)".

> +                        L"IsFirstBoot",
4. Please use the macro defined as above.

> 
> +                        &gEfiCallerIdGuid,
> 
> +                        EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,

5. Please remove "EFI_VARIABLE_RUNTIME_ACCESS".

> +                        1,
6. Please use sizeof (BOOLEAN) instead of "1".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* 回复: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
  2021-03-10  9:55 ` Ni, Ray
@ 2021-03-15  1:36   ` gaoliming
  2021-03-16  1:56     ` [edk2-devel] " Zhiguang Liu
  0 siblings, 1 reply; 6+ messages in thread
From: gaoliming @ 2021-03-15  1:36 UTC (permalink / raw)
  To: 'Ni, Ray', 'Liu, Zhiguang', devel
  Cc: 'Dong, Eric', 'Desimone, Nathaniel L',
	'Agyeman, Prince', 'Gao, Zhichao'

Zhiguang:
  I see QuarkPlatformPkg uses PCD gQuarkPlatformTokenSpaceGuid.PcdBootState
to decide whether current boot is the first boot or not. 
  This PCD is configured as DynamicHiiPcd, and be set in
Platform\Intel\QuarkPlatformPkg\Library\PlatformBootManagerLib\PlatformBootM
anager.c

  Can you use the same solution in Intel BoardModulePkg?

Thanks
Liming
> -----邮件原件-----
> 发件人: Ni, Ray <ray.ni@intel.com>
> 发送时间: 2021年3月10日 17:56
> 收件人: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
> 抄送: Dong, Eric <eric.dong@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> 主题: RE: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option
> in the first boot
> 
> 1. DataSIze should be set to sizeof (BOOLEAN) before calling GetVariable()
> 
> > +      Status = gRT->GetVariable (
> > +                      L"IsFirstBoot",
> 
> 2. Can you please define a macro in this C file for IsFirstBoot string?
> e.g.: #define IS_FIRST_BOOT_VAR_NAME L"IsFirstBoot"
> 
> > +      if (IsFirstBoot == TRUE) {
> 
> 3. Please remove "== TRUE". Just use "If (IsFirstBoot)".
> 
> > +                        L"IsFirstBoot",
> 4. Please use the macro defined as above.
> 
> >
> > +                        &gEfiCallerIdGuid,
> >
> > +                        EFI_VARIABLE_NON_VOLATILE |
> > EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
> 
> 5. Please remove "EFI_VARIABLE_RUNTIME_ACCESS".
> 
> > +                        1,
> 6. Please use sizeof (BOOLEAN) instead of "1".




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] 回复: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
  2021-03-15  1:36   ` 回复: " gaoliming
@ 2021-03-16  1:56     ` Zhiguang Liu
  2021-03-17  3:00       ` 回复: " gaoliming
  0 siblings, 1 reply; 6+ messages in thread
From: Zhiguang Liu @ 2021-03-16  1:56 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn, Ni, Ray
  Cc: Dong, Eric, Desimone, Nathaniel L, Agyeman, Prince, Gao, Zhichao

Hi Liming,

Thanks for the comments. This patch is merged before this comment, but I can still send another patch to modify if needed.

However, I think the implement in this patch is more simple.
The implement in QuarkPlatformPkg need changes in inf, dec and dsc files, and is not as intuitive as just getting and setting a variable.
It may be simpler if the implements can reuse a same DynamicHiiPcd, do you think it is possible?
If I misunderstand anything, please correct me.

Thanks
Zhiguang

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Monday, March 15, 2021 9:36 AM
> To: Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: [edk2-devel] 回复: [Patch edk2-platforms V2]
> Intel/BoardModulePkg: sort load option in the first boot
> 
> Zhiguang:
>   I see QuarkPlatformPkg uses PCD
> gQuarkPlatformTokenSpaceGuid.PcdBootState
> to decide whether current boot is the first boot or not.
>   This PCD is configured as DynamicHiiPcd, and be set in
> Platform\Intel\QuarkPlatformPkg\Library\PlatformBootManagerLib\Platfor
> mBootM
> anager.c
> 
>   Can you use the same solution in Intel BoardModulePkg?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Ni, Ray <ray.ni@intel.com>
> > 发送时间: 2021年3月10日 17:56
> > 收件人: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
> > 抄送: Dong, Eric <eric.dong@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L
> > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > 主题: RE: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load
> > option in the first boot
> >
> > 1. DataSIze should be set to sizeof (BOOLEAN) before calling
> > GetVariable()
> >
> > > +      Status = gRT->GetVariable (
> > > +                      L"IsFirstBoot",
> >
> > 2. Can you please define a macro in this C file for IsFirstBoot string?
> > e.g.: #define IS_FIRST_BOOT_VAR_NAME L"IsFirstBoot"
> >
> > > +      if (IsFirstBoot == TRUE) {
> >
> > 3. Please remove "== TRUE". Just use "If (IsFirstBoot)".
> >
> > > +                        L"IsFirstBoot",
> > 4. Please use the macro defined as above.
> >
> > >
> > > +                        &gEfiCallerIdGuid,
> > >
> > > +                        EFI_VARIABLE_NON_VOLATILE |
> > > EFI_VARIABLE_RUNTIME_ACCESS |
> EFI_VARIABLE_BOOTSERVICE_ACCESS,
> >
> > 5. Please remove "EFI_VARIABLE_RUNTIME_ACCESS".
> >
> > > +                        1,
> > 6. Please use sizeof (BOOLEAN) instead of "1".
> 
> 
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* 回复: [edk2-devel] 回复: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
  2021-03-16  1:56     ` [edk2-devel] " Zhiguang Liu
@ 2021-03-17  3:00       ` gaoliming
  2021-03-17  4:04         ` Ni, Ray
  0 siblings, 1 reply; 6+ messages in thread
From: gaoliming @ 2021-03-17  3:00 UTC (permalink / raw)
  To: devel, zhiguang.liu, 'Ni, Ray'
  Cc: 'Dong, Eric', 'Desimone, Nathaniel L',
	'Agyeman, Prince', 'Gao, Zhichao'

Zhiguang:
  This is the common platform usage. I suggest to apply the same solution. My solution is to define this PCD PcdBootState in MdeModulePkg.dec, and add MdeModule.dsc.inc file that defines this PCD as DynamicHii PCD, platform DSC includes MdeModule.dsc.inc file, platform modules consume this PCD (set/get). 

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> 发送时间: 2021年3月16日 9:57
> 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Ni, Ray
> <ray.ni@intel.com>
> 抄送: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> 主题: Re: [edk2-devel] 回复: [Patch edk2-platforms V2]
> Intel/BoardModulePkg: sort load option in the first boot
> 
> Hi Liming,
> 
> Thanks for the comments. This patch is merged before this comment, but I can
> still send another patch to modify if needed.
> 
> However, I think the implement in this patch is more simple.
> The implement in QuarkPlatformPkg need changes in inf, dec and dsc files,
> and is not as intuitive as just getting and setting a variable.
> It may be simpler if the implements can reuse a same DynamicHiiPcd, do you
> think it is possible?
> If I misunderstand anything, please correct me.
> 
> Thanks
> Zhiguang
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming
> > Sent: Monday, March 15, 2021 9:36 AM
> > To: Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> > devel@edk2.groups.io
> > Cc: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L
> > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > Subject: [edk2-devel] 回复: [Patch edk2-platforms V2]
> > Intel/BoardModulePkg: sort load option in the first boot
> >
> > Zhiguang:
> >   I see QuarkPlatformPkg uses PCD
> > gQuarkPlatformTokenSpaceGuid.PcdBootState
> > to decide whether current boot is the first boot or not.
> >   This PCD is configured as DynamicHiiPcd, and be set in
> > Platform\Intel\QuarkPlatformPkg\Library\PlatformBootManagerLib\Platfor
> > mBootM
> > anager.c
> >
> >   Can you use the same solution in Intel BoardModulePkg?
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: Ni, Ray <ray.ni@intel.com>
> > > 发送时间: 2021年3月10日 17:56
> > > 收件人: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
> > > 抄送: Dong, Eric <eric.dong@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L
> > > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > > 主题: RE: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load
> > > option in the first boot
> > >
> > > 1. DataSIze should be set to sizeof (BOOLEAN) before calling
> > > GetVariable()
> > >
> > > > +      Status = gRT->GetVariable (
> > > > +                      L"IsFirstBoot",
> > >
> > > 2. Can you please define a macro in this C file for IsFirstBoot string?
> > > e.g.: #define IS_FIRST_BOOT_VAR_NAME L"IsFirstBoot"
> > >
> > > > +      if (IsFirstBoot == TRUE) {
> > >
> > > 3. Please remove "== TRUE". Just use "If (IsFirstBoot)".
> > >
> > > > +                        L"IsFirstBoot",
> > > 4. Please use the macro defined as above.
> > >
> > > >
> > > > +                        &gEfiCallerIdGuid,
> > > >
> > > > +                        EFI_VARIABLE_NON_VOLATILE |
> > > > EFI_VARIABLE_RUNTIME_ACCESS |
> > EFI_VARIABLE_BOOTSERVICE_ACCESS,
> > >
> > > 5. Please remove "EFI_VARIABLE_RUNTIME_ACCESS".
> > >
> > > > +                        1,
> > > 6. Please use sizeof (BOOLEAN) instead of "1".
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] 回复: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
  2021-03-17  3:00       ` 回复: " gaoliming
@ 2021-03-17  4:04         ` Ni, Ray
  0 siblings, 0 replies; 6+ messages in thread
From: Ni, Ray @ 2021-03-17  4:04 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io, Liu, Zhiguang
  Cc: Dong, Eric, Desimone, Nathaniel L, Agyeman, Prince, Gao, Zhichao

Liming,
Using HII PCDs introduces too many software layers that may cause potential bugs if any layer is not proper implemented (Imaging a case when a platform forgets to include the mdeModule.dsc.inc).

Variable used here is very straightforward.

That was also the reason when I redesigned the BDS 10 years ago, I chose not to include the PcdBootState into the MdeModulePkg but left that in platform.

I agree with you that consistency is better. And I suggest we submit a Bugzilla to change all open platforms to use variable directly for first boot detection.

Thanks,
Ray

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Wednesday, March 17, 2021 11:01 AM
> To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com>; Ni, Ray <ray.ni@intel.com>
> Cc: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: 回复: [edk2-devel] 回复: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot
> 
> Zhiguang:
>   This is the common platform usage. I suggest to apply the same solution. My solution is to define this PCD PcdBootState in
> MdeModulePkg.dec, and add MdeModule.dsc.inc file that defines this PCD as DynamicHii PCD, platform DSC includes
> MdeModule.dsc.inc file, platform modules consume this PCD (set/get).
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Zhiguang Liu
> > 发送时间: 2021年3月16日 9:57
> > 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Ni, Ray
> > <ray.ni@intel.com>
> > 抄送: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L
> > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > 主题: Re: [edk2-devel] 回复: [Patch edk2-platforms V2]
> > Intel/BoardModulePkg: sort load option in the first boot
> >
> > Hi Liming,
> >
> > Thanks for the comments. This patch is merged before this comment, but I can
> > still send another patch to modify if needed.
> >
> > However, I think the implement in this patch is more simple.
> > The implement in QuarkPlatformPkg need changes in inf, dec and dsc files,
> > and is not as intuitive as just getting and setting a variable.
> > It may be simpler if the implements can reuse a same DynamicHiiPcd, do you
> > think it is possible?
> > If I misunderstand anything, please correct me.
> >
> > Thanks
> > Zhiguang
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > gaoliming
> > > Sent: Monday, March 15, 2021 9:36 AM
> > > To: Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> > > devel@edk2.groups.io
> > > Cc: Dong, Eric <eric.dong@intel.com>; Desimone, Nathaniel L
> > > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > > Subject: [edk2-devel] 回复: [Patch edk2-platforms V2]
> > > Intel/BoardModulePkg: sort load option in the first boot
> > >
> > > Zhiguang:
> > >   I see QuarkPlatformPkg uses PCD
> > > gQuarkPlatformTokenSpaceGuid.PcdBootState
> > > to decide whether current boot is the first boot or not.
> > >   This PCD is configured as DynamicHiiPcd, and be set in
> > > Platform\Intel\QuarkPlatformPkg\Library\PlatformBootManagerLib\Platfor
> > > mBootM
> > > anager.c
> > >
> > >   Can you use the same solution in Intel BoardModulePkg?
> > >
> > > Thanks
> > > Liming
> > > > -----邮件原件-----
> > > > 发件人: Ni, Ray <ray.ni@intel.com>
> > > > 发送时间: 2021年3月10日 17:56
> > > > 收件人: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io
> > > > 抄送: Dong, Eric <eric.dong@intel.com>; Liming Gao
> > > > <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L
> > > > <nathaniel.l.desimone@intel.com>; Agyeman, Prince
> > > > <prince.agyeman@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> > > > 主题: RE: [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load
> > > > option in the first boot
> > > >
> > > > 1. DataSIze should be set to sizeof (BOOLEAN) before calling
> > > > GetVariable()
> > > >
> > > > > +      Status = gRT->GetVariable (
> > > > > +                      L"IsFirstBoot",
> > > >
> > > > 2. Can you please define a macro in this C file for IsFirstBoot string?
> > > > e.g.: #define IS_FIRST_BOOT_VAR_NAME L"IsFirstBoot"
> > > >
> > > > > +      if (IsFirstBoot == TRUE) {
> > > >
> > > > 3. Please remove "== TRUE". Just use "If (IsFirstBoot)".
> > > >
> > > > > +                        L"IsFirstBoot",
> > > > 4. Please use the macro defined as above.
> > > >
> > > > >
> > > > > +                        &gEfiCallerIdGuid,
> > > > >
> > > > > +                        EFI_VARIABLE_NON_VOLATILE |
> > > > > EFI_VARIABLE_RUNTIME_ACCESS |
> > > EFI_VARIABLE_BOOTSERVICE_ACCESS,
> > > >
> > > > 5. Please remove "EFI_VARIABLE_RUNTIME_ACCESS".
> > > >
> > > > > +                        1,
> > > > 6. Please use sizeof (BOOLEAN) instead of "1".
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > 
> >
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-17  4:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10  8:20 [Patch edk2-platforms V2] Intel/BoardModulePkg: sort load option in the first boot Zhiguang Liu
2021-03-10  9:55 ` Ni, Ray
2021-03-15  1:36   ` 回复: " gaoliming
2021-03-16  1:56     ` [edk2-devel] " Zhiguang Liu
2021-03-17  3:00       ` 回复: " gaoliming
2021-03-17  4:04         ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox