From patchwork Thu Jan 2 12:13:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Kozlov X-Patchwork-Id: 19530 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 32410179D5; Thu, 2 Jan 2020 12:14:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F1DF9179D3 for ; Thu, 2 Jan 2020 12:14:09 +0000 (GMT) Received: from localhost ([::1]:40372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imzMf-0006J4-Cf for patchwork@mira.cbaines.net; Thu, 02 Jan 2020 07:14:09 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#38871] Add a check before activating modprobe Resent-From: kanichos@yandex.ru Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 02 Jan 2020 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38871 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 38871@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.15779672373787 (code B ref -1); Thu, 02 Jan 2020 12:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jan 2020 12:13:57 +0000 Received: from localhost ([127.0.0.1]:38347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imzMT-0000z1-6e for submit@debbugs.gnu.org; Thu, 02 Jan 2020 07:13:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:55569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imzMQ-0000yt-RS for submit@debbugs.gnu.org; Thu, 02 Jan 2020 07:13:55 -0500 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) Received: from localhost (localhost [::1]) by mxback21g.mail.yandex.net (mxback/Yandex) with ESMTP id tTF4BEt3D9-DjLCDmVT; Thu, 02 Jan 2020 15:13:45 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1577967225; bh=F4mHCXl7OLvKBE4eTqaHjcpymAB63BRYJlBZ6iH97+E=; h=Message-Id:Date:Subject:To:From; b=tIXj3bTR0OPVysglcZ5/HwuDRlL9iT4+rXnrI39Chy6xar/X+Jf4od5lNZb2PPkD/ KrMC9t9KbRnkEEBfXS7JMHAeWnoH8WYj9hl7R+EWQ/Z82j8Bd2jTXvXMhSdHErCwd9 Fos9nwVvisyDV/dco9n76zHx8vnsmQ8e+LudgkMc= Authentication-Results: mxback21g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva2-d0266d205f48.qloud-c.yandex.net with HTTP; Thu, 02 Jan 2020 15:13:45 +0300 From: kanichos@yandex.ru MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 02 Jan 2020 15:13:45 +0300 Message-Id: <2023261577967225@iva2-d0266d205f48.qloud-c.yandex.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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