GNU bug report logs - #40274
[PATCH] gnu: Add kernel-module-loader-service.

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Sat, 28 Mar 2020 14:00:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Brice Waegeneire <brice <at> waegenei.re>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 40274 <at> debbugs.gnu.org, Guix-patches <guix-patches-bounces+brice+lists=waegenei.re <at> gnu.org>
Subject: [bug#40274] [PATCH v4] gnu: Add kernel-module-loader-service.
Date: Wed, 01 Apr 2020 14:38:57 +0000
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
>> +    (($ <kernel-module-loader-configuration> 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




This bug report was last modified 5 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.