]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
loader.efi: efipart needs better support detecting nested partitions
authortsoome <tsoome@FreeBSD.org>
Sat, 30 Nov 2019 09:11:28 +0000 (09:11 +0000)
committertsoome <tsoome@FreeBSD.org>
Sat, 30 Nov 2019 09:11:28 +0000 (09:11 +0000)
commit8ec52a500f0ae99c250683d04da605856dde1391
tree08f24ac9da34a5ae098afff0294434ef584d8726
parentfbcdae245c1e6a824fae27b9d09b7cc2f9bed46c
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).
Also on MBP with UEFI 1.10

Reported by: Chriss Ross
MFC after: 1w
Differential Revision: https://reviews.freebsd.org/D22553
stand/efi/include/efidevp.h
stand/efi/include/efilib.h
stand/efi/libefi/devpath.c
stand/efi/libefi/efipart.c