Page MenuHomeFreeBSD

loader.efi: efipart needs better support detecting nested partitions
ClosedPublic

Authored by tsoome on Mon, Nov 25, 9:56 PM.

Details

Summary

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:

  1. we fetch handle array and create linked list of block devices.
  2. we walk the list and detect parent devices and set children pd_parent.
  3. 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

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tsoome created this revision.Mon, Nov 25, 9:56 PM
tsoome updated this revision to Diff 64886.Tue, Nov 26, 12:07 PM

Wrong place for efi_devpath_trim.
No need to walk partitions in efipart_find_parent.
No need for local variable.

tsoome updated this revision to Diff 64949.Wed, Nov 27, 5:38 PM

left over debug printf.

tsoome updated this revision to Diff 65003.Thu, Nov 28, 1:37 PM

need to handle usb luns

tsoome updated this revision to Diff 65047.Fri, Nov 29, 10:59 AM

really check the device node type. Free unused devpaths by calling
efi_close_devpath().

tsoome edited the summary of this revision. (Show Details)Sat, Nov 30, 9:08 AM
This revision was not accepted when it landed; it landed in state Needs Review.Sat, Nov 30, 9:11 AM
This revision was automatically updated to reflect the committed changes.