2011-03-16 17:17:05 +00:00
|
|
|
From 89ca3fb1306f5e809c94c9d059b3c39b4fe50ec8 Mon Sep 17 00:00:00 2001
|
2010-05-05 11:34:47 +00:00
|
|
|
From: Nils Philippsen <nils@redhat.com>
|
2011-03-16 17:17:05 +00:00
|
|
|
Date: Mon, 14 Mar 2011 17:15:20 +0100
|
2010-05-05 11:34:47 +00:00
|
|
|
Subject: [PATCH] patch: udev
|
|
|
|
|
|
|
|
Squashed commit of the following:
|
|
|
|
|
2011-03-16 17:17:05 +00:00
|
|
|
commit cad1db5c3a1f735e2425655db6005d2b05169288
|
2010-05-05 11:34:47 +00:00
|
|
|
Author: Nils Philippsen <nils@redhat.com>
|
2011-03-16 17:17:05 +00:00
|
|
|
Date: Mon Mar 14 17:07:32 2011 +0100
|
2010-05-05 11:34:47 +00:00
|
|
|
|
|
|
|
adapt generated udev rules for Fedora
|
|
|
|
---
|
2011-03-16 17:17:05 +00:00
|
|
|
tools/sane-desc.c | 16 ++++++++--------
|
|
|
|
1 files changed, 8 insertions(+), 8 deletions(-)
|
2010-05-05 11:34:47 +00:00
|
|
|
|
|
|
|
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
|
2011-03-16 17:17:05 +00:00
|
|
|
index ad3a134..fea2f6b 100644
|
2010-05-05 11:34:47 +00:00
|
|
|
--- a/tools/sane-desc.c
|
|
|
|
+++ b/tools/sane-desc.c
|
|
|
|
@@ -56,9 +56,9 @@
|
|
|
|
#define COLOR_NEW "\"#F00000\""
|
|
|
|
#define COLOR_UNKNOWN "\"#000000\""
|
|
|
|
|
|
|
|
-#define DEVMODE "0664"
|
|
|
|
+#define DEVMODE "0644"
|
|
|
|
#define DEVOWNER "root"
|
|
|
|
-#define DEVGROUP "scanner"
|
|
|
|
+#define DEVGROUP "root"
|
|
|
|
|
|
|
|
#ifndef PATH_MAX
|
|
|
|
# define PATH_MAX 1024
|
2011-03-16 17:17:05 +00:00
|
|
|
@@ -3525,20 +3525,20 @@ print_udev (void)
|
2010-05-05 11:34:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
printf ("\n");
|
|
|
|
- printf ("ATTRS{idVendor}==\"%s\", ATTRS{idProduct}==\"%s\", MODE=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
|
|
|
|
- usbid->usb_vendor_id + 2, usbid->usb_product_id + 2, DEVMODE, DEVGROUP);
|
|
|
|
+ printf ("ATTRS{idVendor}==\"%s\", ATTRS{idProduct}==\"%s\", ENV{libsane_matched}=\"yes\"\n",
|
|
|
|
+ usbid->usb_vendor_id + 2, usbid->usb_product_id + 2);
|
|
|
|
usbid = usbid->next;
|
|
|
|
}
|
|
|
|
|
2011-03-16 17:17:05 +00:00
|
|
|
printf("\n# The following rule will disable USB autosuspend for the device\n");
|
|
|
|
- printf("ENV{libsane_matched}==\"yes\", RUN+=\"/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/level && echo on > /sys/$env{DEVPATH}/power/level'\"\n");
|
|
|
|
+ printf("ENV{libsane_matched}==\"yes\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
|
|
|
|
|
|
|
|
printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");
|
|
|
|
|
2010-05-05 11:34:47 +00:00
|
|
|
printf ("SUBSYSTEMS!=\"scsi\", GOTO=\"libsane_scsi_rules_end\"\n\n");
|
|
|
|
printf ("LABEL=\"libsane_scsi_rules_begin\"\n");
|
|
|
|
printf ("# Generic: SCSI device type 6 indicates a scanner\n");
|
2011-03-16 17:17:05 +00:00
|
|
|
- printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"6\", MODE=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n", DEVMODE, DEVGROUP);
|
2010-05-05 11:34:47 +00:00
|
|
|
+ printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"6\", ENV{libsane_matched}=\"yes\"\n");
|
|
|
|
printf ("# Some scanners advertise themselves as SCSI device type 3\n");
|
|
|
|
|
|
|
|
while (scsiid)
|
|
|
|
@@ -3571,8 +3571,8 @@ print_udev (void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf ("\n");
|
2011-03-16 17:17:05 +00:00
|
|
|
- printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", MODE=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
|
2010-05-05 11:34:47 +00:00
|
|
|
- scsiid->scsi_vendor_id, scsiid->scsi_product_id, DEVMODE, DEVGROUP);
|
|
|
|
+ printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", ENV{libsane_matched}=\"yes\"\n",
|
|
|
|
+ scsiid->scsi_vendor_id, scsiid->scsi_product_id);
|
|
|
|
scsiid = scsiid->next;
|
|
|
|
}
|
|
|
|
printf ("LABEL=\"libsane_scsi_rules_end\"\n\n");
|
|
|
|
--
|
2011-03-16 17:17:05 +00:00
|
|
|
1.7.4
|
2010-05-05 11:34:47 +00:00
|
|
|
|