sane-backends-1.0.25-udev.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 252f347d59fff3ab1877f77a36613b318651725e Mon Sep 17 00:00:00 2001
  2. From: Nils Philippsen <nils@redhat.com>
  3. Date: Tue, 8 Oct 2013 16:29:13 +0200
  4. Subject: [PATCH] patch: udev
  5. Squashed commit of the following:
  6. commit fb6d1f4c0d17f1df33429bf03a64cd4fbb819ea5
  7. Author: Nils Philippsen <nils@redhat.com>
  8. Date: Tue Oct 8 16:24:49 2013 +0200
  9. adapt generated udev rules for Fedora
  10. commit 8bffaccc1eeb19ecbaddb4ac9da73954af4c5d4f
  11. Author: Nils Philippsen <nils@redhat.com>
  12. Date: Mon Sep 10 12:20:43 2012 +0200
  13. use group and mode macros consistently
  14. ---
  15. tools/sane-desc.c | 14 +++++++-------
  16. 1 file changed, 7 insertions(+), 7 deletions(-)
  17. diff --git a/tools/sane-desc.c b/tools/sane-desc.c
  18. index badc8ce..f992bf5 100644
  19. --- a/tools/sane-desc.c
  20. +++ b/tools/sane-desc.c
  21. @@ -57,9 +57,9 @@
  22. #define COLOR_NEW "\"#F00000\""
  23. #define COLOR_UNKNOWN "\"#000000\""
  24. -#define DEVMODE "0664"
  25. +#define DEVMODE "0644"
  26. #define DEVOWNER "root"
  27. -#define DEVGROUP "scanner"
  28. +#define DEVGROUP "root"
  29. #ifndef PATH_MAX
  30. # define PATH_MAX 1024
  31. @@ -3564,7 +3564,8 @@ print_udev (void)
  32. }
  33. printf("\n# The following rule will disable USB autosuspend for the device\n");
  34. - 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");
  35. + printf("ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n");
  36. + printf("ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
  37. printf ("\nLABEL=\"libsane_usb_rules_end\"\n\n");
  38. @@ -3641,10 +3642,8 @@ print_udev (void)
  39. }
  40. printf ("LABEL=\"libsane_scsi_rules_end\"\n");
  41. - if (mode == output_mode_udevacl)
  42. - printf("\nENV{libsane_matched}==\"yes\", RUN+=\"/bin/setfacl -m g:%s:rw $env{DEVNAME}\"\n", DEVGROUP);
  43. - else
  44. - printf ("\nENV{libsane_matched}==\"yes\", MODE=\"664\", GROUP=\"scanner\"\n");
  45. + if (mode != output_mode_udevacl)
  46. + printf ("\nENV{libsane_matched}==\"yes\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
  47. printf ("\nLABEL=\"libsane_rules_end\"\n");
  48. }
  49. @@ -3695,6 +3694,7 @@ print_udevhwdb (void)
  50. printf("# The following rule will disable USB autosuspend for the device\n");
  51. printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST==\"power/control\", ATTR{power/control}=\"on\"\n\n");
  52. + printf("ENV{DEVTYPE}==\"usb_device\", ENV{libsane_matched}==\"yes\", TEST!=\"power/control\", TEST==\"power/level\", ATTR{power/level}=\"on\"\n");
  53. printf ("SUBSYSTEMS==\"scsi\", GOTO=\"libsane_scsi_rules_begin\"\n");
  54. printf ("GOTO=\"libsane_rules_end\"\n\n");
  55. --
  56. 2.5.0