From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw8bI-0001RC-H2 for guix-patches@gnu.org; Mon, 27 Jan 2020 12:55:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iw8bG-0001Dx-Fi for guix-patches@gnu.org; Mon, 27 Jan 2020 12:55:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52948) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iw8bG-0001Dn-8S for guix-patches@gnu.org; Mon, 27 Jan 2020 12:55:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iw8bG-0000oi-7V for guix-patches@gnu.org; Mon, 27 Jan 2020 12:55:02 -0500 Subject: [bug#39308] [PATCH] gnu: Install the udev rules for light to its output. Resent-Message-ID: From: Amin Bandali References: <20200127145247.4327-1-mab@gnu.org> Date: Mon, 27 Jan 2020 12:54:33 -0500 In-Reply-To: <20200127145247.4327-1-mab@gnu.org> Message-ID: <87a768kco6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39308@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Please find v2 attached below, fixing my oversight of forgetting to substitute in the correct paths for chgrp and chmod. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-Install-udev-rules-for-light-to-allow-sudo-less-.patch Content-Transfer-Encoding: quoted-printable From=203f9beb0385c03d5c6d34cde76ad7bf2bc2e0c465 Mon Sep 17 00:00:00 2001 From: Amin Bandali 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. =2D-- 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 =2D-- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -5042,6 +5042,21 @@ monitoring tools for Linux. These include @code{mps= tat}, @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))) =2D-=20 2.25.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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)) =2D-=20 Amin Bandali Free Software activist | GNU maintainer & webmaster GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103 https://bandali.eu.org --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEObM8jZRIDS3cwqSYi0Sgzce5VvIFAl4vI9kACgkQi0Sgzce5 VvKVRQ//co4d2G4lYy6GjAyJkqsL+YqKEdx2wyx9ssNnNBwe3NRATDuiv87CkttQ 0c/jKRXjYE/33YmzPhDPmL8zFD6+tKVHIMAXIjOp1WBFty4Kb3mHmVYAKTHnk04J m1ptaegbVT37qVCpvxbAEd/HBUmDzaQsw5F8ZNfB5tuIB/Yn/CasZ9s8bFOhX2yQ QZ9UAtOfRrcaBRppDN9OhXh2Y+thEuk9ChWyMtiiE6Ljkg7NjlTEFcixclIQUItk /9X3gwYWuirryfLhzyJbx4/UAdNvbnXxhM5apNGc2V4kXH1RCdYsCWFG6dfaotCR eh2KH/3P9IUKhga03xcFvfWT5O9K8tDQAvv2H2E3P1BZgZ9bUuCxEkOczSEqeagV Mnvv4AZ/+dlZXaT/lXzLhhN8hukNgvDWR6SD+cAI1V9KSodwyXuzRXBH8flRsBWm aA/sTf6qtf46OnNBndDd4BisCoYWC+91UsAI8PGGVVmkUXQW3unkEgs7YuD7OrTU TthYwYsJVweo2QfNRpLdNBTZjvsTJrH1iBZvDMh1aYKDic28GtYK3aDO7qf5CFaV ljq2GjAyDxXb0zdhQv2Guo7t5FgMe7foMtYeoH8DZRSC7aRXoHuAEOASLrgiKU3d 4BRP9/51WWyw3WFV3pt5dkwOSPW1WV49cLIWuMrU5uHdJJ5qOhg= =JbOz -----END PGP SIGNATURE----- --==-=-=--