Don’t attempt to create a module database when none are available

  • Open
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Ivan Kozlov
  • Ludovic Courtès
Owner
unassigned
Submitted by
Ivan Kozlov
Severity
normal

Debbugs page

I
I
Ivan Kozlov wrote on 4 Apr 2020 09:16
Don’t attempt to create a module database when none are av ailable
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
5354211586005255@vla1-74bb1214b343.qloud-c.yandex.net
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)
D
D
Danny Milosavljevic wrote on 4 Apr 2020 13:05
Re: [bug#40430] Don’t attempt to create a module database when none are available
(name . Ivan Kozlov)(address . kanichos@yandex.ru)(address . 40430-done@debbugs.gnu.org)
20200404220549.7ad7bac5@scratchpost.org
Thanks!

Pushed to guix master as commit b2fff3b5de7d510fe4809e9a97089dddf2a39ffc.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6I6J0ACgkQ5xo1VCww
uqVm/Af/dIo6ZSARuAZ92YJtpdaKPxFtbmOwAfknE1RClhbAp1gMyc0g4kufxgYx
FXOH6YT1z0o3NFtrN6pEB+Ssx0T5otrWPpct57o8aQu3S7Xn38dhrGsISvGjcPee
uANptsAGmiYKGtkQvKqWZURr7bnmnSioP3xK3gH8AuqyMqXut0mApw+7YHlvMTRK
UcIz9W2jbwLmS0pFmgFa+g7+9CscfOFoBI+251iu4xNBnSrF4z5W3lGIRTrAKV0c
UsM3sh2HlQsokPBuVYrCh+hlWHcd6ijYI0JmwHgKuQwctfOlOp+UOpMmlfuL/Pfc
fesa/qr2P2GPR2j8L18DNNUwsoR9gA==
=5xZD
-----END PGP SIGNATURE-----


Closed
L
L
Ludovic Courtès wrote on 20 Apr 2020 15:12
(name . Ivan Kozlov)(address . kanichos@yandex.ru)
87h7xdzu07.fsf@gnu.org
Hi,

Ivan Kozlov <kanichos@yandex.ru> skribis:

Toggle quote (26 lines)
> 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:


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

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 25 May 2020 13:12
control message for bug #40430
(address . control@debbugs.gnu.org)
878shfvko4.fsf@gnu.org
tags 40430 + moreinfo
quit
I
I
Ivan Kozlov wrote on 12 Jun 2020 11:04
Re: [bug#40430] Don’t attempt to create a module database when none are available
(name . Ludovic Courtès)(address . ludo@gnu.org)
1209511591984636@mail.yandex.ru
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>:
Toggle quote (10 lines)
> 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’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 40430@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 40430
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch