audk/MdeModulePkg
Gary Lin 02021d2ea4 MdeModulePkg/UefiBootManagerLib: Match the nested partitions
In some cases, such as MD RAID1 in Linux, the bootloader may be in a
nested EFI system partition partition. For example, sda1 and sdb1 are
combined as md0 and the first partition of md0, md0p1, is an EFI system
partition. Then, the bootloader can be located by the following device
paths:

PCI()/SATA(sda)/Partition(sda1)/Partition(md0p1)/File(bootloader.efi)
PCI()/SATA(sdb)/Partition(sdb1)/Partition(md0p1)/File(bootloader.efi)

To make the boot option more resilient, we may create a boot option with
the short-form device path like "Partition(md0p1)/File(bootloader.efi)".

However, BmMatchPartitionDevicePathNode() only matched the first
partition node and ignored the nested partitions, so the firmware would
refuse to load bootloader.efi since "Partition(md0p1)" doesn't match
either "Partition(sda1)" or "Partition(sda2)".

This commit modifies BmMatchPartitionDevicePathNode() to iterate all
nested partitions so that the above boot option could work.

v2 - Simplify the node matching logic

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-01-31 12:25:36 +08:00
..
Application MdeModulePkg CapsuleApp:Remove two redundant Guids 2018-09-21 11:34:42 +08:00
Bus MdeModulePkg/NonDiscoverablePciDevice: Remove the redundant check 2019-01-08 09:59:30 +08:00
Core MdeModulePkg/Dxe/Page: take MAX_ALLOC_ADDRESS into account 2018-12-20 11:01:58 +01:00
Include MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency 2018-11-20 13:46:57 +08:00
Library MdeModulePkg/UefiBootManagerLib: Match the nested partitions 2019-01-31 12:25:36 +08:00
Logo MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Universal MdeModulePkg VariableStandaloneMm: Add PcdEmuVariableNvModeEnable in inf 2019-01-25 11:41:14 +08:00
MdeModulePkg.dec MdeModulePkg: Refine description a little for PcdEmuVariableNvStoreReserved 2019-01-24 10:52:36 +08:00
MdeModulePkg.dsc MdeModulePkg/MdeModulePkg.dsc: ignore standalone MM modules for EBC or XCODE5 2019-01-28 11:24:01 +01:00
MdeModulePkg.uni MdeModulePkg: Refine description a little for PcdEmuVariableNvStoreReserved 2019-01-24 10:52:36 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00