LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   iPod udev rules for 2 different iPods (https://www.linuxquestions.org/questions/slackware-14/ipod-udev-rules-for-2-different-ipods-444425/)

Yalla-One 05-13-2006 10:29 AM

iPod udev rules for 2 different iPods
 
Why does udev recognition of my iPod break when I add the serial number to the udev rule?

My original /etc/udev/rules.d/10-local.rules works fine:
Code:

BUS="scsi", SYSFS{model}="iPod*", KERNEL="sd?2", NAME="%k", SYMLINK="ipodnano", MODE="0666"
However, when trying to add a custom rule to differentiante two iPods, nothing works:

Code:

BUS="scsi", SYSFS{model}="iPod*", SYSFS{serial}="000F2566129GA5E7", KERNEL="sd?2", NAME="%k", SYMLI
NK="ipodnano", MODE="0666"

The only thing I changed was to add the SYSFS{serial}="..." part, but for some reason, that breaks the entire recognition. I got the serial both from looking in lsusb -vv and in /sys/devices/.../usb/ directory.

Anyone? I'd really like to be able to have my ipod video as /dev/ipodvideo and the Nano as /dev/ipodnano

Any insight greatly appreciated.

-Y1

shilo 05-13-2006 11:51 AM

Just a shot in the dark, try getting rid of SYSFS{model}="iPod*". You won't need it anyway if the serial number works.

To make sure that makes sense, I am suggesting that you try:

Code:

BUS="scsi", SYSFS{serial}="000F2566129GA5E7", KERNEL="sd?2", NAME="%k", SYMLINK="ipodnano", MODE="0666"

urka58 05-14-2006 10:59 AM

Keys in udev rules must belong to the same "block".
For instance my usbdrive output looks like
looking at device '/devices/pci0000:00/0000:00:03.1/usb3/3-2/3-2:1.0/host0/target0:0:0/0:0:0:0':
ID=="0:0:0:0"
BUS=="scsi"
DRIVER=="sd"
SYSFS{ioerr_cnt}=="0x1"
SYSFS{iodone_cnt}=="0x15"
SYSFS{iorequest_cnt}=="0x15"
SYSFS{iocounterbits}=="32"
SYSFS{timeout}=="30"
SYSFS{state}=="running"
SYSFS{rev}=="1.01"
SYSFS{model}=="JUMPDRIVE "
SYSFS{vendor}=="LEXAR "
SYSFS{scsi_level}=="3"
SYSFS{type}=="0"
SYSFS{queue_type}=="none"
SYSFS{queue_depth}=="1"
SYSFS{device_blocked}=="0"
SYSFS{max_sectors}=="240"
and deeper
looking at device '/devices/pci0000:00/0000:00:03.1/usb3/3-2':
ID=="3-2"
BUS=="usb"
DRIVER=="usb"
SYSFS{configuration}==""
SYSFS{serial}=="000000105071405266050000000000000000000000000"
SYSFS{product}=="LEXR PLUG DRIVE"
SYSFS{manufacturer}=="LEXR PLUG DRIVE"
SYSFS{maxchild}=="0"
SYSFS{version}==" 1.10"
SYSFS{devnum}=="2"
SYSFS{speed}=="12"
SYSFS{bMaxPacketSize0}=="8"
SYSFS{bNumConfigurations}=="1"
SYSFS{bDeviceProtocol}=="00"
SYSFS{bDeviceSubClass}=="00"
SYSFS{bDeviceClass}=="00"
SYSFS{bcdDevice}=="0001"
SYSFS{idProduct}=="0080"
SYSFS{idVendor}=="05dc"
SYSFS{bMaxPower}==" 90mA"
SYSFS{bmAttributes}=="80"
SYSFS{bConfigurationValue}=="1"
SYSFS{bNumInterfaces}==" 1"
So if you want to set up a rule for your iPods differentiating them by serial number you must use keys in the same block ie
BUS=="usb", NAME="=sd[a-z][0-9]", KERNEL=="%k", SYSFS{product}=="LEXR PLUG DRIVE", SYSFS{serial}=="000000105071405266050000000000000000000000000", SYMLINK=="bla-bla"
Hope this helps
Ciao

Yalla-One 05-20-2006 04:27 AM

Thanks much - that hit the spot!
I now changed all my rules to match usb rather than SCSI, and I even got my old CDROM / DVD aliases to work again :)

Much appreciated!

-Y1


All times are GMT -5. The time now is 09:58 AM.