GNU bug report logs - #39308
[PATCH] gnu: Install the udev rules for light to its output.

Previous Next

Package: guix-patches;

Reported by: Amin Bandali <mab <at> gnu.org>

Date: Mon, 27 Jan 2020 14:55:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39308 in the body.
You can then email your comments to 39308 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39308; Package guix-patches. (Mon, 27 Jan 2020 14:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Amin Bandali <mab <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 27 Jan 2020 14:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Amin Bandali <mab <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Amin Bandali <mab <at> gnu.org>
Subject: [PATCH] gnu: Install the udev rules for light to its output.
Date: Mon, 27 Jan 2020 09:52:47 -0500
* gnu/packages/linux.scm (light): Add install-udev-rules phase to copy the
90-backlight.rules file from the root of the repository to the special
lib/udev/rules.d/ directory of the out output.
---
 gnu/packages/linux.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9b0dfd8eb7..dfbe2f88bd 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5042,6 +5042,15 @@ monitoring tools for Linux.  These include @code{mpstat}, @code{iostat},
         (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-udev-rules
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file
+                "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
+               #t))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)))
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39308; Package guix-patches. (Mon, 27 Jan 2020 17:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 39308 <at> debbugs.gnu.org (full text, mbox):

From: Amin Bandali <mab <at> gnu.org>
To: 39308 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: Install the udev rules for light to its output.
Date: Mon, 27 Jan 2020 12:54:33 -0500
[Message part 1 (text/plain, inline)]
Please find v2 attached below, fixing my oversight of forgetting to
substitute in the correct paths for chgrp and chmod.

[0001-gnu-Install-udev-rules-for-light-to-allow-sudo-less-.patch (text/x-patch, inline)]
From 3f9beb0385c03d5c6d34cde76ad7bf2bc2e0c465 Mon Sep 17 00:00:00 2001
From: Amin Bandali <mab <at> gnu.org>
Date: Mon, 27 Jan 2020 09:33:37 -0500
Subject: [PATCH v2] gnu: Install udev rules for light to allow sudo-less
 invocations.

* gnu/packages/linux.scm (light): Substitute out the absolute paths of chgrp
and chmod in 90-backlight.rules, and install the rules file to the special
lib/udev/rules.d/ directory of the out output.  This allows for any member of
the video group to set brightness using light without using sudo.
---
 gnu/packages/linux.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9b0dfd8eb7..5162dfff18 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5042,6 +5042,21 @@ monitoring tools for Linux.  These include @code{mpstat}, @code{iostat},
         (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
        (file-name (git-file-name name version))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-udev-rules-absolute-path-bins
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "90-backlight.rules"
+               (("/bin/chgrp") (which "chgrp"))
+               (("/bin/chmod") (which "chmod")))
+             #t))
+         (add-after 'install 'install-udev-rules
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (install-file
+                "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
+               #t))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)))
-- 
2.25.0

[Message part 3 (text/plain, inline)]
The patch works fine for me after adding light to udev-service-type in
my system configuration, as suggested in the manual, like so:

  (simple-service 'light-udev-rules udev-service-type (list light))

-- 
Amin Bandali
Free Software activist | GNU maintainer & webmaster
GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
https://bandali.eu.org
[signature.asc (application/pgp-signature, inline)]

Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Mon, 27 Jan 2020 18:03:02 GMT) Full text and rfc822 format available.

Notification sent to Amin Bandali <mab <at> gnu.org>:
bug acknowledged by developer. (Mon, 27 Jan 2020 18:03:02 GMT) Full text and rfc822 format available.

Message #13 received at 39308-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Amin Bandali <mab <at> gnu.org>
Cc: 39308-done <at> debbugs.gnu.org
Subject: Re: [bug#39308] [PATCH] gnu: Install the udev rules for light to its
 output.
Date: Mon, 27 Jan 2020 20:01:38 +0200
[Message part 1 (text/plain, inline)]
Looks good to me! Patch pushed.


-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Feb 2020 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.