From nobody Thu Dec 26 01:24:19 2024 Delivered-To: importer@patchew.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; 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 Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 150485137989441.018653593706404; Thu, 7 Sep 2017 23:16:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BD37321CEB0F8; Thu, 7 Sep 2017 23:13:25 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 2F1CF20945BF1 for ; Thu, 7 Sep 2017 23:13:24 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 23:16:15 -0700 Received: from xianhu2x-mobl.ccr.corp.intel.com ([10.239.196.76]) by orsmga002.jf.intel.com with ESMTP; 07 Sep 2017 23:16:14 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,360,1500966000"; d="scan'208";a="133093396" From: xianhu2x To: edk2-devel@lists.01.org Date: Fri, 8 Sep 2017 14:16:10 +0800 Message-Id: <20170908061610.9580-1-xianhuix.liu@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 Subject: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Ubuntu boot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 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: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add Ubuntu boot loader file path \\EFI\\UBUNTU\\GRUBX64.EFI into known OS l= oader list. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: xianhu2x --- .../Library/GenericBdsLib/BdsBoot.c | 28 ++++++++++++++++++= ++++ Core/MdePkg/Include/Uefi/UefiSpec.h | 11 +++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b= /Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index d1da635f3..ce1dd4a0b 100644 --- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -2384,6 +2384,22 @@ BdsLibBootViaBootOption ( 0, &ImageHandle ); + + if (EFI_ERROR(Status)) { + // + //Try Ubuntu boot loader + // + FilePath =3D FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_= NAME_UBUNTU_X64); + Status =3D gBS->LoadImage ( + TRUE, + gImageHandle, + FilePath, + NULL, + 0, + &ImageHandle + ); + } + =20 } } } @@ -3721,6 +3737,18 @@ BdsLibGetBootableHandle ( &DosHeader, Hdr ); + + if (EFI_ERROR(Status)) { + // + //Try Ubuntu boot loader + // + Status =3D BdsLibGetImageHeader ( + SimpleFileSystemHandles[Index], + EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU_X64, + &DosHeader, + Hdr + ); + } if (!EFI_ERROR (Status) && EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32->FileHeader.Machine) && Hdr.Pe32->OptionalHeader.Subsystem =3D=3D EFI_IMAGE_SUBSYSTEM_EFI_= APPLICATION) { diff --git a/Core/MdePkg/Include/Uefi/UefiSpec.h b/Core/MdePkg/Include/Uefi= /UefiSpec.h index 57cb4e804..e5556952b 100644 --- a/Core/MdePkg/Include/Uefi/UefiSpec.h +++ b/Core/MdePkg/Include/Uefi/UefiSpec.h @@ -2166,11 +2166,12 @@ typedef struct { // // EFI File location to boot from on removable media devices // -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.E= FI" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.E= FI" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EF= I" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EF= I" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.E= FI" +#define EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU_X64 L"\\EFI\\UBUNTU\\GRUBX64.= EFI" =20 #if defined (MDE_CPU_IA32) #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA= 32 --=20 2.14.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel