Page MenuHomeFreeBSD

loader: devopen() should probe partition 'a' from freebsd slice first
AbandonedPublic

Authored by tsoome on Feb 19 2019, 8:14 AM.

Details

Reviewers
imp
ian
Summary

The traditional behavior while opening freebsd MBR slice has been to try
to open BSD partition 'a' first, if that fails, open MBR slice.

The implementation of this behavior has been in disk_open(), but it does
conflict with behavior described in common/disk.h and this update does
implement the feature in devopen() instead.

After this patch, we can update disk_open() to behave as described in
common/disk.h.

Test Plan

Confirm we can open partition 'a' from MBR slice just by providing slice:

disk2s4: FreeBSD  
  disk2s4a: FreeBSD UFS   
  disk2s4b: FreeBSD UFS

OK ls disk2s4:
disk2s4:/
d .snap

passwd

OK ls disk2s4a:
disk2s4a:/
d .snap

passwd

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 22570
Build 21703: arc lint + arc unit

Event Timeline

tsoome created this revision.Feb 19 2019, 8:14 AM
ian added a comment.Feb 20 2019, 3:24 AM

I think this is not a good solution either. It feels like more of the same thing we've been doing for 20 years... finding a small clever hack that makes the current pain go away as an alternative to doing the larger cleanup that begs to be done.

I've opened D19262 as an attempt to do the larger cleanup, by giving these magic 0 and -1 values symbolic names, and defining a new value to mean "open the raw slice".

tsoome abandoned this revision.Mar 27 2019, 8:42 PM