diff mbox series

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

Message ID 5354211586005255@vla1-74bb1214b343.qloud-c.yandex.net
State Accepted
Headers show
Series [bug#40430] Don’t attempt to create a module database when none are available | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Ivan Kozlov April 4, 2020, 4:16 p.m. UTC
The present code breaks with a non-modular kernel. This can be easily avoided.

Comments

Danny Milosavljevic April 4, 2020, 8:05 p.m. UTC | #1
Thanks!

Pushed to guix master as commit b2fff3b5de7d510fe4809e9a97089dddf2a39ffc.
Ludovic Courtès April 20, 2020, 10:12 p.m. UTC | #2
Hi,

Ivan Kozlov <kanichos@yandex.ru> 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’.
Ivan Kozlov June 12, 2020, 6:04 p.m. UTC | #3
The intent was to allow a Linux package with CONFIG_MODULES=n to work after 5c79f238634c5adb6657f1b4b1bb4ddb8bb73ef1. There are no modules and no ‘lib/modules’.

Will you accept a patch that changes linux-module-database to skip unsuitable inputs instead?

21.04.2020, 01:12, "Ludovic Courtès" <ludo@gnu.org>:
> 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’.
diff mbox series

Patch

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