[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/ru
From: |
Felix Lechner |
Subject: |
[bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) |
Date: |
Wed, 17 May 2023 17:52:41 -0700 |
Note for Liliana (and not part of the commit message): Hi, I hope you
are not offended by this patch. The one-line substitution here makes
the custom rule work, as well. The enviroment variable you proposed is
probably superior but the patch is relatively complex and the
resulting flexibility may not be needed. Also, I retitled the bug to
sidestep the controversy around the default for now. I was surprised
by your opposition and think that should be a separate
discussion. Thanks!
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]
The author uses this snippet to select MAC-based names for all network
interfaces:
(udev-rules-service 'net-name-mac
(udev-rule
"79-net-name-mac.rules"
"
SUBSYSTEM==\"net\", ACTION==\"add\", NAME=\"$env{ID_NET_NAME_MAC}\"
")))
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(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7b989a466c..750016d572 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4156,6 +4156,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"
--
2.40.1
- [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style., (continued)
- [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style., Felix Lechner, 2023/05/14
- [bug#63508] [PATCH 2/3] gnu: eudev: Convert build arguments to gexps., Felix Lechner, 2023/05/14
- [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces., Felix Lechner, 2023/05/14
- [bug#63508] [PATCH] gnu: udev: Allow EUDEV_RULES_DIRECTORY to shadow built-in rules., Liliana Marie Prikler, 2023/05/15
- [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style., Felix Lechner, 2023/05/17
[bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps., Felix Lechner, 2023/05/28
[bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page., Felix Lechner, 2023/05/29