Page MenuHomeFreeBSD

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

Authored by tsoome on Nov 25 2019, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 12 2024, 4:04 AM
Unknown Object (File)
Mar 5 2024, 10:18 AM
Unknown Object (File)
Feb 23 2024, 6:39 PM
Unknown Object (File)
Jan 19 2024, 1:51 AM
Unknown Object (File)
Jan 18 2024, 11:42 PM
Unknown Object (File)
Jan 11 2024, 11:04 PM
Unknown Object (File)
Dec 20 2023, 3:08 AM
Unknown Object (File)
Dec 7 2023, 5:04 PM
Subscribers

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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27778
Build 25966: arc lint + arc unit

Event Timeline

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

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

This revision was not accepted when it landed; it landed in state Needs Review.Nov 30 2019, 9:11 AM
This revision was automatically updated to reflect the committed changes.