[edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder

Li, Walon posted 1 patch 3 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20210219093931.1458-1-walon.li@hpe.com
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
Posted by Li, Walon 3 years, 1 month ago
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3135

When Boot Menu does not exist in the BootOrder, BmRegisterBootManagerMenu
will create one into list. However, it should be put at the "end" of
BootOrder instead of "start" of BootOrder. Replace 0 by -1 to adjust
order of load options.

Signed-off-by: Walon Li <walon.li@hpe.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index aff620ad52..6cc34d29c0 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -3,7 +3,7 @@
 
 Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
 Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>
-(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
+(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -2505,7 +2505,7 @@ BmRegisterBootManagerMenu (
     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
     );
 
-  return EfiBootManagerAddLoadOptionVariable (BootOption, 0);
+  return EfiBootManagerAddLoadOptionVariable (BootOption, (UINTN) -1);
 }
 
 /**
-- 
2.23.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71840): https://edk2.groups.io/g/devel/message/71840
Mute This Topic: https://groups.io/mt/80751724/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
Posted by Laszlo Ersek 3 years, 1 month ago
On 02/19/21 10:39, Walon Li wrote:
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3135
> 
> When Boot Menu does not exist in the BootOrder, BmRegisterBootManagerMenu
> will create one into list. However, it should be put at the "end" of
> BootOrder instead of "start" of BootOrder. Replace 0 by -1 to adjust
> order of load options.
> 
> Signed-off-by: Walon Li <walon.li@hpe.com>
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index aff620ad52..6cc34d29c0 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -3,7 +3,7 @@
>  
>  Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
>  Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>
> -(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
> +(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  **/
> @@ -2505,7 +2505,7 @@ BmRegisterBootManagerMenu (
>      EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
>      );
>  
> -  return EfiBootManagerAddLoadOptionVariable (BootOption, 0);
> +  return EfiBootManagerAddLoadOptionVariable (BootOption, (UINTN) -1);
>  }
>  
>  /**
> 

Acked-by: Laszlo Ersek <lersek@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71846): https://edk2.groups.io/g/devel/message/71846
Mute This Topic: https://groups.io/mt/80751724/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
Posted by Wang, Sunny (HPS SW) 3 years, 1 month ago
Yeah, the problem is that always adding the Boot Menu to the top of BootOrder causes confusion to the users who manipulate the Boot Order under OS. Also, we can't find any reason why the Boot Menu needs to be always added to the top of the Boot Order even if we check the change history and emails. 
 
Reviewed-by: Sunny Wang <sunnywang@hpe.com>


-----Original Message-----
From: Li, Walon <walon.li@hpe.com> 
Sent: Friday, February 19, 2021 5:40 PM
To: devel@edk2.groups.io
Cc: Li, Walon <walon.li@hpe.com>; Wang, Sunny (HPS SW) <sunnywang@hpe.com>; lersek@redhat.com; ray.ni@intel.com; hao.a.wu@intel.com; gaoliming@byosoft.com.cn
Subject: [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3135

When Boot Menu does not exist in the BootOrder, BmRegisterBootManagerMenu will create one into list. However, it should be put at the "end" of BootOrder instead of "start" of BootOrder. Replace 0 by -1 to adjust order of load options.

Signed-off-by: Walon Li <walon.li@hpe.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index aff620ad52..6cc34d29c0 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -3,7 +3,7 @@
  Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>-(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>+(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR> SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -2505,7 +2505,7 @@ BmRegisterBootManagerMenu (
     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);     ); -  return EfiBootManagerAddLoadOptionVariable (BootOption, 0);+  return EfiBootManagerAddLoadOptionVariable (BootOption, (UINTN) -1); }  /**-- 
2.23.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71931): https://edk2.groups.io/g/devel/message/71931
Mute This Topic: https://groups.io/mt/80751724/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
Posted by gaoliming 3 years, 1 month ago
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: bounce+27952+71931+4905953+8761045@groups.io
> <bounce+27952+71931+4905953+8761045@groups.io> 代表 Wang, Sunny
> (HPS SW)
> 发送时间: 2021年2月22日 17:30
> 收件人: Li, Walon <walon.li@hpe.com>; devel@edk2.groups.io
> 抄送: lersek@redhat.com; ray.ni@intel.com; hao.a.wu@intel.com;
> gaoliming@byosoft.com.cn; Wang, Sunny (HPS SW) <sunnywang@hpe.com>
> 主题: Re: [edk2-devel] [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put
> BootMenu at the end of BootOrder
> 
> Yeah, the problem is that always adding the Boot Menu to the top of
> BootOrder causes confusion to the users who manipulate the Boot Order
> under OS. Also, we can't find any reason why the Boot Menu needs to be
> always added to the top of the Boot Order even if we check the change
> history and emails.
> 
> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
> 
> 
> -----Original Message-----
> From: Li, Walon <walon.li@hpe.com>
> Sent: Friday, February 19, 2021 5:40 PM
> To: devel@edk2.groups.io
> Cc: Li, Walon <walon.li@hpe.com>; Wang, Sunny (HPS SW)
> <sunnywang@hpe.com>; lersek@redhat.com; ray.ni@intel.com;
> hao.a.wu@intel.com; gaoliming@byosoft.com.cn
> Subject: [PATCH v2] MdeModulePkg/UefiBootManagerLib: Put BootMenu at
> the end of BootOrder
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3135
> 
> When Boot Menu does not exist in the BootOrder,
> BmRegisterBootManagerMenu will create one into list. However, it should be
> put at the "end" of BootOrder instead of "start" of BootOrder. Replace 0
by -1
> to adjust order of load options.
> 
> Signed-off-by: Walon Li <walon.li@hpe.com>
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index aff620ad52..6cc34d29c0 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -3,7 +3,7 @@
>   Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. Copyright
(c)
> 2011 - 2020, Intel Corporation. All rights reserved.<BR>-(C) Copyright
> 2015-2016 Hewlett Packard Enterprise Development LP<BR>+(C) Copyright
> 2015-2021 Hewlett Packard Enterprise Development LP<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -2505,7 +2505,7 @@
> BmRegisterBootManagerMenu (
>      EfiBootManagerFreeLoadOptions (BootOptions,
> BootOptionCount);     ); -  return EfiBootManagerAddLoadOptionVariable
> (BootOption, 0);+  return EfiBootManagerAddLoadOptionVariable
> (BootOption, (UINTN) -1); }  /**--
> 2.23.0.windows.1
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71937): https://edk2.groups.io/g/devel/message/71937
Mute This Topic: https://groups.io/mt/80821160/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-