Subject: [bug#55231] [PATCH v1] initrd: Allow extra search paths with ‘initrd-extra-module-paths’

From: Ludovic Courtès <[email-masked]>
Date: Fri, 17 Jun 2022 22:34:51 +0200

Hi Brian,

Brian Cully <[email-masked]> skribis:

> With this patch, modules for ‘initrd-modules’ will not only be searched for in
> the in-tree Linux modules, but also any additional modules specified in
> ‘kernel-loadable-modules’.
>
> * gnu/build/linux-modules.scm (find-module-file): change DIRECTORY argument to
> DIRECTORIES. Now takes a list of directories to search, rather than a single
> one.
> * gnu/system/linux-initrd.scm (flat-linux-module-directory): change LINUX
> argument to PACKAGES. Now contains a list of file-likes to search for modules.
> (raw-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (flat-linux-extra-module-paths) along with the selected LINUX package.
> (base-initrd): Add LINUX-EXTRA-MODULE-PATHS keyword argument. Pass it
> to (raw-initrd).
> * gnu/system.scm (operating-system-initrd-file): pass in operating system
> definition's kernel-loadable-modules into (make-initrd) as
> LINUX-EXTRA-MODULE-PATHS.
> ---
>
> I've removed the new operating-system slot in preference to re-using
> kernel-loadable-modules, as discussed.
>
> I did leave the old argument names for the lower level routines in place,
> as I feel that they more accurately represent how the data are being
> used.
>
> I've also pulled out the documentation. Once this patch set is beaten
> into acceptability, the documentation can be adjusted if that's deemed
> necessary.

Alright!

It looks great to me.  I have two cosmetic comments:

> +  (define (package+out->input package out)
> +    (gexp-input package out))

I think you can remove this definition and use ‘gexp-input’ directly.

> @@ -172,20 +183,23 @@ (define* (raw-initrd file-systems
>                        #:key
>                        (linux linux-libre)
>                        (linux-modules '())
> +                      (linux-extra-module-paths '())

Nitpick: I’d call it #:linux-extra-module-path (singular, as in “search
path”) or simply #:linux-extra-module-directories.

If you could introduce a couple of lines in doc/guix.texi to explain
where modules are searched for, that’d be perfect.

Thanks for taking the time to prepare this revision!

Ludo’.