Hannes Reinecke | 4 Mar 2008 10:06
Picon

Re: no INQUIRY from userspace please

Hi Doug,

Douglas Gilbert wrote:
> Stefan Richter wrote:
>>> James Bottomley wrote:
>>>> It's all very well to say this, but I think if you look at what udev
>>>> does, you'll find that it uses scsi_id to send a VPD inquiry to the
>>>> device so it can populate /dev/disk/by-id, so the point is already
>>>> conceded
>>
>> PS:  Alas we don't have a practicable way to know how many of the
>>   - doesn't work with Linux but works to some degree with Windows,
>>   - doesn't work with a 2.6 based Linux distro but did work with a
>>     2.4 based distro
>> kinds of devices are those with this INQUIRY bug or similar bugs.
>>
>> While non-udev distros slowly went out of fashion on the desktop, there
>> was a certain frequency of reports of the latter kind of FireWire
>> devices, but this was before I became aware of that kind of firmware
>> bug, therefore I don't have any data whether it played a role for these
>> cases.
> 
> Just a small point here. To my knowledge all devices
> that understand the SCSI command set will accept a
> 36 byte INQUIRY (i.e. an INQUIRY with an "allocation length"
> of 36). That is a practical consideration since they would
> crash on Windows otherwise.
> 
> Now scsi_id (and probably other programs of that ilk
> (including some of mine)) get excited when they get a
(Continue reading)

Greg KH | 6 Mar 2008 07:15
Gravatar

[PATCH] add 85-devices.rules for device specific rules that might be needed.

Start it off with a Novatel modem that must be ejected to work properly

Signed-off-by: Greg Kroah-Hartman <gregkh <at> suse.de>

diff --git a/etc/udev/rules.d/85-devices.rules b/etc/udev/rules.d/85-devices.rules
new file mode 100644
index 0000000..5d82fc0
--- /dev/null
+++ b/etc/udev/rules.d/85-devices.rules
 <at>  <at>  -0,0 +1,8  <at>  <at> 
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add", GOTO="devices_end"
+
+# Novatel USB devices need to be ejected so as to work properly as a modem
+SYSFS{idProduct}=="5010", SYSFS{idVendor}=="1410", RUN+="/usr/bin/eject %k"
+
+LABEL="devices_end"
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Bill Nottingham | 6 Mar 2008 18:16
Picon
Favicon
Gravatar

Re: [PATCH] add 85-devices.rules for device specific rules that might be needed.

Greg KH (greg <at> kroah.com) said: 
> Start it off with a Novatel modem that must be ejected to work properly

*ejected*? Do I even want to know why?

Bill
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Bill Nottingham | 6 Mar 2008 18:22
Picon
Favicon
Gravatar

network: consistent names in the absence of prior configuration?

For things like storage devices, even if you have no prior configuration
in udev, by-path, by-label, by-uuid, and by-id should be 1) reasonably
deducible by the admin/user 2) consistent across boots/installs of the
same machine without adding any prior configuration.

Is there any mechanism at all to accomplish the same thing for network
devices?

Bill
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Marco d'Itri | 6 Mar 2008 18:41
Picon
Favicon

Re: [PATCH] add 85-devices.rules for device specific rules that might be needed.

On Mar 06, Bill Nottingham <notting <at> redhat.com> wrote:

> Greg KH (greg <at> kroah.com) said: 
> > Start it off with a Novatel modem that must be ejected to work properly
> *ejected*? Do I even want to know why?
"Smart" devices which may appear either as a mass storage device which
contains windows drivers or as the device itself.

--

-- 
ciao,
Marco
Bill Nottingham | 6 Mar 2008 18:58
Picon
Favicon
Gravatar

Re: network: consistent names in the absence of prior configuration?

Bryan Kadzban (bryan <at> kadzban.is-a-geek.net) said: 
> On Thu, Mar 06, 2008 at 12:22:24PM -0500, Bill Nottingham wrote:
> > For things like storage devices, even if you have no prior configuration
> > in udev, by-path, by-label, by-uuid, and by-id should be 1) reasonably
> > deducible by the admin/user 2) consistent across boots/installs of the
> > same machine without adding any prior configuration.
> > 
> > Is there any mechanism at all to accomplish the same thing for network
> > devices?
> 
> There are the persistent-net rules, but they're not quite as good as the
> storage rules (it sounds like you already knew that).

