Subject: Re: devfs, was Re: FreeBSD 5/6/7 kernel emulator for NetBSD 2.x
To: Bill Studenmund <>
From: Jason Thorpe <>
List: tech-kern
Date: 10/27/2005 19:27:46
On Oct 27, 2005, at 6:14 PM, Bill Studenmund wrote:

> I can think of two other reasons for doing the maping trick. One is  
> I see
> all of this as an extension/embellishment of kernel autoconfig  
> locators.
> So the userland devfs config is an extension of the kernel's wiring  
> down.
> Since we wire down "sd3" and such now, I suggest we continue to do  
> so. I
> also think this will make it all make more sense to folks as we
> transitition.

We *CAN* wire "sd3" and such down now.  But it makes less and less  
sense in today's world, what with all of the hot-plug busses out  
there these days.

We can certainly make symlinks in the devfs form the "location name"  
to the "unit name", e.g.:

	/dev/sd3 -> /dev/sd.wwn.52004567BA64678D

(Note the lack of a letter after the name ... part of my EVIL PLAN,  

In my world, wedges would create old-style partition-letter names in  
the devfs for partition formats where that makes sense, e.g. for BSD  
disklabel wedges:

	/dev/sd3a -> /dev/dk/sd3a
	/dev/dk/sd3a -> /dev/dk5


For EFI wedges, you would not have these compatibility links, but  
instead would simply have:

	/dev/dk/nbsd4.0root -> /dev/dk0

etc.  "nbsd4.0root" being the name for that partition in the EFI  
label.  For EFI, name collisions would be handled by falling back to  
the string representation of the partition's UUID.

> Second, I think it's easier to keep track of "sd0", "sd3","sd62", and
> "sd89" than "sd.wwn.52004567BA64678D", "sd.wwn.52002E004D3E218F",
> "sd.wwn.52000F4C31D7AA70" and so on. I think it will be a lot  
> easier to
> understand log messages and to configure other parts of the system  
> if we
> have to deal with the shorter names. All of the characters in both  
> names
> are significant, but most of the wwn characters carry little human
> relevance. So I'd rather our admins focus effort on dealing with  
> devices
> and what they are doing rather than huge device names.
> I would rather not have log messages like:
> sd.wwn.52004567BA64678D(umass0:0:0:0): command aborted, data = 00  
> 00 00 00
> 04 04 00 00 00 00

I'm not suggesting reporting errors that way.  I'd keep current unit  
names for errors, or possibly have them reported up at the wedges  
layer if wedges exist for the device.

-- thorpej