diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-04 08:47:46 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-04 08:53:08 +0900 |
| commit | 670724edcfe7d71c517d4bb1680132b45accf0b8 (patch) | |
| tree | 45038c7b417cf1d25054ea95add7a52e01748add | |
| parent | 455805beda4417b329f26522fde4f0a88c2e211e (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.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/linux.scm | 12 | ||||
| -rw-r--r-- | gnu/packages/patches/eudev-removable-devices-polling.patch | 39 |
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 = \ | |||
| 1215 | %D%/packages/patches/elm-ghc9.2.patch \ | 1215 | %D%/packages/patches/elm-ghc9.2.patch \ |
| 1216 | %D%/packages/patches/elm-offline-package-registry.patch \ | 1216 | %D%/packages/patches/elm-offline-package-registry.patch \ |
| 1217 | %D%/packages/patches/elm-reactor-static-files.patch \ | 1217 | %D%/packages/patches/elm-reactor-static-files.patch \ |
| 1218 | %D%/packages/patches/eudev-removable-devices-polling.patch \ | ||
| 1218 | %D%/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch \ | 1219 | %D%/packages/patches/emacs-all-the-icons-remove-duplicate-rs.patch \ |
| 1219 | %D%/packages/patches/emacs-bash-completion-preserve-exit-code.patch \ | 1220 | %D%/packages/patches/emacs-bash-completion-preserve-exit-code.patch \ |
| 1220 | %D%/packages/patches/emacs-bash-completion-preserve-ps1.patch \ | 1221 | %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.") | |||
| 4923 | (package | 4923 | (package |
| 4924 | (name "eudev") | 4924 | (name "eudev") |
| 4925 | (version "3.2.14") | 4925 | (version "3.2.14") |
| 4926 | (replacement eudev-fixed) | ||
| 4926 | (source (origin | 4927 | (source (origin |
| 4927 | (method git-fetch) | 4928 | (method git-fetch) |
| 4928 | (uri (git-reference (url "https://github.com/eudev-project/eudev") | 4929 | (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 | |||
| 5032 | time.") | 5033 | time.") |
| 5033 | (license license:gpl2+))) | 5034 | (license license:gpl2+))) |
| 5034 | 5035 | ||
| 5036 | (define eudev-fixed | ||
| 5037 | (package | ||
| 5038 | (inherit eudev) | ||
| 5039 | (source | ||
| 5040 | (let ((base-source (package-source eudev))) | ||
| 5041 | (origin | ||
| 5042 | (inherit base-source) | ||
| 5043 | (patches | ||
| 5044 | (append (search-patches "eudev-removable-devices-polling.patch") | ||
| 5045 | (origin-patches base-source)))))))) | ||
| 5046 | |||
| 5035 | (define-public python-evdev | 5047 | (define-public python-evdev |
| 5036 | (package | 5048 | (package |
| 5037 | (name "python-evdev") | 5049 | (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 @@ | |||
| 1 | Upstream-status: https://github.com/systemd/systemd/pull/37336 | ||
| 2 | Upstream-status: https://github.com/eudev-project/eudev/pull/294 | ||
| 3 | |||
| 4 | The existing rule would only be effective when the block drivers are compiled | ||
| 5 | as modules as opposed to being builtin. On some systems such as Guix System, | ||
| 6 | the 'sr_mod' driver for optical discs is builtin the kernel instead of a | ||
| 7 | module, and the absence of polling means there are no uevents emitted for | ||
| 8 | udisks to act on. | ||
| 9 | |||
| 10 | This change was originally contributed to Debian by Martin Pitt to fix | ||
| 11 | <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=713877>, later removed as it | ||
| 12 | was deemed no longer needed. It appears still useful on eudev and elogind | ||
| 13 | systems like Guix System and others. | ||
| 14 | |||
| 15 | * rules.d/60-block.rules: Apply kernel polling to all removable devices instead | ||
| 16 | of just those of the block category handled by a kernel module. | ||
| 17 | --- | ||
| 18 | rules.d/60-block.rules | 3 +-- | ||
| 19 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/rules.d/60-block.rules b/rules.d/60-block.rules | ||
| 22 | index c3bf32eb83..cc1eb7055e 100644 | ||
| 23 | --- a/rules/60-block.rules | ||
| 24 | +++ b/rules/60-block.rules | ||
| 25 | @@ -1,8 +1,7 @@ | ||
| 26 | # do not edit this file, it will be overwritten on update | ||
| 27 | |||
| 28 | # enable in-kernel media-presence polling | ||
| 29 | -ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", \ | ||
| 30 | - ATTR{parameters/events_dfl_poll_msecs}="2000" | ||
| 31 | +ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000" | ||
| 32 | |||
| 33 | # forward scsi device event to corresponding block device | ||
| 34 | ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" | ||
| 35 | |||
| 36 | base-commit: 0e0d3ed93a4e816f8ca5efb3760ceb640fea11bc | ||
| 37 | -- | ||
| 38 | 2.49.0 | ||
| 39 | |||
