Subject: Re: [bug#40430] Don’t attempt to create a module database when none are available

From: Ludovic Courtès <[email-masked]>
Date: Tue, 21 Apr 2020 00:12:40 +0200

Hi,

Ivan Kozlov <[email-masked]> skribis:

> The present code breaks with a non-modular kernel. This can be easily avoided.
>
> --- a/gnu/system.scm
> +++ #<buffer system.scm>
> @@ -477,13 +477,19 @@
>  value of the SYSTEM-SERVICE-TYPE service."
>    (let ((locale (operating-system-locale-directory os)))
>      (mlet* %store-monad ((kernel -> (operating-system-kernel os))
> +                         (kernel-modules (package-file kernel "lib/modules"))
>                           (modules ->
>                            (operating-system-kernel-loadable-modules os))
> +                         (has-modules ->
> +                          (or (not (null? modules))
> +                              (file-exists? kernel-modules)))
>                           (kernel
>                            (profile-derivation
>                             (packages->manifest
>                              (cons kernel modules))
> -                           #:hooks (list linux-module-database)))
> +                           #:hooks (if has-modules
> +                                       (list linux-module-database)
> +                                       '())))
>                           (initrd -> (operating-system-initrd-file os))
>                           (params    (operating-system-boot-parameters-file os)))
>        (return `(("kernel" ,kernel)

There were a couple of mistakes in this patch (which is fine, we all
make mistakes!), so I reverted it along with explanations:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=71977a6c59460e029c91741c8b11f3a544a70486

What problem were you trying to solve, Ivan?  What do you mean by
“non-modular kernel”?

Thanks,
Ludo’.