From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:60708) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJeXD-0000GK-K3 for guix-patches@gnu.org; Wed, 01 Apr 2020 10:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJeXC-0003Ck-Fg for guix-patches@gnu.org; Wed, 01 Apr 2020 10:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJeXC-0003C1-CR for guix-patches@gnu.org; Wed, 01 Apr 2020 10:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJeXC-0007Em-9x for guix-patches@gnu.org; Wed, 01 Apr 2020 10:40:02 -0400 Subject: [bug#40274] [PATCH v4] gnu: Add kernel-module-loader-service. Resent-Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 01 Apr 2020 14:38:57 +0000 From: Brice Waegeneire In-Reply-To: <87k12zcozy.fsf@gmail.com> References: <20200328135908.2540-1-brice@waegenei.re> <20200331202340.10054-1-brice@waegenei.re> <87k12zcozy.fsf@gmail.com> Message-ID: <58b435078b6055874686c2da7d411eaa@waegenei.re> 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: Mathieu Othacehe Cc: 40274@debbugs.gnu.org, Guix-patches Hello Mathieu, On 2020-04-01 13:30, Mathieu Othacehe wrote: > You can add a separator here, C-q C-l with Emacs :) I never used pagination in Emacs, maybe I should start using it. >> +(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. This is a one-shot service so no. >> (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. I asked about it on IRC before starting v2 but nobody responded so I went on with this “list of lists of string” implementation. I'll be happy to use a better format, the special case look nice but maybe confusing for the user. I have fixed the typo you reported but I'll wait for further suggestion about the format before sending the new version. - Brice