summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/sane-backends/files/udev-rule-4.patch')
-rw-r--r--media-gfx/sane-backends/files/udev-rule-4.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/media-gfx/sane-backends/files/udev-rule-4.patch b/media-gfx/sane-backends/files/udev-rule-4.patch
new file mode 100644
index 000000000000..3d824d162cb6
--- /dev/null
+++ b/media-gfx/sane-backends/files/udev-rule-4.patch
@@ -0,0 +1,53 @@
+Index: tools/sane-desc.c
+===================================================================
+--- tools/sane-desc.c.orig
++++ tools/sane-desc.c
+@@ -3151,7 +3151,7 @@ print_udev_header (void)
+
+ printf
+ ("#\n"
+- "# udev rules file for supported USB devices\n"
++ "# udev rules file for supported USB and SCSI devices\n"
+ "#\n"
+ "# To add a USB device, add a rule to the list below between the SUBSYSTEM...\n"
+ "# and LABEL... lines.\n"
+@@ -3169,25 +3169,33 @@ print_udev_header (void)
+ static void
+ print_udev (void)
+ {
++ int commentlen;
+ usbid_type *usbid = create_usbids_table ();
+
+ print_udev_header ();
+ printf ("\nACTION!=\"add\", GOTO=\"libsane_rules_end\"\n");
+- printf ("SUBSYSTEM!=\"usb_device\", GOTO=\"libsane_rules_end\"\n\n");
++ puts("SUBSYSTEMS==\"scsi\", ATTRS{type}==\"6\", MODE=\"660\", GROUP=\"scanner\"");
++ printf ("SUBSYSTEM!=\"usb|usb_device\", GOTO=\"libsane_rules_end\"\n");
++ printf ("SUBSYSTEM==\"usb\", ENV{DEVTYPE}!=\"usb_device\" ,GOTO=\"libsane_rules_end\"\n\n");
+ while (usbid)
+ {
+ manufacturer_model_type * name = usbid->name;
+
+- printf ("# ");
++ commentlen = printf ("# ");
+ while (name)
+ {
+- if (name != usbid->name)
+- printf (" | ");
+- printf ("%s", name->name);
++ if (name != usbid->name) {
++ commentlen += printf (" | ");
++ }
++ if(commentlen + strlen(name->name) > 480) {
++ printf(" (line too long, names omitted)");
++ break;
++ }
++ commentlen += printf ("%s", name->name);
+ name = name->next;
+ }
+ printf ("\n");
+- printf ("SYSFS{idVendor}==\"%s\", SYSFS{idProduct}==\"%s\", MODE=\"660\", GROUP=\"scanner\"\n",
++ printf ("ATTRS{idVendor}==\"%s\", ATTRS{idProduct}==\"%s\", MODE=\"664\", GROUP=\"scanner\"\n",
+ usbid->usb_vendor_id + 2, usbid->usb_product_id + 2);
+ usbid = usbid->next;
+ }