From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9771.1597128204307372847 for ; Mon, 10 Aug 2020 23:43:25 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) IronPort-SDR: aalOIDTLSCJSsBP0flWXXx7yceqQ6Y8wtFih1WXyxcjHUnXsGZ9vkdr0cx4lqanZtK/kRMI2JV JEcMVMcAzfXw== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="215195326" X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="215195326" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2020 23:43:13 -0700 IronPort-SDR: UNu8V7XaeAeo0HgDxeubMxnsIAqOjAU9WJRkNeRjvGMnSOU2yh5/yiV4G3qgvmqD34WE7PxDQ7 AeVw7fMiA6mA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="334477045" Received: from fieedk001.ccr.corp.intel.com ([10.239.153.108]) by orsmga007.jf.intel.com with ESMTP; 10 Aug 2020 23:43:11 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Gary Lin , Andrew Fish Subject: [PATCH 1/3] MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBR Date: Tue, 11 Aug 2020 14:43:00 +0800 Message-Id: <20200811064302.33188-2-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200811064302.33188-1-zhichao.gao@intel.com> References: <20200811064302.33188-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823 Refer to UEFI spec 2.8, Section 13.3.2, a block device should be scanned as below order: 1. GPT 2. ISO 9660 (El Torito) (UDF should aslo be here) 3. MBR 4. no partition found Note: UDF is using the same boot method as CD, so put it in the same priority with ISO 9660. This would also solve the issue that ISO image with MBR would be treat as MBR device instead of CD/DVD. That would make the behavior of the image boot different. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Gary Lin Cc: Andrew Fish Signed-off-by: Zhichao Gao --- MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c index 6a43c3cafb..473e091320 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -35,11 +35,19 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = { // // Prioritized function list to detect partition table. +// Refer to UEFI Spec 13.3.2 Partition Discovery, the block device +// should be scanned in below order: +// 1. GPT +// 2. ISO 9660 (El Torito) (or UDF) +// 3. MBR +// 4. no partiton found +// Note: UDF is using a same method as booting from CD-ROM, so put it along +// with CD-ROM check. // PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = { PartitionInstallGptChildHandles, - PartitionInstallMbrChildHandles, PartitionInstallUdfChildHandles, + PartitionInstallMbrChildHandles, NULL }; -- 2.21.0.windows.1