all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kanichos@yandex.ru
To: 38871@debbugs.gnu.org
Subject: [bug#38871] Add a check before activating modprobe
Date: Thu, 02 Jan 2020 15:13:45 +0300	[thread overview]
Message-ID: <2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net> (raw)

Currently an activation service unconditionally tries to set up a modprobe wrapper by writing to /proc/sys/kernel/modprobe. This breaks if the kernel is built without loadable module support, Shepherd completely aborts. I believe there is no reason for it to be so. Just add a simple check for the existence of this /proc node.

---
 gnu/build/activation.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index c6c7e7fd3b..f7a5e53e79 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -269,9 +269,10 @@ second element is the name it should appear at, such as:
 
 (define (activate-modprobe modprobe)
   "Tell the kernel to use MODPROBE to load modules."
-  (call-with-output-file "/proc/sys/kernel/modprobe"
-    (lambda (port)
-      (display modprobe port))))
+  (if (file-exists? "/proc/sys/kernel/modprobe")
+    (call-with-output-file "/proc/sys/kernel/modprobe"
+      (lambda (port)
+        (display modprobe port)))))
 
 (define (activate-firmware directory)
   "Tell the kernel to look for device firmware under DIRECTORY.  This
-- 
2.23.0

             reply	other threads:[~2020-01-02 12:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02 12:13 kanichos [this message]
2020-01-06 15:32 ` bug#38871: Add a check before activating modprobe Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net \
    --to=kanichos@yandex.ru \
    --cc=38871@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.