On Mon, 8 Mar 2010, David Young wrote: > On Mon, Mar 08, 2010 at 12:34:23PM -0700, Ted Lemon wrote: > > On Mar 8, 2010, at 12:47 AM, Masao Uebayashi wrote: > > > How do you write a kernel config which can always identify my USB disk as > > > sd0a, even if I plug random devices? > > > > You'd need to put the UUID in the kernel config. > > I'd go further and say that we should be able to supply a set of device > properties (such as drvctl -p prints) to the kernel. Let us match a > device by its intrinsic properties (MAC address, serial number, and/or > GUID), and set the unit number according to the device property. > > Quentin is right that this *only* helps us to fix the unit number, but I > think that in itself is an important, *feasible* step forward.
One thing that I think is problematic about trying to do that, is that you might sometimes need to attach a device (allocate the unit number) in order to discover its intrinsic properties. It can't always be done in the attach routine because you might have to wait for a query (or several) to return. For that reason, we should consider that the dv_xname is not necessarily a useful tag. (I say "device" rather than disk because I know that Bluetooth controllers work this way - you can't get the BDADDR until it is up and running) I have never used wedges but, for the disk case, would it not be better to make a method of configuring a dk in advance, so that whenever a disk appears with the correct parameters it will already be mapped to the dk you expect? (perhaps a daemon could handle it) Then you know that /dev/dk3 is your USB stick and will never be anything else.. iain