GNU bug report logs -
#38871
Add a check before activating modprobe
Previous Next
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.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#38871: Add a check before activating modprobe
which was filed against the guix-patches package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 38871 <at> debbugs.gnu.org.
--
38871: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38871
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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’.
[Message part 3 (message/rfc822, inline)]
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
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.