summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-05-04 08:47:46 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-05-04 08:53:08 +0900
commit670724edcfe7d71c517d4bb1680132b45accf0b8 (patch)
tree45038c7b417cf1d25054ea95add7a52e01748add
parent455805beda4417b329f26522fde4f0a88c2e211e (diff)
gnu: eudev: Fix optical discs detection/auto-mounting.
* gnu/packages/patches/eudev-removable-devices-polling.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/linux.scm (eudev-fixed): New fixed package. (eudev) [replacement]: Use it. Fixes: <https://issues.guix.gnu.org/35584> Change-Id: I26045c99506eda1b748011825b2049057cd5394f
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/linux.scm12
-rw-r--r--gnu/packages/patches/eudev-removable-devices-polling.patch39
3 files changed, 52 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index f6f95bbf10b..e25fcc115be 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1215,6 +1215,7 @@ dist_patch_DATA = \
%D%/packages/patches/elm-ghc9.2.patch \
%D%/packages/patches/elm-offline-package-registry.patch \
%D%/packages/patches/elm-reactor-static-files.patch \
+ %D%/packages/patches/eudev-removable-devices-polling.patch \
%D%/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch \
%D%/packages/patches/emacs-bash-completion-preserve-exit-code.patch \
%D%/packages/patches/emacs-bash-completion-preserve-ps1.patch \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index deb44029480..5903d4e7c11 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4923,6 +4923,7 @@ to the in-kernel OOM killer.")
(package
(name "eudev")
(version "3.2.14")
+ (replacement eudev-fixed)
(source (origin
(method git-fetch)
(uri (git-reference (url "https://github.com/eudev-project/eudev")
@@ -5032,6 +5033,17 @@ device nodes from /dev/, handles hotplug events and loads drivers at boot
time.")
(license license:gpl2+)))
+(define eudev-fixed
+ (package
+ (inherit eudev)
+ (source
+ (let ((base-source (package-source eudev)))
+ (origin
+ (inherit base-source)
+ (patches
+ (append (search-patches "eudev-removable-devices-polling.patch")
+ (origin-patches base-source))))))))
+
(define-public python-evdev
(package
(name "python-evdev")
diff --git a/gnu/packages/patches/eudev-removable-devices-polling.patch b/gnu/packages/patches/eudev-removable-devices-polling.patch
new file mode 100644
index 00000000000..51a7f6a0be4
--- /dev/null
+++ b/gnu/packages/patches/eudev-removable-devices-polling.patch
@@ -0,0 +1,39 @@
+Upstream-status: https://github.com/systemd/systemd/pull/37336
+Upstream-status: https://github.com/eudev-project/eudev/pull/294
+
+The existing rule would only be effective when the block drivers are compiled
+as modules as opposed to being builtin. On some systems such as Guix System,
+the 'sr_mod' driver for optical discs is builtin the kernel instead of a
+module, and the absence of polling means there are no uevents emitted for
+udisks to act on.
+
+This change was originally contributed to Debian by Martin Pitt to fix
+<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713877>, later removed as it
+was deemed no longer needed. It appears still useful on eudev and elogind
+systems like Guix System and others.
+
+* rules.d/60-block.rules: Apply kernel polling to all removable devices instead
+of just those of the block category handled by a kernel module.
+---
+ rules.d/60-block.rules | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/rules.d/60-block.rules b/rules.d/60-block.rules
+index c3bf32eb83..cc1eb7055e 100644
+--- a/rules/60-block.rules
++++ b/rules/60-block.rules
+@@ -1,8 +1,7 @@
+ # do not edit this file, it will be overwritten on update
+
+ # enable in-kernel media-presence polling
+-ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", \
+- ATTR{parameters/events_dfl_poll_msecs}="2000"
++ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000"
+
+ # forward scsi device event to corresponding block device
+ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+base-commit: 0e0d3ed93a4e816f8ca5efb3760ceb640fea11bc
+--
+2.49.0
+