Skip to contentSkip to conversation

Blacklisting certain functions on a USB device in udev?

DISCUSSION Justin Schoeman 1 participant 2 messages Nov 9, 2009 – Nov 11, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

I am trying to get my Huawei E220 3G modem working with the new Linux kernels.

The USB device registers 3 functions. 2 usb-serial devices, and 1 usb-storage device. Unfortunately, a firmware bug is causing the device to reset when userland apps try to mount the usb-storage device.

A simple way to get things working is to just kill udevd after the serial ports are registered, and before the scsi device scan completes, but obviously this is not ideal ;-) .

I have been experimenting by creating /etc/udev/rules.d/01-blacklist, and adding rules to try ignore the storage device.

This:
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", OPTIONS:="ignore_device"

successfully ignores the USB device entirely (serial and storage options).

This:
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", ATTRS{bInterfaceClass}="08", OPTIONS:="ignore_device"

should only match the storage device, and ignore it, but it doesn't seem to work.

I have tried more exotic solutions like:
SUBSYSTEM="usb-serial", ATTRS{idVendor}="12d1", GOTO="blacklist_skip_huawei"
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", OPTIONS:="ignore_device" LABEL="blacklist_skip_huawei"

but the storage device is still mounted.

Is there any way to debug the rule parsing to see exactly which rules are matched/violated?

Can anybody perhaps help with tips/advice on how to construct this blacklist?

Thanks,
Justin

PS I am not subscribed to the list. Please CC me any replies.

#1 lore raw

Ping?

Can anybody at least point me at a decent resource on how to build udev rules?

Thanks,
Justin

Quoted 48 lines · Justin Schoeman

Hi all,

I am trying to get my Huawei E220 3G modem working with the new Linux kernels.

The USB device registers 3 functions. 2 usb-serial devices, and 1 usb-storage device. Unfortunately, a firmware bug is causing the device to reset when userland apps try to mount the usb-storage device.

A simple way to get things working is to just kill udevd after the serial ports are registered, and before the scsi device scan completes, but obviously this is not ideal ;-) .

I have been experimenting by creating /etc/udev/rules.d/01-blacklist, and adding rules to try ignore the storage device.

This:
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", OPTIONS:="ignore_device"

successfully ignores the USB device entirely (serial and storage options).

This:
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", ATTRS{bInterfaceClass}="08", OPTIONS:="ignore_device"

should only match the storage device, and ignore it, but it doesn't seem to work.

I have tried more exotic solutions like:
SUBSYSTEM="usb-serial", ATTRS{idVendor}="12d1", GOTO="blacklist_skip_huawei"
SUBSYSTEMS="usb", ATTRS{idVendor}="12d1", OPTIONS:="ignore_device" LABEL="blacklist_skip_huawei"

but the storage device is still mounted.

Is there any way to debug the rule parsing to see exactly which rules are matched/violated?

Can anybody perhaps help with tips/advice on how to construct this blacklist?

Thanks,
Justin

PS I am not subscribed to the list. Please CC me any replies.