Mailinglist Archive: opensuse-factory (1264 mails)

< Previous Next >
Re: [opensuse-factory] Device names in openSUSE
Am Wed, 14 Sep 2011 23:30:22 +0400
schrieb Ilya Chernykh <anixxsus@xxxxxxxxx>:

Look I just want to have USB devises to be shown with USB drive icon, as it
is
in the case of HAL. There is an algorithm for it but not working because the
usb devices
do not use the conventional ub* name.

The algorithm is broken, at least if it depends on them being named ub*
This is almost as broken as the networking stuff over 5 years ago that
depended on wireless network interfaces having certain names.

I still cannot understand why it is impossible to make USB devices to bear a
special name
like the CD/DVD ones do.

It is not impossible, see below.

It is not useful because the disk driver (the one sending the scsi
commands to it) does not know / care on which bus type they are.

But you can look that up easily in sysfs:

susi:/tmp # l /sys/block/sd*
lrwxrwxrwx 1 root root 0 Sep 14 21:33 /sys/block/sda ->
../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/


lrwxrwxrwx 1 root root 0 Sep 14 21:51 /sys/block/sdb ->
../devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1:1.0/host7/target7:0:0/7:0:0:0/block/sdb/

(I have no idea if it is a good idea to just check where the link points
to and then decide that this is an USB bus, but that would be one way of
doing it)

You could also create a udev rule that renames drives on an usb bus to
"ub*", but I would almost bet that that would break other things.

You can of course fork the linux kernel and change the drivers, so that
they do what you want.

If I was in your situation, I would just fix the algorithm to detect
drives correctly instead of depending on the device name.
--
Stefan Seyfried

"Dispatch war rocket Ajax to bring back his body!"
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-factory+help@xxxxxxxxxxxx

< Previous Next >