]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r355224, r355308, r355392:
authorToomas Soome <tsoome@FreeBSD.org>
Mon, 9 Dec 2019 16:21:26 +0000 (16:21 +0000)
committerToomas Soome <tsoome@FreeBSD.org>
Mon, 9 Dec 2019 16:21:26 +0000 (16:21 +0000)
commit106363755d7cbe90453f72de51f46645e259e1a1
tree383ec520efde0177b63b9405745c02c82bf63d7c
parent3b2a2e12d27f09bc7e6b7ee3e92efa335508c9bb
MFC r355224, r355308, r355392:
loader.efi: efipart needs better support detecting nested partitions

Just as disks can have nested partitions, the same happens with cd devices,
so we need to detect device paths and make sure we will not mix the handles.

To address this:

we fetch handle array and create linked list of block devices.
we walk the list and detect parent devices and set children pd_parent.
for {fd, cd, hd}, we walk device list and pick up our devices and store to
corresponding list. We make sure we store parent device first.

For sorting we use 3 steps: We check for floppy, we check for cd and then
everything else must be hd.

In general, it seems the floppy devices have no parent.
CD can have both parents and children (multiple boot entries, partitions
from the hybrid disk image).

Tested by: cross+freebsd@distal.com on Cisco UCS systems, C200 series (C220M5, C240M4, C220M3).
Also on MBP with UEFI 1.10
stand/efi/include/efidevp.h
stand/efi/include/efilib.h
stand/efi/libefi/devpath.c
stand/efi/libefi/efipart.c