sane/sane-backends-1.0.23-udev.patch

41 lines
1.5 KiB
Diff
Raw Normal View History

commit 2fd4ea713546ef0cb9f67ee7853e9b1d01f64071
Author: Nils Philippsen <nils@redhat.com>
AuthorDate: Fri Aug 31 15:54:01 2012 +0200
Commit: Nils Philippsen <nils@redhat.com>
CommitDate: Fri Aug 31 15:54:01 2012 +0200
2014-02-03 23:57:00 +04:00
patch: udev
Squashed commit of the following:
commit 99a4a33bd297f5b475ac610cf2d51385893596b9
Author: Nils Philippsen <nils@redhat.com>
Date: Fri Aug 31 15:51:55 2012 +0200
adapt generated udev rules for Fedora
2014-02-03 23:57:00 +04:00
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
index 376e451..938f95e 100644
2014-02-03 23:57:00 +04:00
--- a/tools/sane-desc.c
+++ b/tools/sane-desc.c
@@ -56,7 +56,7 @@
2014-02-03 23:57:00 +04:00
#define COLOR_NEW "\"#F00000\""
#define COLOR_UNKNOWN "\"#000000\""
-#define DEVMODE "0664"
+#define DEVMODE "0644"
#define DEVOWNER "root"
#define DEVGROUP "usb"
2014-02-03 23:57:00 +04:00
@@ -3543,7 +3543,8 @@ print_udev (void)
}
printf("\n# The following rule will disable USB autosuspend for the device\n");
- printf("ENV{libsane_matched}==\"yes\", RUN+=\"/bin/sh -c 'if test -e /sys/$env{DEVPATH}/power/control; then echo on > /sys/$env{DEVPATH}/power/control; elif test -e /sys/$env{DEVPATH}/power/level; then echo on > /sys/$env{DEVPATH}/power/level; fi'\"\n");
+ printf("ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n");
+ printf("ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");