diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-02-24 16:36:41 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-30 22:44:34 +0900 |
commit | bb8cc412c8fcab613c402e06ae7024d6df5c9010 (patch) | |
tree | 97c834da2c3fa9c8fb10bad468b2836dfd99a565 | |
parent | dde3ac664cabf9dd2a5702036b102368ba61acd4 (diff) |
services/udev: Allow configuring udev to run in debug mode.
This re-introduces commit dd64f441d3dcff9165927b821da2b69b1fc6a24f, which had
been reverted due to previously causing a system hang when debug? was enabled,
a problem that appears to have been resolved within Shepherd.
* gnu/services/base.scm (<udev-configuration>): <debug?>: New field.
* gnu/services/base.scm (udev-shepherd-service): Use it to add '--debug' to
the command line, if applicable.
* doc/guix.texi (Base Services): Document it.
Change-Id: I88243fb4f321ff0876dd227e3c2b22082d37cfcf
-rw-r--r-- | doc/guix.texi | 12 | ||||
-rw-r--r-- | gnu/services/base.scm | 11 |
2 files changed, 17 insertions, 6 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 7b418a4089..90d90b2e1e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20384,17 +20384,21 @@ In an @code{operating-system} declaration, this service type can be @deftp {Data Type} udev-configuration Data type representing the configuration of udev. -@table @asis -@item @code{udev} (default: @code{eudev}) (type: file-like) +@table @code +@item udev (default: @code{eudev}) (type: file-like) Package object of the udev service. This package is used at run-time, when compiled for the target system. In order to generate the @file{hwdb.bin} hardware index, it is also used when generating the system definition, compiled for the current system. -@item @code{rules} (default: @var{'()}) (type: list-of-file-like) +@item debug? (default: @code{#f}) (type: boolean) +Whether to enable debug output. The debug output is written to the +system log, @file{/var/log/messages}. + +@item rules (default: @code{'()}) (type: list-of-file-like) List of file-like objects denoting udev rule files under a sub-directory. -@item @code{hardware} (default: @var{'()}) (type: list-of-file-like) +@item hardware (default: @code{'()}) (type: list-of-file-like) List of file-like objects denoting udev hardware description files under a sub-directory. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 8c6563c99d..650121be8f 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -15,7 +15,7 @@ ;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re> ;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 Hui Lu <luhuins@163.com> -;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2021-2023, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2021, 2025 muradm <mail@muradm.net> ;;; Copyright © 2022 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li> @@ -160,6 +160,8 @@ udev-configuration udev-configuration? + udev-configuration-udev + udev-configuration-debug? udev-configuration-rules udev-configuration-hardware udev-service-type @@ -2581,6 +2583,8 @@ command that allows you to share pre-built binaries with others over HTTP."))) udev-configuration? (udev udev-configuration-udev ;file-like (default eudev)) + (debug? udev-configuration-debug? ;boolean + (default #f)) (rules udev-configuration-rules ;list of file-like (default '())) (hardware udev-configuration-hardware ;list of file-like @@ -2723,7 +2727,10 @@ item of PACKAGES." (umask old-umask)) (let ((pid (fork+exec-command - (list udevd) + (list udevd + #$@(if (udev-configuration-debug? config) + '("--debug") + '())) #:environment-variables (cons* (string-append "LINUX_MODULE_DIRECTORY=" |