From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:40580) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioUNL-0006DV-18 for guix-patches@gnu.org; Mon, 06 Jan 2020 10:33:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioUNJ-0006XK-UE for guix-patches@gnu.org; Mon, 06 Jan 2020 10:33:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioUNJ-0006XA-RU for guix-patches@gnu.org; Mon, 06 Jan 2020 10:33:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ioUNJ-0005yp-Pn for guix-patches@gnu.org; Mon, 06 Jan 2020 10:33:01 -0500 Subject: bug#38871: Add a check before activating modprobe Resent-To: guix-patches@gnu.org Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net> Date: Mon, 06 Jan 2020 16:32:36 +0100 In-Reply-To: <2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net> (kanichos@yandex.ru's message of "Thu, 02 Jan 2020 15:13:45 +0300") Message-ID: <87k164bnxn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: kanichos@yandex.ru Cc: 38871-done@debbugs.gnu.org Hello, kanichos@yandex.ru skribis: > Currently an activation service unconditionally tries to set up a modprob= e wrapper by writing to /proc/sys/kernel/modprobe. This breaks if the kerne= l is built without loadable module support, Shepherd completely aborts. I b= elieve 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: >=20=20 > (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=E2=80=99ll have to set: (initrd-modules '()) in your OS config file. Thanks, Ludo=E2=80=99.