all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces
@ 2023-05-14 21:41 Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-14 21:41 UTC (permalink / raw)
  To: 63508; +Cc: Felix Lechner

Hi,

This patch set proposes the use of ID_NET_NAME_MAC for standard network
interfaces. In the author's opinion, predictable names for interfaces work
better with the declarative configuration style used in Guix.

Kind regards
Felix

Felix Lechner (3):
  gnu: eudev: Convert native-inputs to new style.
  gnu: eudev: Convert build arguments to gexps.
  gnu: eudev: Always use MAC-based names for network interfaces.

 gnu/packages/linux.scm | 100 +++++++++++++++++++++--------------------
 1 file changed, 51 insertions(+), 49 deletions(-)


base-commit: 263f235cd0a2955e865fe38036f84c2bf34375ff
-- 
2.40.1





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
@ 2023-05-14 21:42 ` Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 2/3] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-14 21:42 UTC (permalink / raw)
  To: 63508; +Cc: Felix Lechner

* gnu/packages/linux.scm (eudev): Convert native-inputs to new style.
---
 gnu/packages/linux.scm | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ea64e9d241..7ae34d1d4a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4190,19 +4190,19 @@ (define-public eudev
                                "hwdb" "--update")))))))
        #:configure-flags (list "--enable-manpages")))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("gperf" ,gperf)
-       ("libtool" ,libtool)
-       ("pkg-config" ,pkg-config)
-       ;; For tests.
-       ("perl" ,perl)
-       ("python" ,python-wrapper)
-       ;; For documentation.
-       ("docbook-xml" ,docbook-xml-4.2)
-       ("docbook-xsl" ,docbook-xsl)
-       ("libxml2" ,libxml2)             ;for $XML_CATALOG_FILES
-       ("xsltproc" ,libxslt)))
+     (list autoconf
+           automake
+           gperf
+           libtool
+           pkg-config
+           ;; For tests.
+           perl
+           python-wrapper
+           ;; For documentation.
+           docbook-xml-4.2
+           docbook-xsl
+           libxml2            ;for $XML_CATALOG_FILES
+           libxslt))
     (inputs
      ;; When linked against libblkid, eudev can populate /dev/disk/by-label
      ;; and similar; it also installs the '60-persistent-storage.rules' file,
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH 2/3] gnu: eudev: Convert build arguments to gexps.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
@ 2023-05-14 21:42 ` Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces Felix Lechner via Guix-patches via
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-14 21:42 UTC (permalink / raw)
  To: 63508; +Cc: Felix Lechner

