From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 01 09:30:36 2020 Received: (at 40274) by debbugs.gnu.org; 1 Apr 2020 13:30:36 +0000 Received: from localhost ([127.0.0.1]:37611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdS0-00013Y-5L for submit@debbugs.gnu.org; Wed, 01 Apr 2020 09:30:36 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJdRy-00012i-68 for 40274@debbugs.gnu.org; Wed, 01 Apr 2020 09:30:34 -0400 Received: by mail-wr1-f68.google.com with SMTP id j17so30494847wru.13 for <40274@debbugs.gnu.org>; Wed, 01 Apr 2020 06:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=9xOTmuet93bTWiU90PM/iDtBLFdz0GrZbzbfLnjk3Lc=; b=M35NELGDSP8IVO5b3q6jDFck+NFsKQmaE0rJwlI1DGIooohjw+EVjjNz4t6kyPmx9p GXlSRnp0tOM1MeCaZZRtACjWPWC3duvRVvL7dS25VaoI0LoMD4c8UA2pLnTJaTiEawza cz1aTMU08y/PtCcwjO2KrxaNRcyI3fmPL6YumNQAM7rHblUDQKiFR+5A4dXcvFdAHDfj s1J8qwih6FT8q4Rn3l443MgfNvszVlsvlgJO9Id9vQfdHp2ZpajrWlSiI7aqiMxxb6jG bR6kPjlpQ678HVgCjE6OnIW+T3O8bdJBFt48O4NcBFCVF5OAjPmcTUWoJPR9GDgHRRRP f5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=9xOTmuet93bTWiU90PM/iDtBLFdz0GrZbzbfLnjk3Lc=; b=lPaAwXUORrshK1fS9cX3g7fNoN3zZ5teyDupAuPNYlxYKId7RCvKuWgesm1Tr1r6KR SPBDnrZ0XhS/b92kHFYQhOzCdEIu5v53BGKAkzIrS8YVaB1q09veIEVXuUN0sIzShuuV 9oNHIlN5BZ9qe32lkmqvComYOcSoUv0JGEJKp9wyTTQz7Av+yRKGkAxEyuWGvaCEuGmm PGcwu3F7tmBzQd5udk3bEIs5dxLQ2ya+3G9elFuFjqVx2KWq5SPSrJ9XgotaOI7gemh7 8h8oohpfY9Bg4N2SKNmXnAM7L8Pfr47gfkMKlkq5C5IrQkrJqfp0OwgD4k1IhUbtjsfH SL+g== X-Gm-Message-State: ANhLgQ1fpx4HT1e/xUh7WnR4jMzrsUdeCFuVYTJHHnw8PHle/0YKTw8r dxBjBOjN4ETuPoyDOxKukvQJzd2jhE8= X-Google-Smtp-Source: ADFU+vs4WaTQNbr7SNuIP3fgFh8e0f/86uZ+nTplAeydsyoHIy6BXjVc2uQCwP6mHvQCUZglqY+n0Q== X-Received: by 2002:a5d:5447:: with SMTP id w7mr25696112wrv.299.1585747827796; Wed, 01 Apr 2020 06:30:27 -0700 (PDT) Received: from meru ([2a01:cb18:832e:5f00:75c3:1709:597b:7112]) by smtp.gmail.com with ESMTPSA id u13sm2574742wmm.32.2020.04.01.06.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 06:30:26 -0700 (PDT) References: <20200328135908.2540-1-brice@waegenei.re> <20200331202340.10054-1-brice@waegenei.re> User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe To: guix-patches@gnu.org Subject: Re: [bug#40274] [PATCH v4] gnu: Add kernel-module-loader-service. In-reply-to: <20200331202340.10054-1-brice@waegenei.re> Date: Wed, 01 Apr 2020 15:30:25 +0200 Message-ID: <87k12zcozy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40274 Cc: 40274@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Brice, > +@deffn {Scheme Procedure} kernel-module-loader-service @var{modules} > +Return a service that run @command{modprobe} with arguments ^ runs > +@var{modules} at boot. For example loading the drivers provided by ^ What's modules? > +@deffn {Scheme Variable} kernel-module-loader-service-type > +The service type for loading kernel modules at boot with > +@command{modprobe}, for module that can't autoload. Its value must be a ^ modules You can add a separator here, C-q C-l with Emacs :) > +;;; > +;;; Kernel module loader. > +;;; > + (modprobe kernel-module-loader-configuration-modprobe ; path of the 'modprobe' command > + (default (file-append kmod "/bin/modprobe"))) > + (modules kernel-module-loader-configuration-modules ; list of lists of strings > + (default '()))) Those lines are above the 78 columns limit. > + > +(define kernel-module-loader-shepherd-service > + (match-lambda > + (($ modprobe modules) > + (list > + (shepherd-service > + (documentation "Load kernel modules.") > + (provision '(kernel-module-loader)) > + (respawn? #f) > + (one-shot? #t) > + (start > + #~(lambda _ > + (and-map (lambda (module-with-parameters) > + (zero? (apply system* #$modprobe "--" > + module-with-parameters))) > + '#$modules)))))))) I wonder if it would make sense to rmmod the modules on service stop? Probably not. > (value (run-loadable-kernel-modules-test > (list acpi-call-linux-module ddcci-driver-linux) > - '("acpi_call" "ddcci"))))) > + '(("acpi_call") > + ("ddcci")))))) When using multiple modules without any configuration, I find the notation '(("module-a") ("module-b")) a bit unclear. Maybe we could add a special case handling '("module-a" "module-b") as two kernel modules taking no arguments. Or we could define a record with two fields: module-name and arguments. Not sure what's better. Anyway, this looks good to me :). But let's wait for Danny opinion maybe. Thanks, Mathieu