From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AHHXG4/QAF/sVAAA0tVLHw (envelope-from ) for ; Sat, 04 Jul 2020 18:55:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uJ+BF4/QAF8mGQAAbx9fmQ (envelope-from ) for ; Sat, 04 Jul 2020 18:55:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 03C4D9407C5 for ; Sat, 4 Jul 2020 18:55:11 +0000 (UTC) Received: from localhost ([::1]:46898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrnJd-0006fK-TF for larch@yhetil.org; Sat, 04 Jul 2020 14:55:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrnJY-0006bb-Q3 for guix-patches@gnu.org; Sat, 04 Jul 2020 14:55:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48094) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jrnJY-0006qX-Gp for guix-patches@gnu.org; Sat, 04 Jul 2020 14:55:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jrnJY-0005Hj-Ft for guix-patches@gnu.org; Sat, 04 Jul 2020 14:55:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42193] [WIP 4/6] services: kernel-module-loader: Return a single 'shepherd-service'. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Jul 2020 18:55:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42193 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 42193@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159388888620244 (code B ref -1); Sat, 04 Jul 2020 18:55:04 +0000 Received: (at submit) by debbugs.gnu.org; 4 Jul 2020 18:54:46 +0000 Received: from localhost ([127.0.0.1]:59633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrnJF-0005GN-SL for submit@debbugs.gnu.org; Sat, 04 Jul 2020 14:54:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:45508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jrnJD-0005Fb-3G for submit@debbugs.gnu.org; Sat, 04 Jul 2020 14:54:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrnJC-0006TY-Qz for guix-patches@gnu.org; Sat, 04 Jul 2020 14:54:42 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrnJA-0006nU-Jw for guix-patches@gnu.org; Sat, 04 Jul 2020 14:54:42 -0400 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6B9A91C0003 for ; Sat, 4 Jul 2020 18:54:38 +0000 (UTC) From: Brice Waegeneire Date: Sat, 4 Jul 2020 20:54:29 +0200 Message-Id: <20200704185431.13739-5-brice@waegenei.re> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200704185234.12571-1-brice@waegenei.re> References: <20200704185234.12571-1-brice@waegenei.re> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.197; envelope-from=brice@waegenei.re; helo=relay5-d.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 14:54:38 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.6 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: psrSgV8jrnMt * gnu/services/linux.scm (kernel-module-loader-shepherd-service): Return a 'shepherd-service' instead of a list of it. (kernel-module-loader-service-type): Adjust it. --- gnu/services/linux.scm | 59 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm index c608cc4d8d..7ea30a1270 100644 --- a/gnu/services/linux.scm +++ b/gnu/services/linux.scm @@ -140,35 +140,34 @@ representation." (define kernel-module-loader-shepherd-service (match-lambda ((and (? list? kernel-modules) ((? string?) ...)) - (list - (shepherd-service - (documentation "Load kernel modules.") - (provision '(kernel-module-loader)) - (requirement '(file-systems)) - (one-shot? #t) - (modules `((srfi srfi-1) - (srfi srfi-34) - (srfi srfi-35) - (rnrs io ports) - ,@%default-modules)) - (start - #~(lambda _ - (cond - ((null? '#$kernel-modules) #t) - ((file-exists? "/proc/sys/kernel/modprobe") - (let ((modprobe (call-with-input-file - "/proc/sys/kernel/modprobe" get-line))) - (guard (c ((message-condition? c) - (format (current-error-port) "~a~%" - (condition-message c)) - #f)) - (every (lambda (module) - (invoke/quiet modprobe "--" module)) - '#$kernel-modules)))) - (else - (format (current-error-port) "error: ~a~%" - "Kernel is missing loadable module support.") - #f))))))))) + (shepherd-service + (documentation "Load kernel modules.") + (provision '(kernel-module-loader)) + (requirement '(file-systems)) + (one-shot? #t) + (modules `((srfi srfi-1) + (srfi srfi-34) + (srfi srfi-35) + (rnrs io ports) + ,@%default-modules)) + (start + #~(lambda _ + (cond + ((null? '#$kernel-modules) #t) + ((file-exists? "/proc/sys/kernel/modprobe") + (let ((modprobe (call-with-input-file + "/proc/sys/kernel/modprobe" get-line))) + (guard (c ((message-condition? c) + (format (current-error-port) "~a~%" + (condition-message c)) + #f)) + (every (lambda (module) + (invoke/quiet modprobe "--" module)) + '#$kernel-modules)))) + (else + (format (current-error-port) "error: ~a~%" + "Kernel is missing loadable module support.") + #f)))))))) (define kernel-module-loader-service-type (service-type @@ -176,7 +175,7 @@ representation." (description "Load kernel modules.") (extensions (list (service-extension shepherd-root-service-type - kernel-module-loader-shepherd-service))) + (compose list kernel-module-loader-shepherd-service)))) (compose concatenate) (extend append) (default-value '()))) -- 2.26.2