From nobody Fri Mar 29 15:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1533281043060920.6110495428186; Fri, 3 Aug 2018 00:24:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 121AE210D6CC4; Fri, 3 Aug 2018 00:24:02 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 447B8210C515D for ; Fri, 3 Aug 2018 00:24:01 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 00:24:00 -0700 Received: from xianhu2x-mobl.ccr.corp.intel.com ([10.239.196.136]) by orsmga001.jf.intel.com with ESMTP; 03 Aug 2018 00:23:59 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=xianhuix.liu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,437,1526367600"; d="scan'208";a="78375159" From: xianhu2x To: edk2-devel@lists.01.org Date: Fri, 3 Aug 2018 15:23:57 +0800 Message-Id: <20180803072357.6980-1-xianhuix.liu@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Boot Option Fix X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RDMRC_1 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Detect if EFI Shell file is present before adding boot option for it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: xianhu2x --- .../PlatformBootManagerLib/PlatformBootOption.c | 51 ++++++++++--------= ---- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/Platform/BroxtonPlatformPkg/Common/Library/PlatformBootManager= Lib/PlatformBootOption.c b/Platform/BroxtonPlatformPkg/Common/Library/Platf= ormBootManagerLib/PlatformBootOption.c index c77b20f686..0eec6ca081 100644 --- a/Platform/BroxtonPlatformPkg/Common/Library/PlatformBootManagerLib/Pla= tformBootOption.c +++ b/Platform/BroxtonPlatformPkg/Common/Library/PlatformBootManagerLib/Pla= tformBootOption.c @@ -272,35 +272,34 @@ CreateFvBootOption ( =20 EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid); =20 - if (!CompareGuid (&gUefiShellFileGuid, FileGuid)) { + Status =3D gBS->HandleProtocol ( + gImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID **) &LoadedImage + ); + if (!EFI_ERROR (Status)) { Status =3D gBS->HandleProtocol ( - gImageHandle, - &gEfiLoadedImageProtocolGuid, - (VOID **) &LoadedImage + LoadedImage->DeviceHandle, + &gEfiFirmwareVolume2ProtocolGuid, + (VOID **) &Fv ); if (!EFI_ERROR (Status)) { - Status =3D gBS->HandleProtocol ( - LoadedImage->DeviceHandle, - &gEfiFirmwareVolume2ProtocolGuid, - (VOID **) &Fv + Buffer =3D NULL; + Size =3D 0; + Status =3D Fv->ReadSection ( + Fv, + FileGuid, + EFI_SECTION_PE32, + 0, + &Buffer, + &Size, + &AuthenticationStatus ); - if (!EFI_ERROR (Status)) { - Buffer =3D NULL; - Size =3D 0; - Status =3D Fv->ReadSection ( - Fv, - FileGuid, - EFI_SECTION_PE32, - 0, - &Buffer, - &Size, - &AuthenticationStatus - ); - if (Buffer !=3D NULL) { - FreePool (Buffer); - } + if (Buffer !=3D NULL) { + FreePool (Buffer); } } + } if (EFI_ERROR (Status)) { return EFI_NOT_FOUND; } @@ -309,12 +308,6 @@ CreateFvBootOption ( DevicePathFromHandle (LoadedImage->DeviceHandle), (EFI_DEVICE_PATH_PROTOCOL *) &FileNode ); - } else { - DevicePath =3D AppendDevicePathNode ( - BdsCreateShellDevicePath (), - (EFI_DEVICE_PATH_PROTOCOL *) &FileNode - ); - } =20 Status =3D EfiBootManagerInitializeLoadOption ( BootOption, --=20 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel