[sane-devel] 'scanimage -L' fails first time with modular SCSI
Fri, 01 Mar 2002 15:53:21 +0100
Henning Meier-Geinitz wrote:
> On Tue, Feb 26, 2002 at 12:03:30AM +0100, Oliver Rauch wrote:
> > We could put the routines in a dummy backend "sane-load-scsi"
> > that does nothing than touching a /dev/sg* device until
> > it was able to open one. This device should be listed as last
> > backend (if I remember right the list is called backwards).
> > This way it would be simple to disable it and it is called only once
> > when a frontend is opened.
> > (It also could be included in sane-dll).
> Both is possible. But I'm not sure if it's worth the effort. When
> someone wants to use automatic loading AND /dev/sg0 is not readable I
> think he can also use the /dev/scanner link.
We added the attach_amtching_devices beacuse it often is not possible
to define the devicefile /dev/sg* on which the scanner is connected
because this depends on the number of devices that are turned on and
the order in wich they are detected.
I think only using /dev/sg0 does not make much sense.
It could be a simple loop that opens "/dev/sg%d" with d from 0 to 15,
that would cover almost all situations.
We also do not need to do this more than once, we only have to try
to open /proc/scsi/scsi and if this fails we run the loop.
I will see if I find the time to create a patch this weekend.