all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <m.othacehe@gmail.com>
To: 40274@debbugs.gnu.org
Subject: [bug#40274] [PATCH v4] gnu: Add kernel-module-loader-service.
Date: Wed, 01 Apr 2020 15:30:25 +0200	[thread overview]
Message-ID: <87k12zcozy.fsf@gmail.com> (raw)
In-Reply-To: <20200331202340.10054-1-brice@waegenei.re>


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
> +    (($ <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.

>     (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

  reply	other threads:[~2020-04-01 13:31 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 13:59 [bug#40274] [PATCH] gnu: Add kernel-module-loader-service Brice Waegeneire
2020-03-28 20:51 ` Mathieu Othacehe
2020-03-31 17:22   ` Brice Waegeneire
2020-03-31 17:19 ` [bug#40274] [PATCH v2] " Brice Waegeneire
2020-03-31 20:00 ` [bug#40274] [PATCH v3] " Brice Waegeneire
2020-03-31 20:10 ` [bug#40274] [PATCH] " Nicolò Balzarotti
2020-03-31 20:25   ` Brice Waegeneire
2020-03-31 20:23 ` [bug#40274] [PATCH v4] " Brice Waegeneire
2020-04-01 13:30   ` Mathieu Othacehe [this message]
2020-04-01 14:38     ` Brice Waegeneire
2020-04-01 19:34   ` pelzflorian (Florian Pelz)
2020-04-01 19:43     ` pelzflorian (Florian Pelz)
2020-04-01 19:48       ` pelzflorian (Florian Pelz)
2020-04-02 12:40     ` Brice Waegeneire
2020-04-03 13:03       ` pelzflorian (Florian Pelz)
2020-04-02 12:37 ` [bug#40274] [PATCH v5] " Brice Waegeneire
2020-04-02 13:56   ` Danny Milosavljevic
2020-04-02 17:13     ` Brice Waegeneire
2020-04-03 10:20       ` Danny Milosavljevic
2020-04-03 12:58         ` pelzflorian (Florian Pelz)
2020-04-04 10:51         ` Danny Milosavljevic
2020-04-04 17:58         ` Brice Waegeneire
2020-04-04 18:31           ` Danny Milosavljevic
2020-04-05  7:19             ` Brice Waegeneire
2020-04-02 14:22   ` Mathieu Othacehe
2020-04-04 15:17 ` [bug#40274] [PATCH v6 0/2] " Brice Waegeneire
2020-04-04 15:17   ` [bug#40274] [PATCH v6 1/2] services: Allow modprobe to use "/etc/modprobe.d" Brice Waegeneire
2020-04-04 15:17   ` [bug#40274] [PATCH v6 2/2] gnu: Add kernel-module-loader-service Brice Waegeneire
2020-04-04 15:53     ` Mathieu Othacehe
2020-04-04 16:09     ` pelzflorian (Florian Pelz)
2020-04-04 16:49       ` Brice Waegeneire
2020-04-04 17:46         ` pelzflorian (Florian Pelz)
2020-04-04 21:10     ` Danny Milosavljevic
2020-04-04 21:11       ` Danny Milosavljevic
2020-04-04 23:06         ` pelzflorian (Florian Pelz)
2020-04-05  7:06         ` Brice Waegeneire
2020-04-04 21:16     ` Danny Milosavljevic
2020-04-05  5:28 ` [bug#40274] [PATCH v7 0/2] " Brice Waegeneire
2020-04-05  5:28   ` [bug#40274] [PATCH v7 1/2] services: Allow modprobe to use "/etc/modprobe.d" Brice Waegeneire
2020-04-05 11:11     ` Danny Milosavljevic
2020-04-05 12:38       ` Brice Waegeneire
2020-04-05  5:28   ` [bug#40274] [PATCH v7 2/2] gnu: Add kernel-module-loader-service Brice Waegeneire
2020-04-05 10:06     ` pelzflorian (Florian Pelz)
2020-04-05 11:10     ` bug#40274: " Danny Milosavljevic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k12zcozy.fsf@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=40274@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.