diff --git a/gnu/local.mk b/gnu/local.mk index bcfa38108cc..ce45787ef46 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1251,7 +1251,6 @@ dist_patch_DATA = \ %D%/packages/patches/erlang-man-path.patch \ %D%/packages/patches/esmini-use-pkgconfig.patch \ %D%/packages/patches/esmtp-add-lesmtp.patch \ - %D%/packages/patches/eudev-rules-directory.patch \ %D%/packages/patches/exercism-disable-self-update.patch \ %D%/packages/patches/expat-CVE-2024-45490.patch \ %D%/packages/patches/expat-CVE-2024-45491.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 4d4b53e290d..b147f74d398 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4897,12 +4897,14 @@ to the in-kernel OOM killer.") (file-name (git-file-name name version)) (sha256 (base32 - "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz")) - (patches (search-patches "eudev-rules-directory.patch")) - (modules '((guix build utils))))) + "1f6lz57igi7iw2ls3fpzgw42bfznam4nf9368h7x8yf1mb737yxz")))) (build-system gnu-build-system) (arguments (list + ;; The binary should be built to look for its rules under + ;; /etc/udev/rules.d, which is where the udev-shepherd-service keeps + ;; them. + #:make-flags #~(list "udevrulesdir=/etc/udev/rules.d") #:phases #~(modify-phases %standard-phases (add-before 'bootstrap 'patch-file-names @@ -4946,7 +4948,20 @@ to the in-kernel OOM killer.") ;; such that Libtool looks for it in the usual places. (substitute* (string-append #$output "/lib/libudev.la") (("old_library=.*") - "old_library=''\n")))))) + "old_library=''\n"))))) + (replace 'install + (lambda* (#:key make-flags #:allow-other-keys #:rest args) + ;; Although the runtime udevrulesdir is set to + ;; /etc/udev/rules.d, the package should provide its default + ;; rules under $libdir/udev/rules.d. + (let* ((default-udev-rules.d (string-append #$output + "/lib/udev/rules.d")) + (make-flags (cons (string-append "udevrulesdir=" + default-udev-rules.d) + (delete "udevrulesdir=/etc/udev/rules.d" + make-flags)))) + (apply (assoc-ref %standard-phases 'install) + `(,@args #:make-flags ,make-flags)))))) #:configure-flags #~(list "--enable-manpages" ;; By default, autoconf uses $prefix/etc. The udev-service-type @@ -4954,9 +4969,9 @@ to the in-kernel OOM killer.") ;; descriptions. "--sysconfdir=/etc"))) (native-search-paths - (list (search-path-specification - (variable "UDEV_HWDB_PATH") - (files '("lib/udev/hwdb.d"))))) + (list (search-path-specification + (variable "UDEV_HWDB_PATH") + (files '("lib/udev/hwdb.d"))))) (native-inputs (list autoconf automake @@ -4974,7 +4989,7 @@ to the in-kernel OOM killer.") ;; When linked against libblkid, eudev can populate /dev/disk/by-label ;; and similar; it also installs the '60-persistent-storage.rules' file, ;; which contains the rules to do that. - (list `(,util-linux "lib") ;for blkid + (list `(,util-linux "lib") ;for blkid kmod)) (outputs '("out" "static")) (home-page "https://github.com/eudev-project/eudev") diff --git a/gnu/packages/patches/eudev-rules-directory.patch b/gnu/packages/patches/eudev-rules-directory.patch deleted file mode 100644 index c4b1cfae39f..00000000000 --- a/gnu/packages/patches/eudev-rules-directory.patch +++ /dev/null @@ -1,37 +0,0 @@ -Add $EUDEV_RULES_DIRECTORY to the list of rules directories. - -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. - ---- a/src/udev/udev-rules.c -+++ b/src/udev/udev-rules.c -@@ -48,16 +48,11 @@ struct uid_gid { - }; - }; - --static const char* const rules_dirs[] = { -+static const char* rules_dirs[] = { - UDEV_CONF_DIR "/rules.d", - UDEV_RULES_DIR, -- UDEV_ROOT_RUN "/udev/rules.d", - UDEV_LIBEXEC_DIR "/rules.d", --#ifdef HAVE_SPLIT_USR -- "/lib/udev/rules.d", -- "/usr/lib/udev/rules.d", --#endif -- "/usr/local/lib/udev/rules.d", -+ NULL, /* placeholder for $EUDEV_RULES_DIRECTORY */ - NULL}; - - struct udev_rules { -@@ -1718,6 +1713,9 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) { - - udev_rules_check_timestamp(rules); - -+ /* Allow the user to specify an additional rules directory. */ -+ rules_dirs[3] = getenv("EUDEV_RULES_DIRECTORY"); -+ - r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs); - if (r < 0) { - log_error_errno(r, "failed to enumerate rules files: %m"); diff --git a/gnu/services/base.scm b/gnu/services/base.scm index fe7ac28b398..490376d446e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2562,7 +2562,6 @@ item of PACKAGES." (list udevd) #:environment-variables (cons* - "EUDEV_RULES_DIRECTORY=/etc/udev/rules.d" (string-append "LINUX_MODULE_DIRECTORY=" (getenv "LINUX_MODULE_DIRECTORY")) (default-environment-variables)))))