* gnu/packages/linux.scm (eudev): Convert build arguments to gexps.
---
 gnu/packages/linux.scm | 68 ++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 36 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7ae34d1d4a..98e683bdb0 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4153,42 +4153,38 @@ (define-public eudev
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'bootstrap 'patch-file-names
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-            (substitute* "man/make.sh"
-              (("/usr/bin/xsltproc")
-               (string-append (assoc-ref
-                               (or native-inputs inputs) "xsltproc")
-                               "/bin/xsltproc")))))
-         (add-after 'install 'move-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (static (assoc-ref outputs "static"))
-                    (source (string-append out "/lib/libudev.a"))
-                    (target (string-append static "/lib/libudev.a")))
-               (mkdir-p (dirname target))
-               (link source target)
-               (delete-file source)
-               ;; Remove reference to the static library from the .la file
-               ;; such that Libtool looks for it in the usual places.
-               (substitute* (string-append out "/lib/libudev.la")
-                 (("old_library=.*")
-                  "old_library=''\n")))))
-         (add-after 'install 'build-hwdb
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
-             ;; similar tools to display product names.
-             ;;
-             ;; XXX: This can't be done when cross-compiling. Find another way
-             ;; to generate hwdb.bin for cross-built systems.
-             (let ((out (assoc-ref outputs "out")))
-               ,@(if (%current-target-system)
-                     '(#t)
-                     '((invoke (string-append out "/bin/udevadm")
-                               "hwdb" "--update")))))))
-       #:configure-flags (list "--enable-manpages")))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'bootstrap 'patch-file-names
+            (lambda* (#:key inputs native-inputs #:allow-other-keys)
+              (substitute* "man/make.sh"
+                (("/usr/bin/xsltproc")
+                 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
+          (add-after 'install 'move-static-library
+            (lambda _
+              (let ((source (string-append #$output "/lib/libudev.a"))
+                    (target (string-append #$output:static "/lib/libudev.a")))
+                (mkdir-p (dirname target))
+                (link source target)
+                (delete-file source)
+                ;; Remove reference to the static library from the .la file
+                ;; such that Libtool looks for it in the usual places.
+                (substitute* (string-append #$output "/lib/libudev.la")
+                  (("old_library=.*")
+                   "old_library=''\n")))))
+          (add-after 'install 'build-hwdb
+            (lambda _
+              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
+              ;; similar tools to display product names.
+              ;;
+              ;; XXX: This can't be done when cross-compiling. Find another way
+              ;; to generate hwdb.bin for cross-built systems.
+              #$@(if (%current-target-system)
+                     #~(#t)
+                     #~((invoke (string-append #$output "/bin/udevadm")
+                                "hwdb" "--update"))))))
+       #:configure-flags #~(list "--enable-manpages")))
     (native-inputs
      (list autoconf
            automake
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
  2023-05-14 21:42 ` [bug#63508] [PATCH 2/3] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
@ 2023-05-14 21:42 ` Felix Lechner via Guix-patches via
  2023-05-15  4:31   ` Liliana Marie Prikler
  2023-05-15 19:11 ` [bug#63508] [PATCH] gnu: udev: Allow EUDEV_RULES_DIRECTORY to shadow built-in rules Liliana Marie Prikler
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-14 21:42 UTC (permalink / raw)
  To: 63508; +Cc: Felix Lechner

Upon personal reflection, a declarative operating system like Guix probably
ought to use only predictable interface names.

While shorter names like 'eno1' offer an indisputable convenience and beauty
when typing on the command line, administrators in Guix are unlikely to do so
due to the declarative configuration system.

Some system services may explicitly refer to interface names in their
configuration. They would also benefit from the predictable and constant
nature of MAC-based names.

The latter is particularly relevant on multi-homed machines, i.e. those with
more than one network connection.

A MAC-based interface name as issued by 'eudev' looks like this:

  enx0123456789af   (fictitious)

This commit was deployed on two production machines. The migration to
MAC-based interface names took place without issues. A second reconfiguration
was the used to add the new interface name in services tha needed it. The
second step can be skipped, since the name is known with certainty in advance.

The current naming scheme is less desirable because some services may silently
refuse to start after equipment was added or removed. A removal may take
place, for example, when something broke or when equipment was sold.

The device enumeration may also change when a CMOS battery fails and system
options are lost. In the author's option, Guix should not depend on BIOS
enumeration for device names.

In the author's case, the name of the sole network interface changed from
enp3s0 to enp4s0 when a PCIe disk controller (a SAS host-based adapter) was
installed. As a result, OpenSMTPd silently failed to start.

This commit switches 'eudev' from the standard naming order

  ID_NET_NAME_ONBOARD
  ID_NET_NAME_SLOT
  ID_NET_NAME_PATH

to ID_NET_NAME_MAC, which is always available. [1]

The author initially attempted to achieve the same result via

(udev-rules-service 'net-name-mac
  (udev-rule
    "01-net-name-mac.rules"
    "SUBSYSTEM==\"net\", ACTION==\"add\", NAME=\"$env{ID_NET_NAME_MAC}\"
")))

but that did not work. While the situation was not examined exhaustively, it
was not clear that udevadm can currently work because the standard command to
test udev setups: [2]

  $ udevadm --debug test /sys/class/net/*

did not find the script installed via the 'udev-service-type'.

A review of the 'eudev' sources indicated that the path to find rules [3] is
hard-coded to the store location during installation. An attempt to set the
path to /etc/udev/rules.d yielded a build error because that target folder
outside the store was understandably not writable.

The manual page for udevadm did not offer a way to select the runtime location
of the udev/rules.d folder via environment variables or a command-line option.

Anyone for whom such a setup is working properly should please contact the
author. Thank you!

This commit may result in some loss of privacy, although it is presently not
clear how meaningful that is. With this commit, anyone using privacy-enhanced
IPv6 addresses risks having their MAC exposed when they publish their
configuration files in Git or post a well-meant sample in a chat rooms,
because that configuration may mention the MAC address.

Moreover, the compatibilty with schemes to generate fake one-time MAC
addresses upon boot should be evaluated. One concern is that the explicit
reference to a network interface in a configuration file would likely force
the use of a single and constant MAC address for that interface.

This commit was tested in production and is currently being used.

The change here resulted in the recompilation of several seemingly unrelated
packages such as Emacs and GTK. Perhaps those dependency relationships should
be examined.

[1] https://wiki.debian.org/NetworkInterfaceNames#How_to_migrate_to_this_scheme_on_upgraded_systems
[2] https://wiki.archlinux.org/title/Udev#Testing_rules_before_loading
[3] https://github.com/eudev-project/eudev/blob/39979ddf46e75d1b75bf381e1c73914c226c4302/configure.ac#L180
[4] https://en.wikipedia.org/wiki/IPv6_address#Temporary_addresses

* gnu/packages/linux.scm (eudev): Always use MAC-based names for network
interfaces.
---
 gnu/packages/linux.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 98e683bdb0..724c621fed 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4173,6 +4173,12 @@ (define-public eudev
                 (substitute* (string-append #$output "/lib/libudev.la")
                   (("old_library=.*")
                    "old_library=''\n")))))
+          (add-before 'install 'net-name-mac
+            (lambda _
+              (use-modules (ice-9 regex))
+              (substitute* "rules/80-net-name-slot.rules"
+                (((regexp-quote "ID_NET_NAME_ONBOARD"))
+                 "ID_NET_NAME_MAC"))))
           (add-after 'install 'build-hwdb
             (lambda _
               ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces.
  2023-05-14 21:42 ` [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces Felix Lechner via Guix-patches via
@ 2023-05-15  4:31   ` Liliana Marie Prikler
  2023-05-15  4:56     ` Felix Lechner via Guix-patches via
  0 siblings, 1 reply; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-15  4:31 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Sonntag, dem 14.05.2023 um 14:42 -0700 schrieb Felix Lechner:
> The change here resulted in the recompilation of several seemingly
> unrelated packages such as Emacs and GTK. Perhaps those dependency
> relationships should be examined.
What?  GUI libraries and packages that depend on them need to be
rebuilt when we change the way we handle our (input, media) devices?! 
Can't have that!

>  gnu/packages/linux.scm | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 98e683bdb0..724c621fed 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -4173,6 +4173,12 @@ (define-public eudev
>                  (substitute* (string-append #$output
> "/lib/libudev.la")
>                    (("old_library=.*")
>                     "old_library=''\n")))))
> +          (add-before 'install 'net-name-mac
> +            (lambda _
> +              (use-modules (ice-9 regex))
> +              (substitute* "rules/80-net-name-slot.rules"
> +                (((regexp-quote "ID_NET_NAME_ONBOARD"))
Wherefore the regexp-quote?  There is no regexp to be found here, is
there?
> +                 "ID_NET_NAME_MAC"))))
I don't see how this change allows users *or upstream package
maintainers* to continue using onboard names as they have done for ages
and as they would want to continue to do.  I think you should
a) File a patch upstream to add ID_NET_NAME_MAC into net-name-
slot.rules
b) Add that patch to our eudev package with a reference to the upstream
bug report.

Cheers





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces.
  2023-05-15  4:31   ` Liliana Marie Prikler
@ 2023-05-15  4:56     ` Felix Lechner via Guix-patches via
  0 siblings, 0 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-15  4:56 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 63508

Hi Liliana,

Thank you for your review!

On Sun, May 14, 2023 at 9:31 PM Liliana Marie Prikler
<liliana.prikler@gmail.com> wrote:
>
> Wherefore the regexp-quote?

Whoops! That was left over from the attempt to get udevadm to use
/etc/udev/rules.d as it should. Thanks for the pointer!

> I don't see how this change allows users *or upstream package
> maintainers* to continue using onboard names as they have done for ages
> and as they would want to continue to do.

I have one of those cards. While the interface name did not change
when I fiddled with the PCI configuration, I am not sure that
prioritizing ID_NET_NAME_ONBOARD over ID_NET_NAME_MAC is a reasonable
default for Guix.

To rank ID_NET_NAME_ONBOARD below ID_NET_NAME_MAC would not address
the shortcoming you perceived because the latter always exists.

Instead, I think people wishing to use ID_NET_NAME_ONBOARD should
install a custom udev script (and those should be recognized by the
udevadm we ship).

> a) File a patch upstream to add ID_NET_NAME_MAC into net-name-
> slot.rules

If upstream accepts such a patch, I believe they would give
ID_NET_NAME_MAC the lowest possible priority, but that does nothing
for Guix. Common relative priorities are outlined here. [1]

For Guix, I think we would like to see ID_NET_NAME_MAC at the top.

Kind regards
Felix

[1] https://wiki.debian.org/NetworkInterfaceNames#How_to_migrate_to_this_scheme_on_upgraded_systems




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH] gnu: udev: Allow EUDEV_RULES_DIRECTORY to shadow built-in rules.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
                   ` (2 preceding siblings ...)
  2023-05-14 21:42 ` [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces Felix Lechner via Guix-patches via
@ 2023-05-15 19:11 ` Liliana Marie Prikler
  2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-15 19:11 UTC (permalink / raw)
  To: 63508; +Cc: felix.lechner

* gnu/packages/patches/eudev-rules-directory.patch (rules_dirs):
Move placeholder to the start of the array.
(rules_dirs_real): New procedure.
(udev_rules_dirs_new, udev_rules_check_timestamp): Adjust accordingly.
---
Hi Felix,

Am Sonntag, dem 14.05.2023 um 21:56 -0700 schrieb Felix Lechner:
> > I don't see how this change allows users *or upstream package
> > maintainers* to continue using onboard names as they have done for
> > ages and as they would want to continue to do.
> 
> I have one of those cards. While the interface name did not change
> when I fiddled with the PCI configuration, I am not sure that
> prioritizing ID_NET_NAME_ONBOARD over ID_NET_NAME_MAC is a reasonable
> default for Guix.
> 
> To rank ID_NET_NAME_ONBOARD below ID_NET_NAME_MAC would not address
> the shortcoming you perceived because the latter always exists.
> 
> Instead, I think people wishing to use ID_NET_NAME_ONBOARD should
> install a custom udev script (and those should be recognized by the
> udevadm we ship).
I think the current default is probably fine for more users than the
proposed change (ain't no one got the time to type their MAC addresses).

I do however see your point in that udev should let you choose to prefer
ID_NET_NAME_MAC over the other rules.  Now, the shortcoming here
actually lies with our incomplete support for EUDEV_RULES_DIRECTORY,
see the patch :)

> For Guix, I think we would like to see ID_NET_NAME_MAC at the top.
Now, I respectully disagree on that proposition, but am here to fix the
original bug of udev not honouring your preference.  With the following
patch your udev-rule-service should be able to override the default
behaviour.  If not, try matching the file name.  There shouldn't be any
weird predicates on the name, but if there are, that's how we'll find
out.

Cheers

 .../patches/eudev-rules-directory.patch       | 44 ++++++++++++++++---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/patches/eudev-rules-directory.patch b/gnu/packages/patches/eudev-rules-directory.patch
index 54fc01c6d5..7cc3f97451 100644
--- a/gnu/packages/patches/eudev-rules-directory.patch
+++ b/gnu/packages/patches/eudev-rules-directory.patch
@@ -4,14 +4,17 @@ The old udev 182 supported $UDEV_CONFIG_FILE, which in turn allowed
 the search path to be customized, but eudev no longer has this, hence
 this hack.
 
---- eudev-3.1.5/src/udev/udev-rules.c	2015-10-13 06:22:14.000000000 +0800
-+++ eudev-3.1.5/src/udev/udev-rules.c	2015-10-16 20:45:38.491934336 +0800
-@@ -47,15 +47,11 @@
+Index: eudev/src/udev/udev-rules.c
+===================================================================
+--- eudev.orig/src/udev/udev-rules.c
++++ eudev/src/udev/udev-rules.c
+@@ -48,15 +48,11 @@ struct uid_gid {
          };
  };
  
 -static const char* const rules_dirs[] = {
 +static const char* rules_dirs[] = {
++        NULL,			/* placeholder for $EUDEV_RULES_DIRECTORY */
          UDEV_CONF_DIR "/rules.d",
          UDEV_RULES_DIR,
 -        UDEV_ROOT_RUN "/udev/rules.d",
@@ -20,17 +23,44 @@ this hack.
 -        "/lib/udev/rules.d",
 -        "/usr/lib/udev/rules.d",
 -#endif
-+        NULL,			/* placeholder for $EUDEV_RULES_DIRECTORY */
          NULL};
  
  struct udev_rules {
-@@ -1704,6 +1700,9 @@
+@@ -1691,6 +1687,14 @@ static int parse_file(struct udev_rules
+         return 0;
+ }
+ 
++static const char** rules_dirs_real()
++{
++        if (rules_dirs[0])
++                return rules_dirs;
++        else
++                return rules_dirs + 1;
++}
++
+ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) {
+         struct udev_rules *rules;
+         struct udev_list file_list;
+@@ -1717,7 +1721,10 @@ struct udev_rules *udev_rules_new(struct
  
          udev_rules_check_timestamp(rules);
  
+-        r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
 +        /* Allow the user to specify an additional rules directory.  */
-+        rules_dirs[3] = getenv("EUDEV_RULES_DIRECTORY");
++        rules_dirs[0] = getenv("EUDEV_RULES_DIRECTORY");
 +
-         r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
++        r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs_real ());
          if (r < 0) {
                  log_error_errno(r, "failed to enumerate rules files: %m");
+                 return udev_rules_unref(rules);
+@@ -1776,7 +1783,9 @@ bool udev_rules_check_timestamp(struct u
+         if (!rules)
+                 return false;
+ 
+-        return paths_check_timestamp(rules_dirs, &rules->dirs_ts_usec, true);
++        return paths_check_timestamp(rules_dirs_real (),
++                                     &rules->dirs_ts_usec,
++                                     true);
+ }
+ 
+ static int match_key(struct udev_rules *rules, struct token *token, const char *val) {

base-commit: 28bfc5cd081458313fa8601133386209b23deb12
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
                   ` (3 preceding siblings ...)
  2023-05-15 19:11 ` [bug#63508] [PATCH] gnu: udev: Allow EUDEV_RULES_DIRECTORY to shadow built-in rules Liliana Marie Prikler
@ 2023-05-18  0:52 ` Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
                     ` (2 more replies)
  2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
  2023-05-29 16:57 ` [bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page Felix Lechner via Guix-patches via
  6 siblings, 3 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-18  0:52 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Convert native-inputs to new style.
---
 gnu/packages/linux.scm | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 90c1adde53..1f1b319dbf 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4190,19 +4190,19 @@ (define-public eudev
                                "hwdb" "--update")))))))
        #:configure-flags (list "--enable-manpages")))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("gperf" ,gperf)
-       ("libtool" ,libtool)
-       ("pkg-config" ,pkg-config)
-       ;; For tests.
-       ("perl" ,perl)
-       ("python" ,python-wrapper)
-       ;; For documentation.
-       ("docbook-xml" ,docbook-xml-4.2)
-       ("docbook-xsl" ,docbook-xsl)
-       ("libxml2" ,libxml2)             ;for $XML_CATALOG_FILES
-       ("xsltproc" ,libxslt)))
+     (list autoconf
+           automake
+           gperf
+           libtool
+           pkg-config
+           ;; For tests.
+           perl
+           python-wrapper
+           ;; For documentation.
+           docbook-xml-4.2
+           docbook-xsl
+           libxml2            ;for $XML_CATALOG_FILES
+           libxslt))
     (inputs
      ;; When linked against libblkid, eudev can populate /dev/disk/by-label
      ;; and similar; it also installs the '60-persistent-storage.rules' file,

base-commit: 6e38ec447f98383e0722ac300734f8d7c8c5c7b0
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps.
  2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
@ 2023-05-18  0:52   ` Felix Lechner via Guix-patches via
  2023-05-18  4:12     ` Liliana Marie Prikler
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 3/4] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
  2 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-18  0:52 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Convert build arguments to gexps.
---
 gnu/packages/linux.scm | 68 ++++++++++++++++++++----------------------
 1 file changed, 32 insertions(+), 36 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1f1b319dbf..9058648700 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4153,42 +4153,38 @@ (define-public eudev
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'bootstrap 'patch-file-names
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-            (substitute* "man/make.sh"
-              (("/usr/bin/xsltproc")
-               (string-append (assoc-ref
-                               (or native-inputs inputs) "xsltproc")
-                               "/bin/xsltproc")))))
-         (add-after 'install 'move-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (static (assoc-ref outputs "static"))
-                    (source (string-append out "/lib/libudev.a"))
-                    (target (string-append static "/lib/libudev.a")))
-               (mkdir-p (dirname target))
-               (link source target)
-               (delete-file source)
-               ;; Remove reference to the static library from the .la file
-               ;; such that Libtool looks for it in the usual places.
-               (substitute* (string-append out "/lib/libudev.la")
-                 (("old_library=.*")
-                  "old_library=''\n")))))
-         (add-after 'install 'build-hwdb
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
-             ;; similar tools to display product names.
-             ;;
-             ;; XXX: This can't be done when cross-compiling. Find another way
-             ;; to generate hwdb.bin for cross-built systems.
-             (let ((out (assoc-ref outputs "out")))
-               ,@(if (%current-target-system)
-                     '(#t)
-                     '((invoke (string-append out "/bin/udevadm")
-                               "hwdb" "--update")))))))
-       #:configure-flags (list "--enable-manpages")))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'bootstrap 'patch-file-names
+            (lambda* (#:key inputs native-inputs #:allow-other-keys)
+              (substitute* "man/make.sh"
+                (("/usr/bin/xsltproc")
+                 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
+          (add-after 'install 'move-static-library
+            (lambda _
+              (let ((source (string-append #$output "/lib/libudev.a"))
+                    (target (string-append #$output:static "/lib/libudev.a")))
+                (mkdir-p (dirname target))
+                (link source target)
+                (delete-file source)
+                ;; Remove reference to the static library from the .la file
+                ;; such that Libtool looks for it in the usual places.
+                (substitute* (string-append #$output "/lib/libudev.la")
+                  (("old_library=.*")
+                   "old_library=''\n")))))
+          (add-after 'install 'build-hwdb
+            (lambda _
+              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
+              ;; similar tools to display product names.
+              ;;
+              ;; XXX: This can't be done when cross-compiling. Find another way
+              ;; to generate hwdb.bin for cross-built systems.
+              #$@(if (%current-target-system)
+                     #~(#t)
+                     #~((invoke (string-append #$output "/bin/udevadm")
+                                "hwdb" "--update"))))))
+       #:configure-flags #~(list "--enable-manpages")))
     (native-inputs
      (list autoconf
            automake
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 3/4] gnu: eudev: Use new project URL.
  2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
@ 2023-05-18  0:52   ` Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
  2 siblings, 0 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-18  0:52 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Use new project URL.
---
 gnu/packages/linux.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9058648700..7b989a466c 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4144,7 +4144,7 @@ (define-public eudev
     (version "3.2.11")
     (source (origin
               (method git-fetch)
-              (uri (git-reference (url "https://github.com/gentoo/eudev")
+              (uri (git-reference (url "https://github.com/eudev-project/eudev")
                                   (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 3/4] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
@ 2023-05-18  0:52   ` Felix Lechner via Guix-patches via
  2023-05-18  4:19     ` Liliana Marie Prikler
  2 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-18  0:52 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

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





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps.
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
@ 2023-05-18  4:12     ` Liliana Marie Prikler
  0 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-18  4:12 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Mittwoch, dem 17.05.2023 um 17:52 -0700 schrieb Felix Lechner:
> * gnu/packages/linux.scm (eudev): Convert build arguments to gexps.
> ---
Since both this and 1/4 are style changes, they should be squashed into
a single commit named "gnu: eudev: Use new package style".

Cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-18  0:52   ` [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
@ 2023-05-18  4:19     ` Liliana Marie Prikler
  2023-05-28 23:23       ` Felix Lechner via Guix-patches via
  0 siblings, 1 reply; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-18  4:19 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Mittwoch, dem 17.05.2023 um 17:52 -0700 schrieb Felix Lechner:
> Note for Liliana (and not part of the commit message):
Stuff that isn't part of the commit message ought to go below the
dashed (---) line so it's automatically ignored by git.

> 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!
Note that our udev already uses this environment variable, I am only
changing how it is interpreted, i.e. allowing it to override built-in
rules just as is needed for your use case.  Now, you may object that
this doesn't mention /etc/udev/rules.d and thus could be problematic on
foreign distributions, but I argue that you probably shouldn't mess
with foreign udev anyway, and if you do that setting
EUDEV_RULES_DIRECTORY is appropriate.


Cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-18  4:19     ` Liliana Marie Prikler
@ 2023-05-28 23:23       ` Felix Lechner via Guix-patches via
  2023-05-29  8:29         ` Liliana Marie Prikler
  0 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-28 23:23 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 63508

Hi Liliana,

Thank you for your kind review! I will push a new version with
squashed commits you requested shortly.

While I am new to Guix, I am not sure that Gexp conversions fall under
"style changes" in my book. I believe they are considerably more
complex, and fraught with greater error.

On Wed, May 17, 2023 at 9:19 PM Liliana Marie Prikler
<liliana.prikler@gmail.com> wrote:
>
> you may object that
> this doesn't mention /etc/udev/rules.d and thus could be problematic on
> foreign distributions, but I argue that you probably shouldn't mess
> with foreign udev anyway, and if you do that setting
> EUDEV_RULES_DIRECTORY is appropriate.

The intent of my patch was not to mention /etc/udev/rules.d
explicitly, but rather to replace the store folder that holds the
upstream rules, which we are currently using, with the one Guix
constructs in order to use rules from other places. That just happens
to be /etc/udev/rules.d as well.

On that note, my patch is not suitable for upstream because it
hardcodes the location to the runtime path in Guix. Other
distributions may keep them in a different place. The current Autoconf
setup probably works well for them.

Either way, udevadm in Guix is currently broken. This patch fixes it
and should please be accepted. Thanks!

As noted elsewhere [1] I am separately working on an update to eudev
3.2.12 but that will require more testing locally before I can send it
in.

Kind regards
Felix

[1] https://lists.gnu.org/archive/html/guix-devel/2023-05/msg00217.html




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
                   ` (4 preceding siblings ...)
  2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
@ 2023-05-28 23:28 ` Felix Lechner via Guix-patches via
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
                     ` (2 more replies)
  2023-05-29 16:57 ` [bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page Felix Lechner via Guix-patches via
  6 siblings, 3 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-28 23:28 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Convert native-inputs to new style, and
build arguments to Gexps.
---
 gnu/packages/linux.scm | 94 ++++++++++++++++++++----------------------
 1 file changed, 45 insertions(+), 49 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1be505d949..ae2792825b 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4189,56 +4189,52 @@ (define-public eudev
               (patches (search-patches "eudev-rules-directory.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'bootstrap 'patch-file-names
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-            (substitute* "man/make.sh"
-              (("/usr/bin/xsltproc")
-               (string-append (assoc-ref
-                               (or native-inputs inputs) "xsltproc")
-                               "/bin/xsltproc")))))
-         (add-after 'install 'move-static-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (static (assoc-ref outputs "static"))
-                    (source (string-append out "/lib/libudev.a"))
-                    (target (string-append static "/lib/libudev.a")))
-               (mkdir-p (dirname target))
-               (link source target)
-               (delete-file source)
-               ;; Remove reference to the static library from the .la file
-               ;; such that Libtool looks for it in the usual places.
-               (substitute* (string-append out "/lib/libudev.la")
-                 (("old_library=.*")
-                  "old_library=''\n")))))
-         (add-after 'install 'build-hwdb
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
-             ;; similar tools to display product names.
-             ;;
-             ;; XXX: This can't be done when cross-compiling. Find another way
-             ;; to generate hwdb.bin for cross-built systems.
-             (let ((out (assoc-ref outputs "out")))
-               ,@(if (%current-target-system)
-                     '(#t)
-                     '((invoke (string-append out "/bin/udevadm")
-                               "hwdb" "--update")))))))
-       #:configure-flags (list "--enable-manpages")))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'bootstrap 'patch-file-names
+            (lambda* (#:key inputs native-inputs #:allow-other-keys)
+              (substitute* "man/make.sh"
+                (("/usr/bin/xsltproc")
+                 (search-input-file (or native-inputs inputs) "/bin/xsltproc")))))
+          (add-after 'install 'move-static-library
+            (lambda _
+              (let ((source (string-append #$output "/lib/libudev.a"))
+                    (target (string-append #$output:static "/lib/libudev.a")))
+                (mkdir-p (dirname target))
+                (link source target)
+                (delete-file source)
+                ;; Remove reference to the static library from the .la file
+                ;; such that Libtool looks for it in the usual places.
+                (substitute* (string-append #$output "/lib/libudev.la")
+                  (("old_library=.*")
+                   "old_library=''\n")))))
+          (add-after 'install 'build-hwdb
+            (lambda _
+              ;; Build OUT/etc/udev/hwdb.bin.  This allows 'lsusb' and
+              ;; similar tools to display product names.
+              ;;
+              ;; XXX: This can't be done when cross-compiling. Find another way
+              ;; to generate hwdb.bin for cross-built systems.
+              #$@(if (%current-target-system)
+                     #~(#t)
+                     #~((invoke (string-append #$output "/bin/udevadm")
+                                "hwdb" "--update"))))))
+       #:configure-flags #~(list "--enable-manpages")))
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("gperf" ,gperf)
-       ("libtool" ,libtool)
-       ("pkg-config" ,pkg-config)
-       ;; For tests.
-       ("perl" ,perl)
-       ("python" ,python-wrapper)
-       ;; For documentation.
-       ("docbook-xml" ,docbook-xml-4.2)
-       ("docbook-xsl" ,docbook-xsl)
-       ("libxml2" ,libxml2)             ;for $XML_CATALOG_FILES
-       ("xsltproc" ,libxslt)))
+     (list autoconf
+           automake
+           gperf
+           libtool
+           pkg-config
+           ;; For tests.
+           perl
+           python-wrapper
+           ;; For documentation.
+           docbook-xml-4.2
+           docbook-xsl
+           libxml2            ;for $XML_CATALOG_FILES
+           libxslt))
     (inputs
      ;; When linked against libblkid, eudev can populate /dev/disk/by-label
      ;; and similar; it also installs the '60-persistent-storage.rules' file,

base-commit: d64d6ea2cf5a1be801be355031fb2cfa5901a92a
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL.
  2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
@ 2023-05-28 23:28   ` Felix Lechner via Guix-patches via
  2023-05-29  7:49     ` Liliana Marie Prikler
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
  2023-05-29  7:40   ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Liliana Marie Prikler
  2 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-28 23:28 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Use new project URL.
---
 gnu/packages/linux.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ae2792825b..90a44a518d 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4180,7 +4180,7 @@ (define-public eudev
     (version "3.2.11")
     (source (origin
               (method git-fetch)
-              (uri (git-reference (url "https://github.com/gentoo/eudev")
+              (uri (git-reference (url "https://github.com/eudev-project/eudev")
                                   (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
@ 2023-05-28 23:28   ` Felix Lechner via Guix-patches via
  2023-05-29  7:38     ` Liliana Marie Prikler
  2023-05-29  7:40   ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Liliana Marie Prikler
  2 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-28 23:28 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

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(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 90a44a518d..57b722d97d 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"
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
@ 2023-05-29  7:38     ` Liliana Marie Prikler
  0 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-29  7:38 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Sonntag, dem 28.05.2023 um 16:28 -0700 schrieb Felix Lechner:
> 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(+)
> 
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 90a44a518d..57b722d97d 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"
I still think the proper fix is to consult $EUDEV_RULES_DIRECTORY first
as per <https://issues.guix.gnu.org/63508#6>.

Cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps.
  2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
@ 2023-05-29  7:40   ` Liliana Marie Prikler
  2 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-29  7:40 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Sonntag, dem 28.05.2023 um 16:28 -0700 schrieb Felix Lechner:
> * gnu/packages/linux.scm (eudev): Convert native-inputs to new style,
> and build arguments to Gexps.
> ---
Proper subject is "gnu: eudev: Use new package style".

Proper ChangeLog is
  * gnu/packages/linux.scm (eudev)[arguments]: Convert to list of 
  G-Expressions.
  [native-inputs]: Drop labels.


The commit itself LGTM.

Cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL.
  2023-05-28 23:28   ` [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
@ 2023-05-29  7:49     ` Liliana Marie Prikler
  0 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-29  7:49 UTC (permalink / raw)
  To: Felix Lechner, 63508

Am Sonntag, dem 28.05.2023 um 16:28 -0700 schrieb Felix Lechner:
> * gnu/packages/linux.scm (eudev): Use new project URL.
Be specific when changes affect parts of a package.  Also, in the
ChangeLog you can mention the full URL.

> ---
>  gnu/packages/linux.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index ae2792825b..90a44a518d 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -4180,7 +4180,7 @@ (define-public eudev
>      (version "3.2.11")
>      (source (origin
>                (method git-fetch)
> -              (uri (git-reference (url
> "https://github.com/gentoo/eudev")
> +              (uri (git-reference (url
> "https://github.com/eudev-project/eudev")
>                                    (commit (string-append "v"
> version))))
>                (file-name (git-file-name name version))
>                (sha256
According to this page, the home-page is also
<https://github.com/gentoo/eudev> and should thus be updated as well.

Cheers

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-28 23:23       ` Felix Lechner via Guix-patches via
@ 2023-05-29  8:29         ` Liliana Marie Prikler
  0 siblings, 0 replies; 25+ messages in thread
From: Liliana Marie Prikler @ 2023-05-29  8:29 UTC (permalink / raw)
  To: Felix Lechner; +Cc: 63508

Am Sonntag, dem 28.05.2023 um 16:23 -0700 schrieb Felix Lechner:
> Hi Liliana,
> 
> Thank you for your kind review! I will push a new version with
> squashed commits you requested shortly.
You mean "submit", right?

> While I am new to Guix, I am not sure that Gexp conversions fall
> under "style changes" in my book. I believe they are considerably
> more complex, and fraught with greater error.
True, but there is room for error in dropping input labels as well.  In
fact, eudev's labels do cause a rebuild, but I decided to push v3 1/3
anyway to get CI ready.

> On Wed, May 17, 2023 at 9:19 PM Liliana Marie Prikler
> <liliana.prikler@gmail.com> wrote:
> > 
> > you may object that this doesn't mention /etc/udev/rules.d and thus
> > could be problematic on foreign distributions, but I argue that you
> > probably shouldn't mess with foreign udev anyway, and if you do
> > that setting EUDEV_RULES_DIRECTORY is appropriate.
> 
> The intent of my patch was not to mention /etc/udev/rules.d
> explicitly, but rather to replace the store folder that holds the
> upstream rules, which we are currently using, with the one Guix
> constructs in order to use rules from other places. That just happens
> to be /etc/udev/rules.d as well.
> 
> On that note, my patch is not suitable for upstream because it
> hardcodes the location to the runtime path in Guix. Other
> distributions may keep them in a different place. The current
> Autoconf setup probably works well for them.
The same reason why your patch wouldn't fly upstream is why it won't
fly in Guix.  We do have to consider foreign distributions as well.

> Either way, udevadm in Guix is currently broken. This patch fixes it
> and should please be accepted. Thanks!
There is more than one way to fix a bug and I argue that the one you
have chosen is not the right one.  Granted, same could be said for my
patch, but you have yet to file a formal complaint.  The closest I can
recall is "the resulting flexibility may not be needed", but here we
are discussing foreign distros storing udev rules in some other
location. 

Cheers




^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page.
  2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
                   ` (5 preceding siblings ...)
  2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
@ 2023-05-29 16:57 ` Felix Lechner via Guix-patches via
  2023-05-29 16:57   ` [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
  6 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-29 16:57 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

* gnu/packages/linux.scm (eudev): Use new project URL
https://github.com/eudev-project/eudev for Git repo and home page.
---
 gnu/packages/linux.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index ae2792825b..7a365e2e22 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4180,7 +4180,7 @@ (define-public eudev
     (version "3.2.11")
     (source (origin
               (method git-fetch)
-              (uri (git-reference (url "https://github.com/gentoo/eudev")
+              (uri (git-reference (url "https://github.com/eudev-project/eudev")
                                   (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -4242,7 +4242,7 @@ (define-public eudev
      (list `(,util-linux "lib") ;for blkid
            kmod))
     (outputs '("out" "static"))
-    (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
+    (home-page "https://github.com/eudev-project/eudev")
     (synopsis "Userspace device management")
     (description "Udev is a daemon which dynamically creates and removes
 device nodes from /dev/, handles hotplug events and loads drivers at boot
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-29 16:57 ` [bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page Felix Lechner via Guix-patches via
@ 2023-05-29 16:57   ` Felix Lechner via Guix-patches via
  2023-05-29 20:28     ` Bruno Victal
  0 siblings, 1 reply; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-29 16:57 UTC (permalink / raw)
  To: 63508; +Cc: Liliana Marie Prikler, Felix Lechner

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(+)

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"
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-29 16:57   ` [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
@ 2023-05-29 20:28     ` Bruno Victal
  2023-05-29 21:06       ` Felix Lechner via Guix-patches via
  0 siblings, 1 reply; 25+ messages in thread
From: Bruno Victal @ 2023-05-29 20:28 UTC (permalink / raw)
  To: Felix Lechner, Liliana Marie Prikler; +Cc: 63508

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?


-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508)
  2023-05-29 20:28     ` Bruno Victal
@ 2023-05-29 21:06       ` Felix Lechner via Guix-patches via
  0 siblings, 0 replies; 25+ messages in thread
From: Felix Lechner via Guix-patches via @ 2023-05-29 21:06 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 63508, Liliana Marie Prikler

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




^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-05-29 21:08 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-14 21:41 [bug#63508] [PATCH 0/3] Use MAC-based names for network interfaces Felix Lechner via Guix-patches via
2023-05-14 21:42 ` [bug#63508] [PATCH 1/3] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
2023-05-14 21:42 ` [bug#63508] [PATCH 2/3] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
2023-05-14 21:42 ` [bug#63508] [PATCH 3/3] gnu: eudev: Always use MAC-based names for network interfaces Felix Lechner via Guix-patches via
2023-05-15  4:31   ` Liliana Marie Prikler
2023-05-15  4:56     ` Felix Lechner via Guix-patches via
2023-05-15 19:11 ` [bug#63508] [PATCH] gnu: udev: Allow EUDEV_RULES_DIRECTORY to shadow built-in rules Liliana Marie Prikler
2023-05-18  0:52 ` [bug#63508] [PATCH v2 1/4] gnu: eudev: Convert native-inputs to new style Felix Lechner via Guix-patches via
2023-05-18  0:52   ` [bug#63508] [PATCH v2 2/4] gnu: eudev: Convert build arguments to gexps Felix Lechner via Guix-patches via
2023-05-18  4:12     ` Liliana Marie Prikler
2023-05-18  0:52   ` [bug#63508] [PATCH v2 3/4] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
2023-05-18  0:52   ` [bug#63508] [PATCH v2 4/4] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
2023-05-18  4:19     ` Liliana Marie Prikler
2023-05-28 23:23       ` Felix Lechner via Guix-patches via
2023-05-29  8:29         ` Liliana Marie Prikler
2023-05-28 23:28 ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Felix Lechner via Guix-patches via
2023-05-28 23:28   ` [bug#63508] [PATCH v3 2/3] gnu: eudev: Use new project URL Felix Lechner via Guix-patches via
2023-05-29  7:49     ` Liliana Marie Prikler
2023-05-28 23:28   ` [bug#63508] [PATCH v3 3/3] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
2023-05-29  7:38     ` Liliana Marie Prikler
2023-05-29  7:40   ` [bug#63508] [PATCH v3 1/3] gnu: eudev: Convert native-inputs to new style, and build arguments to Gexps Liliana Marie Prikler
2023-05-29 16:57 ` [bug#63508] [PATCH v4 1/2] gnu: eudev: Use new project URL for Git repo and home page Felix Lechner via Guix-patches via
2023-05-29 16:57   ` [bug#63508] [PATCH v4 2/2] gnu: eudev: Have udevadm look in /etc/udev/rules.d. (Closes: #63508) Felix Lechner via Guix-patches via
2023-05-29 20:28     ` Bruno Victal
2023-05-29 21:06       ` Felix Lechner via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.