Page MenuHomeFreeBSD

loader: disk_open() should honor D_PARTNONE

Authored by tsoome on Jun 3 2019, 11:16 AM.



The D_PARTNONE is documented to make it possible to open raw MBR
partition, but the current disk_open() does not really implement this

The current code is checking partition against -1 (D_PARTNONE) but does
attempt to open partition table in case we do have FreeBSD MBR partition type.
Instead, we should check -2 (D_PARTWILD).

In case we do have MBR + BSD label, this code is only working because
by default, the first BSD partiton is created starting with relative sector
0, and we can still access the BSD table from that MBR slice.

Diff Detail

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

Event Timeline

tsoome created this revision.Jun 3 2019, 11:16 AM
imp accepted this revision.Jun 3 2019, 3:12 PM

I think this is good, thought I thought'd I'd committed the PARTWILD stuff already. Are there more places I/we've missed?

315 ↗(On Diff #58190)

I thought I'd already committed this change...

This revision is now accepted and ready to land.Jun 3 2019, 3:12 PM
This revision was automatically updated to reflect the committed changes.