GNU bug report logs - #38871
Add a check before activating modprobe

Previous Next

Package: guix-patches;

Reported by: kanichos <at> yandex.ru

Date: Thu, 2 Jan 2020 12:14:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38871 in the body.
You can then email your comments to 38871 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#38871; Package guix-patches. (Thu, 02 Jan 2020 12:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to kanichos <at> yandex.ru:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 02 Jan 2020 12:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: kanichos <at> yandex.ru
To: guix-patches <guix-patches <at> gnu.org>
Subject: Add a check before activating modprobe
Date: Thu, 02 Jan 2020 15:13:45 +0300
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 sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 06 Jan 2020 15:33:01 GMT) Full text and rfc822 format available.

Notification sent to kanichos <at> yandex.ru:
bug acknowledged by developer. (Mon, 06 Jan 2020 15:33:01 GMT) Full text and rfc822 format available.

Message #10 received at 38871-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: kanichos <at> yandex.ru
Cc: 38871-done <at> debbugs.gnu.org
Subject: Re: [bug#38871] Add a check before activating modprobe
Date: Mon, 06 Jan 2020 16:32:36 +0100
Hello,

kanichos <at> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Feb 2020 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.