[sane-devel] Calling a script after USB scanner is plugged

Johannes Meixner jsmeix at suse.de
Fri Apr 25 06:45:42 UTC 2008


On Apr 24 22:45 Julien BLACHE wrote (shortened):
> udev is an incredible piece of crap, but the good news is that this
> piece of crap is mostly stable those days. Which is a big step forward
> already.
> (and I'll refrain from saying anything at all about the genius who
> invented udev. I'll just mention that he's also the author of "stable
> API is a nonsense".)

There he makes it very clear that
"The kernel to userspace interface is the one that
 application programs use, the syscall interface.
 That interface is _very_ stable over time,
 and will not break."

But this is in "stark contrast" to the interface of udev
(i.e. the syntax and keywords how to specify udev rules)
for applications (e.g. SANE) which provide udev rules
and for a normal user udev is completely unusable.

It seems one must talk to udev in terms of internal kernel
values (e.g. internal kernel event names and so on) instead of
a more abstract and therefore more stable higher level language.

Actually I am not interested in any internal kernel stuff.
I just like to tell udev:
"When a USB device with ID 0x1a2b:0x3c4d appears
 and when it is not already configured,
 then run my setup program and if my setup program
 exits successfully, remember the device and that
 it is already configured (even after a reboot)."

Of course it cannot work when only "my setup program"
remembers which devices it has already configured
because the user might have used another setup program
before (or did the setup manually). Therefore the
information whether or not it is already configured
must be kept at a unique central place.

Of course this requires persistent storage to keep
the device state even after a reboot and I just need
this for a well working plug-and-play user experience
but I guess the kernel people do not want to do this
for whatever internal kernel reason but again I am
actually not interested in any internal kernel stuff.
Here I am an end-user and I just want to have it work.

Kind Regards
Johannes Meixner
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex

More information about the sane-devel mailing list