all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#38871] Add a check before activating modprobe
@ 2020-01-02 12:13 kanichos
  2020-01-06 15:32 ` bug#38871: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: kanichos @ 2020-01-02 12:13 UTC (permalink / raw)
  To: 38871

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#38871: Add a check before activating modprobe
  2020-01-02 12:13 [bug#38871] Add a check before activating modprobe kanichos
@ 2020-01-06 15:32 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2020-01-06 15:32 UTC (permalink / raw)
  To: kanichos; +Cc: 38871-done

Hello,

kanichos@yandex.ru skribis:

> 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"

Applied with minor tweaks.

However, I suspect other issues will come up if you try to use a kernel
without loadable module support.  For instance, you’ll have to set:

  (initrd-modules '())

in your OS config file.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-06 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 12:13 [bug#38871] Add a check before activating modprobe kanichos
2020-01-06 15:32 ` bug#38871: " Ludovic Courtès

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.