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

OpenSubmitted by Ivan Kozlov.
Details
3 participants
  • Danny Milosavljevic
  • Ivan Kozlov
  • Ludovic Courtès
Owner
unassigned
Severity
normal
I
I
Ivan Kozlov wrote on 4 Apr 2020 18: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 22: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-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6I6J0ACgkQ5xo1VCwwuqVm/Af/dIo6ZSARuAZ92YJtpdaKPxFtbmOwAfknE1RClhbAp1gMyc0g4kufxgYxFXOH6YT1z0o3NFtrN6pEB+Ssx0T5otrWPpct57o8aQu3S7Xn38dhrGsISvGjcPeeuANptsAGmiYKGtkQvKqWZURr7bnmnSioP3xK3gH8AuqyMqXut0mApw+7YHlvMTRKUcIz9W2jbwLmS0pFmgFa+g7+9CscfOFoBI+251iu4xNBnSrF4z5W3lGIRTrAKV0cUsM3sh2HlQsokPBuVYrCh+hlWHcd6ijYI0JmwHgKuQwctfOlOp+UOpMmlfuL/Pfcfesa/qr2P2GPR2j8L18DNNUwsoR9gA===5xZD-----END PGP SIGNATURE-----

Closed
L
L
Ludovic Courtès wrote on 21 Apr 2020 00: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 allmake 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’.
L
L
Ludovic Courtès wrote on 25 May 2020 22:12
control message for bug #40430
(address . control@debbugs.gnu.org)
878shfvko4.fsf@gnu.org
tags 40430 + moreinfoquit
I
I
Ivan Kozlov wrote on 12 Jun 2020 20: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 email to 40430@debbugs.gnu.org