From nobody Sat Apr 27 01:07:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61633+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61633+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1592978206; cv=none; d=zohomail.com; s=zohoarc; b=HpLHKirKk3lsrfvk4d/5QUFxNDRLRFnl8jo3ShtfkYAk3mIT9JjMWuNS2RxPdH5s6zStGLPBtNVQx/H4BYL0sMHBaY/PNQq6ysc4f/MH+nqnUeY7yMHZHOndpXvTfxk/ZBZ4zDS0DldcdOsddN6nfIF7vaC/OXOq59AmuKVcMOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592978206; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=TorOdS4og860NHDJ4UAWx25juG2eftFVcWj4gJH4v3Y=; b=fqyUllttz08FocEYI2I99Mj6aGTOss3mpk+iU+8faReLvVOVAudxMH6E3gvz9A0yGWcdWMR40F2tbOoYYuhKu3f/IUBrWkgHrNassc3J04oO5tDnjoe1XNlfIbdfxOQpa9do0KgJcLmgdVOyYSomK36s++ITMh+x2D1/8pbzOZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61633+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1592978206175152.96622731055368; Tue, 23 Jun 2020 22:56:46 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UZJjYY1788612x4BCHtY1RbF; Tue, 23 Jun 2020 22:56:45 -0700 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.7718.1592978205302585006 for ; Tue, 23 Jun 2020 22:56:45 -0700 IronPort-SDR: +DxWQ5BPUbyyUwUcx0IXD7MnICRzjnAnI52ZU2ICl2EefSfZAUfTkD3zm/xIT2fgzS7jpgxYeo 0KrooXGlVjvQ== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="124010229" X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="124010229" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2020 22:56:43 -0700 IronPort-SDR: nsh7kFThxweDn2NHbLxgytsjAHyHaZGSZDuQVishO5UQQbXLr6zNIUV1xK6k2zijahnJgGbkYm 8zujYuQtkBNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="423261316" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.114]) by orsmga004.jf.intel.com with ESMTP; 23 Jun 2020 22:56:37 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni , Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH] MdeModulePkg/PartitionDxe: Seperate the Udf handler Date: Wed, 24 Jun 2020 13:56:10 +0800 Message-Id: <20200624055610.13984-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: 4WkOfHaz4BaGd4ZtlcrWQzAlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1592978205; bh=jf22UvUwBEjqdB2HHiPN7NO6VBDMgxKFcRfm2ovJhac=; h=Cc:Date:From:Reply-To:Subject:To; b=apf+NGCEGON2H9LLGnbaLgaPo4guH/mtyu0MwgftFWjS6965KW6HuySz0SYPoxeTD+2 wDCj9TLW/b9vqr8II3FbJP3w09M93oaiZfVp+VhIdulzCoy7VOogOYIX9N5/1XlEbq3+V kgs4ygObQkOFENTnmFbYuZDKSh9e5VFYb4U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 Some linux iso like Redhat would contain both MBR info in the first 512 bytes and volume info at the beginning of 32KB offset. But the partition driver would only choose one of the GPT, MBR, and UDF(el torito compatible) to install the partition. That would lose one info for such linux ISO during one connect. And UDF(el torito compatible) is not conflicted with MBR/GPT. So partition driver should check UDF and MBR/GPT separately. Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Signed-off-by: Zhichao Gao --- .../Universal/Disk/PartitionDxe/Partition.c | 52 +++++++++++++------ 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModu= lePkg/Universal/Disk/PartitionDxe/Partition.c index d1c878ad2e..562490db4f 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -5,7 +5,7 @@ MBR, and GPT partition schemes are supported. =20 Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc. -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -39,7 +39,6 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding =3D { PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] =3D { PartitionInstallGptChildHandles, PartitionInstallMbrChildHandles, - PartitionInstallUdfChildHandles, NULL }; =20 @@ -189,6 +188,8 @@ PartitionDriverBindingStart ( { EFI_STATUS Status; EFI_STATUS OpenStatus; + EFI_STATUS UdfStatus; + EFI_STATUS GptMbrStatus; EFI_BLOCK_IO_PROTOCOL *BlockIo; EFI_BLOCK_IO2_PROTOCOL *BlockIo2; EFI_DISK_IO_PROTOCOL *DiskIo; @@ -300,26 +301,47 @@ PartitionDriverBindingStart ( if (BlockIo->Media->MediaPresent || (BlockIo->Media->RemovableMedia && !BlockIo->Media->LogicalPartition= )) { // - // Try for GPT, then legacy MBR partition types, and then UDF and El T= orito. - // If the media supports a given partition type install child handles = to - // represent the partitions described by the media. + // Try for UDF (El TOrito compatible) and GPT/MBR partition types. + // If the media supports a given partition type, it would install chil= d handles + // to represent the partitions described by the media. + // Notes: GPT is conflicted with MBR. It would only install one of the= m to describe + // the partition. UDF (or El Torito) can exist with MBR, so need to ch= eck it along with + // GPT/MBR. // + UdfStatus =3D PartitionInstallUdfChildHandles ( + This, + ControllerHandle, + DiskIo, + DiskIo2, + BlockIo, + BlockIo2, + ParentDevicePath + ); + Routine =3D &mPartitionDetectRoutineTable[0]; while (*Routine !=3D NULL) { - Status =3D (*Routine) ( - This, - ControllerHandle, - DiskIo, - DiskIo2, - BlockIo, - BlockIo2, - ParentDevicePath - ); - if (!EFI_ERROR (Status) || Status =3D=3D EFI_MEDIA_CHANGED || Status= =3D=3D EFI_NO_MEDIA) { + GptMbrStatus =3D (*Routine) ( + This, + ControllerHandle, + DiskIo, + DiskIo2, + BlockIo, + BlockIo2, + ParentDevicePath + ); + if (!EFI_ERROR (GptMbrStatus) || GptMbrStatus =3D=3D EFI_MEDIA_CHANG= ED || GptMbrStatus =3D=3D EFI_NO_MEDIA) { break; } Routine++; } + + if (!EFI_ERROR (UdfStatus) || !EFI_ERROR (GptMbrStatus)) { + Status =3D EFI_SUCCESS; + } else if (UdfStatus =3D=3D EFI_MEDIA_CHANGED || GptMbrStatus =3D=3D E= FI_MEDIA_CHANGED) { + Status =3D EFI_MEDIA_CHANGED; + } else if (UdfStatus =3D=3D EFI_NO_MEDIA || GptMbrStatus =3D=3D EFI_NO= _MEDIA) { + Status =3D EFI_NO_MEDIA; + } } // // In the case that the driver is already started (OpenStatus =3D=3D EFI= _ALREADY_STARTED), --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61633): https://edk2.groups.io/g/devel/message/61633 Mute This Topic: https://groups.io/mt/75076631/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-