Re: Comedi and Debian

Kinell Björn wrote:
> Hi all,
> 
> Has anyone had problems with Comedi and hotplug on Debian?
> 
> Hotplug is installed but I only get these messages:
> 
> comedi_: usbdux0 has been successfully initialized.
> usbcore: registered new driver usbdux

Hotplug has loaded the required modules okay.

> The lines I want to see:
> comedi0: usbdux: usb-device 0 is attached to comedi.
> comedi0: successfully attached to usbdux.

Those lines are output as a result of running the 'comedi_config' 
command that hotplug knows nothing about.

> Appreciate any help, thanks.

You could arrange for the comedi_config command to run with the correct 
parameters when the module is loaded by altering /etc/modules.conf (for 
2.2 or 2.4 kernels) or /etc/modprobe.conf (for 2.6 kernels).  Actually, 
you don't edit the file directly on Debian.  Instead of editing 
/etc/modules.conf, you edit a file in the /etc/modutils directory, e.g. 
/etc/modutils/usbdux, and then run the 'update-modules' command.

At this point, I declare that I do not use Debian personally (though I 
have used it on rare occasions), so some of the following information 
about how Debian deals with module configuration may be inaccurate!

The line to add to /etc/modules.conf or /etc/modutils/usbdux should be 
something similar to this (the '\' is a line continuation character):

post-install usbdux /usr/sbin/comedi_config /dev/comedi0 \
-i /path/to/firmware usbdux

(The path to comedi_config may be /usr/local/sbin if it was installed 
from source, rather than via the package manager.)

For 2.6 kernels, I'm not sure how Debian constructs /etc/modprobe.conf 
and you'd probably be better off using the UDEV system to configure the 
device rather than /etc/modprobe.conf.  For /etc/modprobe.conf, the line 
to add should be something like this:

install usbdux /sbin/modprobe usbdux; \
/usr/sbin/comedi_config /dev/comedi0 -i /path/to/firmware usbdux

The disadvantage of using /etc/modules.conf or /etc/modprobe.conf is 
that the comedi_config command is only run at module load time.  If you 
plug in a second device while the module is loaded, it won't be 
configured.  Unplugging and re-plugging a single USB device probably 
won't work either.  Maybe something could be done with the hotplug 
scripts to deal with this, but they are a bit of a mystery to me!

On 2.6 with UDEV, you could set it up to match a unique usbdux device 
and configure it with comedi_config whenever it is plugged in.  I 
haven't used UDEV much and have never done this, but in principle it is 
possible.

> /Björn Kinell

HTH,

Ian.

-- 
-=( Ian Abbott _at_ MEV Ltd.    E-mail: <abbotti_at_mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

Received on 2005-01-25Z11:56:29