1141cc406Sopenharmony_cihotplug/hotplug-ng hook for sane-backends
2141cc406Sopenharmony_ci-----------------------------------------
3141cc406Sopenharmony_ci
4141cc406Sopenharmony_ciThe libsane.hotplug script is intended to replace the existing hotplug scripts,
5141cc406Sopenharmony_cias those won't be usable with the new hotplug-ng. The libsane.hotplug script
6141cc406Sopenharmony_ciworks with both hotplug and hotplug-ng.  For current Linux kernels, "udev" is
7141cc406Sopenharmony_cistate of the art, see the "udev" directory instead.
8141cc406Sopenharmony_ci
9141cc406Sopenharmony_ciThis script is provided in the hope that it will be useful, simpler, faster and
10141cc406Sopenharmony_cimore extensible than the current usermap approach.
11141cc406Sopenharmony_ci
12141cc406Sopenharmony_ci
13141cc406Sopenharmony_ciINSTALLATION
14141cc406Sopenharmony_ci------------
15141cc406Sopenharmony_ci
16141cc406Sopenharmony_ciInstall libsane.hotplug in /etc/hotplug/usb, and make it executable.
17141cc406Sopenharmony_ci
18141cc406Sopenharmony_ciCreate the directory /etc/sane.d/hotplug and copy libsane.db there.
19141cc406Sopenharmony_ci
20141cc406Sopenharmony_ci
21141cc406Sopenharmony_ciFILE FORMAT
22141cc406Sopenharmony_ci-----------
23141cc406Sopenharmony_ci
24141cc406Sopenharmony_ciThe libsane.db contains 5 tab-separated fields:
25141cc406Sopenharmony_ci
26141cc406Sopenharmony_ci0xVVVV<tab>0xPPPP<tab>root:scanner<tab>0660<tab>optional_script
27141cc406Sopenharmony_ci
28141cc406Sopenharmony_ciFields:
29141cc406Sopenharmony_ci - vendor ID
30141cc406Sopenharmony_ci - product ID
31141cc406Sopenharmony_ci - ownership (user:group)
32141cc406Sopenharmony_ci - permissions
33141cc406Sopenharmony_ci - path of an optional script to run (it can be omitted)
34141cc406Sopenharmony_ci
35141cc406Sopenharmony_ci
36141cc406Sopenharmony_ciUSAGE
37141cc406Sopenharmony_ci-----
38141cc406Sopenharmony_ci
39141cc406Sopenharmony_ciWhen run by hotplug/hotplug-ng, the libsane.hotplug script will grep for
40141cc406Sopenharmony_ci^0xVVVV[[:space:]]0xPPPP in /etc/sane.d/hotplug/*.db. If a match is found,
41141cc406Sopenharmony_cithe settings are applied to the device.
42141cc406Sopenharmony_ci
43141cc406Sopenharmony_ciThe optional script is then run; this script can access the environment
44141cc406Sopenharmony_civariables set by hotplug/hotplug-ng (see the documentation). The libsane.hotplug
45141cc406Sopenharmony_ciscript will also set and export the DEVVID and DEVPID variables, containing the
46141cc406Sopenharmony_civendor and device ID of the scanner (of the form VVVV and PPPP).
47