You are not logged in.

#1 2009-01-23 20:18:06

axs
Member
Registered: 2009-01-23
Posts: 71
Website

udev: problems with modem initialization

Preamble: cardbus GPRS modem needs some model-specific initialization each time it is inserted into slot (setserial, currently). Also, I want to make /dev/gprs symlink pointing to this particular device. Here's two rules from /etc/udev.d/rules.d/local

SUBSYSTEM=="pci", SYSFS{vendor}=="0x14e4", SYSFS{device}=="0x4344", SYMLINK+="gprs"
SUBSYSTEM=="pci", SYSFS{vendor}=="0x14e4", SYSFS{device}=="0x4344", RUN="/lib/udev/gprs_se %k"

Problem 1: the first rule doesn't work at all.
Problem 2: there's no usable device for the script in the second rule.

Maybe somebody more experienced with udev than me would be able to help me here?

-*--

Ok, I did some investigation. The first rule starts working once I replace SYMLINK with NAME:

$ udevadm test /sys/bus/pci/devices/0000\:07\:00.0
(...)
udev_device_new_from_syspath: device 0x94f3830 has devpath '/devices/pci0000:00/0000:00:1e.0/0000:06:07.0/0000:07:00.0'
udev_rules_apply_to_event: RUN 'socket:@/org/kernel/udev/monitor' /lib/udev/rules.d/95-udev-late.rules:7
udev_rules_apply_to_event: NAME 'gprs' /etc/udev/rules.d/local.rules:5
udev_rules_apply_to_event: RUN '/lib/udev/gprs_se %k' /etc/udev/rules.d/local.rules:6
udevadm_test: run: '/lib/udev/gprs_se 0000:07:00.0'
$

with SYMLINK back there, the line just disappears:

$ udevadm test /sys/bus/pci/devices/0000\:07\:00.0
(...)
udev_device_new_from_syspath: device 0x82f8830 has devpath '/devices/pci0000:00/0000:00:1e.0/0000:06:07.0/0000:07:00.0'
udev_rules_apply_to_event: RUN 'socket:@/org/kernel/udev/monitor' /lib/udev/rules.d/95-udev-late.rules:7
udev_rules_apply_to_event: RUN '/lib/udev/gprs_se %k' /etc/udev/rules.d/local.rules:6
udevadm_test: run: '/lib/udev/gprs_se 0000:07:00.0'
$

I can't tell SYMLINK is just not recognized, because unrecognized keys result in clear warnings:

add_rule: unknown key 'FOOBAR' in /etc/udev/rules.d/local.rules:5

-*--

As for the second one, I can't find device to run setserial on. %k yields 0000:07:00.0 in my case, %N is /dev/.tmp-char-0:0, but it gives "No such device or address" (setserial works perfectly on final device, which is /dev/ttyS0 usually). Running set | logger reveals no useful values. Adding sleep before setserial to let the driver settle down doesn't help too.

Last edited by axs (2009-01-23 20:19:31)

Offline

Board footer

Powered by FluxBB