[elrepo] kmod-option, buggy?

Dag Wieers dag at wieers.com
Thu Dec 17 12:13:46 EST 2009


On Thu, 17 Dec 2009, Alan Bartlett wrote:

> 2009/12/13 Clinton Lee Taylor <clintonlee.taylor at gmail.com>:
>
>>  Using kmod-option, so that we can use a USB Dongle Huawei E220 3G
>> device, I have found that first time we connect the USB device, it
>> works fine, but if we remove the USB device and reconnect it without
>> unloading module option, then the /dev/ttyUSB0 and /dev/ttyUSB1 don't
>> come back.  If I unload module option and reconnect, then all works
>> fine.
>
> How about writing a udev rule for the device?
>
> With the E220 device connected to your system, use the udevinfo
> command to examine the information related to it that has been created
> under the /sys/ directory.
>
> Then create a file, say 99-Huawei-E220.rules, owner/group == root,
> mode == 0644, in your /etc/udev/rules.d/ directory with contents
> something like the following --
>
> [quote]
> SUBSYSTEM=="usb", ATTRS{model}=="whatever", RUN+="/sbin/modprobe -r
> option 2>/dev/null; /sbin/modprobe option"
> [/quote]
>
> (I have typed one line above -- if a new-line is inserted, it is the
> MTA effect and should be disregarded.)
>
> Obviously that rule is incomplete. You will need to read up on udev
> rule creation [1] and decide the correct means to identify when the
> device is plugged in.

You first have to test whether the problem is only the missing device 
node entry, or in fact a module issue. In general it is a bad idea to 
unload/reload a module from udev. I can imagine the module load to 
generate another udev event, causing another unload, reload ad infinitum.

If the problem is just that upon connecting the USB device the device 
nodes are not created, then you need a udev rule for creating them. 
That's how it is supposed to be on Linux nowadays, so not a module 
problem in se.

-- 
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[Any errors in spelling, tact or fact are transmission errors]


More information about the elrepo mailing list