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