Those don't have any value without either prior runs, or manual
pre-configuration, though. Basically, my concern is:

You do a fresh install on a clean box.

No matter what your what order your SCSI drivers are loaded in, a 
particular disk will be at

 /dev/by-id/ata-<model>_<serial>

or

 /dev/by-path/pci-<controller-bus-address>-scsi-≤host:channel:id:lun>

etc., even if it's not /dev/sda. This will be consistent no matter how
many times you wipe the same box and reinstall.

(Continue reading)

Bryan Kadzban | 6 Mar 2008 18:51

Re: network: consistent names in the absence of prior configuration?

On Thu, Mar 06, 2008 at 12:22:24PM -0500, Bill Nottingham wrote:
> For things like storage devices, even if you have no prior configuration
> in udev, by-path, by-label, by-uuid, and by-id should be 1) reasonably
> deducible by the admin/user 2) consistent across boots/installs of the
> same machine without adding any prior configuration.
> 
> Is there any mechanism at all to accomplish the same thing for network
> devices?

There are the persistent-net rules, but they're not quite as good as the
storage rules (it sounds like you already knew that).

One thing that might help the network rules is a way (in the kernel) to
create something that acts like a symlink for a network device.  In other
words, be able to add a second (and third, and fourth) name to a given
NIC, and have all the names stay valid.  This way the rules could create
two "symlink" NICs, e.g. by-mac-01-02-03-04-05-06 and by-path-whatever.
Of course I have no idea what the impact of a change like that would be,
especially on VLAN interfaces (ethX.Y) and interfaces that get created
when you add a second IP to a "base" interface (ethX:Y).

(However, I'm not sure if that will actually solve the problem or not.)

Marco d'Itri | 6 Mar 2008 19:07
Picon
Favicon

Re: network: consistent names in the absence of prior configuration?

On Mar 06, Bill Nottingham <notting <at> redhat.com> wrote:

> However, there's nothing to handle network devices in this way, as far
> as I can tell; each fresh install you do, you can get essentially random
Matt Domsch wrote a program which tries hard to find the network
interfaces names in the BIOS/ACPI data.

--

-- 
ciao,
Marco
Greg KH | 6 Mar 2008 19:18
Gravatar

Re: [PATCH] add 85-devices.rules for device specific rules that might be needed.

On Thu, Mar 06, 2008 at 06:41:29PM +0100, Marco d'Itri wrote:
> On Mar 06, Bill Nottingham <notting <at> redhat.com> wrote:
> 
> > Greg KH (greg <at> kroah.com) said: 
> > > Start it off with a Novatel modem that must be ejected to work properly
> > *ejected*? Do I even want to know why?
> "Smart" devices which may appear either as a mass storage device which
> contains windows drivers or as the device itself.

That is exactly right, this device shows up as a usb cdrom with the
windows driver on it.  It needs to be "ejected" in order to disconnect
itself and come back as the "real" usb modem device.

This kind of configuration is becoming more common these days, I know of
at least 2 other companies doing the same thing for different types of
devices.  I guess it's cheaper than shipping a driver disk in the box...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Bill Nottingham | 6 Mar 2008 20:53
Picon
Favicon
Gravatar

Re: [PATCH] add 85-devices.rules for device specific rules that might be needed.

Greg KH (greg <at> kroah.com) said: 
> On Thu, Mar 06, 2008 at 06:41:29PM +0100, Marco d'Itri wrote:
> > On Mar 06, Bill Nottingham <notting <at> redhat.com> wrote:
> > 
> > > Greg KH (greg <at> kroah.com) said: 
> > > > Start it off with a Novatel modem that must be ejected to work properly
> > > *ejected*? Do I even want to know why?
> > "Smart" devices which may appear either as a mass storage device which
> > contains windows drivers or as the device itself.
> 
> That is exactly right, this device shows up as a usb cdrom with the
> windows driver on it.  It needs to be "ejected" in order to disconnect
> itself and come back as the "real" usb modem device.
> 
> This kind of configuration is becoming more common these days, I know of
> at least 2 other companies doing the same thing for different types of
> devices.  I guess it's cheaper than shipping a driver disk in the box...

What determines whether it shows up as a mass-storage or modem device
on first power up? Will this rule need re-run on resume from suspend?

Bill
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane