From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.2147.1613618801590827536 for ; Wed, 17 Feb 2021 19:26:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=lN9kVxCs; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=06839492d2=walon.li@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11I3EATN001250; Thu, 18 Feb 2021 03:26:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pps0720; bh=sEFVvmMdLf73GFT+9mrezgDG7obZ8EGe0Qv1FRcLdL4=; b=lN9kVxCs/MmrT1WRW+p43nIkJvAYOtpDQWzWZahv1eZMMMRw8BhDFGm9/oPIkXQqct3B I4QAuV1dUII9y3Dt6dE+8M2cCpI+o2KIrLd3HIBhLViKEflUetUFsTQ1yn2lPWMiRo8Y 03bzSseIPxfKrd+dBFUXY87w7rYnpV858Ivbn7qmbn/HgkevOrV4tYMfPIHHMaiweUfd GRrQmWIZfQ5niZdo7IItHqQBhceMWpP9JJa232Ygk+BfZhSevU4jiORmdIjQ621iRv1I LnhI5+q2pZqBEaQBjjd7BzEXGve+Tyyl6OziuNz18us0pZMHtgwkbQbMOrMIfCVXg5Yw Ag== Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 36s0eax0w2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Feb 2021 03:26:40 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 3C03157; Thu, 18 Feb 2021 03:26:40 +0000 (UTC) Received: from KIDKMZDU3U.asiapacific.hpqcorp.net (kidkmzdu3u.asiapacific.hpqcorp.net [10.43.42.163]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id A19C34D; Thu, 18 Feb 2021 03:26:38 +0000 (UTC) From: "Li, Walon" To: devel@edk2.groups.io Cc: walon.li@hpe.com, sunnywang@hpe.com, lersek@redhat.com, ray.ni@intel.com, hao.a.wu@intel.com Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder Date: Thu, 18 Feb 2021 11:26:11 +0800 Message-Id: <20210218032611.1594-1-walon.li@hpe.com> X-Mailer: git-send-email 2.23.0.windows.1 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-02-18_01:2021-02-16,2021-02-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 impostorscore=0 suspectscore=0 spamscore=0 clxscore=1011 adultscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 mlxlogscore=769 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102180026 Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3135 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 --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePk= g/Library/UefiBootManagerLib/BmBoot.c index aff620ad52..26d1fb0ea0 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -2505,7 +2505,7 @@ BmRegisterBootManagerMenu ( EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);=0D );=0D =0D - return EfiBootManagerAddLoadOptionVariable (BootOption, 0);=0D + return EfiBootManagerAddLoadOptionVariable (BootOption, (UINTN) -1));=0D }=0D =0D /**=0D --=20 2.23.0.windows.1