activation: Check whether /proc/sys/kernel/modprobe exists.

* gnu/build/activation.scm (activate-modprobe): Check whether
/proc/sys/kernel/modprobe exists before writing to it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
kanichos@yandex.ru 2020-01-02 15:13:45 +03:00 committed by Ludovic Courtès
parent 6a6b8a3fcf
commit 83460433b9
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 3 deletions

View File

@ -281,9 +281,13 @@ 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 the kernel was built without loadable module support, this file is
;; unavailable, so check for its existence first.
(when (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