[bug#63508,v4,2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
Message ID | 2d51ddd4e6865a40a15b8f7948d2479952571a4e.1685379443.git.felix.lechner@lease-up.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6F0C327BBEC; Mon, 29 May 2023 17:58:35 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 27AFB27BBE2 for <patchwork@mira.cbaines.net>; Mon, 29 May 2023 17:58:34 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1q3gC8-00025q-LR; Mon, 29 May 2023 12:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1q3gC3-00025S-Bs for guix-patches@gnu.org; Mon, 29 May 2023 12:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1q3gC3-0005si-3h for guix-patches@gnu.org; Mon, 29 May 2023 12:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1q3gC2-0001aF-WB for guix-patches@gnu.org; Mon, 29 May 2023 12:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Resent-From: Felix Lechner <felix.lechner@lease-up.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 May 2023 16:58:02 +0000 Resent-Message-ID: <handler.63508.B63508.16853794546043@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63508 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63508@debbugs.gnu.org Cc: Liliana Marie Prikler <liliana.prikler@gmail.com>, Felix Lechner <felix.lechner@lease-up.com> Received: via spool by 63508-submit@debbugs.gnu.org id=B63508.16853794546043 (code B ref 63508); Mon, 29 May 2023 16:58:02 +0000 Received: (at 63508) by debbugs.gnu.org; 29 May 2023 16:57:34 +0000 Received: from localhost ([127.0.0.1]:59025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1q3gBa-0001ZP-8K for submit@debbugs.gnu.org; Mon, 29 May 2023 12:57:34 -0400 Received: from sail-ipv4.us-core.com ([208.82.101.137]:49068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <felix.lechner@us-core.com>) id 1q3gBV-0001Yy-KR for 63508@debbugs.gnu.org; Mon, 29 May 2023 12:57:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=4L12ZmZoA0lQhr2 2HLtIQCB80Neo6GXwex5Bo85i3PE=; h=references:in-reply-to:date:subject: cc:to:from; d=lease-up.com; b=rX+B1/KAEWIUhGCO2rzAT2K9a+anT0gEtop2penF EBsFbIyAvyMH07fNcaprllO8etyqpLNOIaiRkK/ulAdqKqDWxZZCF9fYI2kB6qUNM8gcTg KZ2fzzj+HyZtKp9Q8Ep1GZ4SECKaRr4oxu59Wyup12oE5XkuzXHuxplvYrVf0= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id db8d1774 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 29 May 2023 16:57:27 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 81cf9d46; Mon, 29 May 2023 16:57:27 +0000 (UTC) Date: Mon, 29 May 2023 09:57:23 -0700 Message-Id: <2d51ddd4e6865a40a15b8f7948d2479952571a4e.1685379443.git.felix.lechner@lease-up.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <d6fc82a44190d2c5b16d8f8f434102b68681ccfe.1685379443.git.felix.lechner@lease-up.com> References: <d6fc82a44190d2c5b16d8f8f434102b68681ccfe.1685379443.git.felix.lechner@lease-up.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Reply-to: Felix Lechner <felix.lechner@lease-up.com> X-ACL-Warn: , Felix Lechner via Guix-patches <guix-patches@gnu.org> From: Felix Lechner via Guix-patches via <guix-patches@gnu.org> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#63508,v4,1/2] gnu: eudev: Use new project URL for Git repo and home page.
|
|
Commit Message
Felix Lechner
May 29, 2023, 4:57 p.m. UTC
This substitution ensures that udevadm sees the rules that are actually in effect for the declared operating system. It allows administrators to use the udev-rules-service for network interfaces. Some of Guix's customizations for udev rules appear to work as it is [1] but that is not true for network interfaces (which invoke udevadm for naming purposes). [2] Without this commit, udevadm will consult the rules that were present at build time and were installed in the store). [1] https://lists.gnu.org/archive/html/guix-devel/2023-05/msg00195.html [2] https://lists.gnu.org/archive/html/guix-devel/2023-05/msg00192.html * gnu/packages/linux.scm (eudev): Have udevadm look in /etc/udev/rules.d. (Closes: #63508) --- gnu/packages/linux.scm | 5 +++++ 1 file changed, 5 insertions(+)
Comments
Hi Lechner, On 2023-05-29 17:57, Felix Lechner via Guix-patches via wrote: > #:phases > #~(modify-phases %standard-phases > + (add-before 'bootstrap 'hardcode-runtime-rules-dir > + (lambda _ > + (use-modules (ice-9 regex)) > + (substitute* "src/udev/Makefile.am" > + (((regexp-quote "$(udevrulesdir)")) "/etc/udev/rules.d")))) Perhaps instead of substituting, can you check if #:configure-flags or #:make-flags could be used instead?
Hi Bruno, On Mon, May 29, 2023 at 1:28 PM Bruno Victal <mirai@makinata.eu> wrote: > > Perhaps instead of substituting, can you check if > #:configure-flags or #:make-flags could be used instead? Thank you for that suggestion! I did, and I do not believe it is possible to specify a separate runtime path for udevadm via ./configure at this time. It would be possible to add a second variable in configure.ac [1] and use that in the relevant Makefile.am. [2] The change would get picked up for the runtime search path throughout [3] and for the inotify watch in udevd. [4] In that scenario, it would be crucial not to modify the installation directory that was specified via the variable prefix "udevrules_" in several Makefiles.am, [5][6][7] which use Automake's "uniform" naming scheme that leaves off 'dir'. [8] Unfortunately, for most distros the distinctions are meaningless, and perhaps even incomprehensible. I estimated the chance of upstream acceptance as low. After some reflection, it was easier to patch the runtime path directly in the lone place that matters to Guix. [2, again] I also do not see how the second variable needed can be introduced by invoking 'make' in a different way. Please let me know if you find a way. Thanks! Kind regards Felix [1] https://github.com/eudev-project/eudev/blob/0a4dae19c1a191c8054fc2b9c2d592e797715a69/configure.ac#L180 [2] https://github.com/eudev-project/eudev/blob/0a4dae19c1a191c8054fc2b9c2d592e797715a69/src/udev/Makefile.am#L10 [3] https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/src/udev/udev-rules.c#L53 [4] https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/src/udev/udevd.c#L1306 [5] https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/rules/Makefile.am#L9 [6] https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/rules/Makefile.am#L35 [7] https://github.com/eudev-project/eudev/blob/2703baf55615b7554fb67c4f1c241f057f8c0a79/rule_generator/Makefile.am#L12 [8] https://www.gnu.org/software/automake/manual/html_node/Uniform.html
Hello, Felix Lechner <felix.lechner@lease-up.com> writes: > Hi Bruno, > > On Mon, May 29, 2023 at 1:28 PM Bruno Victal <mirai@makinata.eu> wrote: >> >> Perhaps instead of substituting, can you check if >> #:configure-flags or #:make-flags could be used instead? > > Thank you for that suggestion! I did, and I do not believe it is > possible to specify a separate runtime path for udevadm via > ./configure at this time. Turns out it's possible, and that's what NixPkgs does. I'll send a v5 soon implementing that.
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 7a365e2e22..55255e576e 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4192,6 +4192,11 @@ (define-public eudev (list #:phases #~(modify-phases %standard-phases + (add-before 'bootstrap 'hardcode-runtime-rules-dir + (lambda _ + (use-modules (ice-9 regex)) + (substitute* "src/udev/Makefile.am" + (((regexp-quote "$(udevrulesdir)")) "/etc/udev/rules.d")))) (add-before 'bootstrap 'patch-file-names (lambda* (#:key inputs native-inputs #:allow-other-keys) (substitute* "man/make.sh"