diff options
author | kanichos@yandex.ru <kanichos@yandex.ru> | 2020-01-02 15:13:45 +0300 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-01-06 16:31:54 +0100 |
commit | 83460433b94487198750ad0bcc6f3869f68a8c8f (patch) | |
tree | ff753c0e8464ff1c200f24f002f11e7058aa33f9 /gnu/build | |
parent | 6a6b8a3fcfc35a5e7b10e7c2a9a75e909354d4d6 (diff) | |
download | patches-83460433b94487198750ad0bcc6f3869f68a8c8f.tar patches-83460433b94487198750ad0bcc6f3869f68a8c8f.tar.gz |
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>
Diffstat (limited to 'gnu/build')
-rw-r--r-- | gnu/build/activation.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 6d69628eb2..30f5e87d5a 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -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 |