mirror of
https://abf.rosa.ru/djam/sane.git
synced 2025-02-23 17:23:00 +00:00
add udev rules patch
This commit is contained in:
parent
6c9dba079a
commit
802be07fc4
2 changed files with 66 additions and 1 deletions
64
sane-backends-1.0.23-udev.patch
Normal file
64
sane-backends-1.0.23-udev.patch
Normal file
|
@ -0,0 +1,64 @@
|
|||
From c7f5126447ed5335a54d9333ac37f35c2189fbf4 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Philippsen <nils@redhat.com>
|
||||
Date: Mon, 10 Sep 2012 12:25:33 +0200
|
||||
Subject: [PATCH] patch: udev
|
||||
|
||||
Squashed commit of the following:
|
||||
|
||||
commit 3d19b3eaf91fa8c3c2a78956f570d3e0f4c3f342
|
||||
Author: Nils Philippsen <nils@redhat.com>
|
||||
Date: Mon Sep 10 12:25:16 2012 +0200
|
||||
|
||||
adapt generated udev rules for Fedora
|
||||
|
||||
commit 7017c3ad1dadc27edd2c47ceec04f8648c839d53
|
||||
Author: Nils Philippsen <nils@redhat.com>
|
||||
Date: Mon Sep 10 12:20:43 2012 +0200
|
||||
|
||||
use group and mode macros consistently
|
||||
---
|
||||
tools/sane-desc.c | 13 ++++++-------
|
||||
1 file changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
|
||||
index 7bbd012..5c5bbe9 100644
|
||||
--- 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
|
||||
@@ -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");
|
||||
|
||||
@@ -3619,10 +3620,8 @@ print_udev (void)
|
||||
}
|
||||
printf ("LABEL=\"libsane_scsi_rules_end\"\n");
|
||||
|
||||
- if (mode == output_mode_udevacl)
|
||||
- printf("\nENV{libsane_matched}==\"yes\", RUN+=\"/bin/setfacl -m g:%s:rw $env{DEVNAME}\"\n", DEVGROUP);
|
||||
- else
|
||||
- printf ("\nENV{libsane_matched}==\"yes\", MODE=\"664\", GROUP=\"scanner\"\n");
|
||||
+ if (mode != output_mode_udevacl)
|
||||
+ printf ("\nENV{libsane_matched}==\"yes\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
|
||||
|
||||
printf ("\nLABEL=\"libsane_rules_end\"\n");
|
||||
}
|
||||
--
|
||||
1.7.11.4
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
Summary: SANE - local and remote scanner access
|
||||
Name: sane
|
||||
Version: 1.0.24
|
||||
Release: 1
|
||||
Release: 2
|
||||
# lib/ is LGPLv2+, backends are GPLv2+ with exceptions
|
||||
# Tools are GPLv2+, docs are public domain
|
||||
License: GPLv2+ and GPLv2+ with exceptions and Public Domain
|
||||
|
@ -76,6 +76,7 @@ Patch115: 24_sane-desc.c_debian_mods.dpatch
|
|||
# Fedora patches
|
||||
Patch202: sane-backends-1.0.20-open-macro.patch
|
||||
Patch205: sane-backends-1.0.20-epson-expression800.patch
|
||||
Patch206: sane-backends-1.0.23-udev.patch
|
||||
|
||||
BuildRequires: gettext
|
||||
BuildRequires: gettext-devel
|
||||
|
|
Loading…
Add table
Reference in a new issue