From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:49685) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imzMZ-0006Io-MR for guix-patches@gnu.org; Thu, 02 Jan 2020 07:14:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imzMY-0000o5-MV for guix-patches@gnu.org; Thu, 02 Jan 2020 07:14:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60607) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imzMY-0000nx-JZ for guix-patches@gnu.org; Thu, 02 Jan 2020 07:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1imzMY-0000zU-ET for guix-patches@gnu.org; Thu, 02 Jan 2020 07:14:02 -0500 Subject: [bug#38871] Add a check before activating modprobe Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:49644) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imzMP-00069c-Ae for guix-patches@gnu.org; Thu, 02 Jan 2020 07:13:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imzMN-0000gP-Au for guix-patches@gnu.org; Thu, 02 Jan 2020 07:13:52 -0500 Received: from forward400p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:105]:52837) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1imzMM-0000eI-Nb for guix-patches@gnu.org; Thu, 02 Jan 2020 07:13:51 -0500 Received: from mxback21g.mail.yandex.net (mxback21g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:321]) by forward400p.mail.yandex.net (Yandex) with ESMTP id 868BB1BC0EB8 for ; Thu, 2 Jan 2020 15:13:46 +0300 (MSK) From: kanichos@yandex.ru MIME-Version: 1.0 Date: Thu, 02 Jan 2020 15:13:45 +0300 Message-Id: <2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net> Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38871@debbugs.gnu.org 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