diff mbox series

[bug#40274,v4] gnu: Add kernel-module-loader-service.

Message ID 20200401193458.evg46ygamtniby7k@pelzflorian.localdomain
State Accepted
Headers show
Series [bug#40274,v4] gnu: Add kernel-module-loader-service. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

pelzflorian (Florian Pelz) April 1, 2020, 7:34 p.m. UTC
Thank you for your patch.

I tried with your patch to make the Guix install image load the
uvesafb kernel module, but it fails and I get no log.  Is it possible
to make the service log failures?

I just get:

failed to load service: kernel-module-loader

printed on the console (but not to /var/log/messages).

I believe I pass parameters wrongly.  I attach how I try to use your
kernel-module-loader.

Regards,
Florian

Comments

pelzflorian (Florian Pelz) April 1, 2020, 7:43 p.m. UTC | #1
On Wed, Apr 01, 2020 at 09:34:58PM +0200, pelzflorian (Florian Pelz) wrote:
> I believe I pass parameters wrongly.  I attach how I try to use your
> kernel-module-loader.

Of course my quoting was wrong.

Nonetheless could you add logging/errors if possible?
pelzflorian (Florian Pelz) April 1, 2020, 7:48 p.m. UTC | #2
On Wed, Apr 01, 2020 at 09:34:58PM +0200, pelzflorian (Florian Pelz) wrote:
> I believe I pass parameters wrongly.  I attach how I try to use your
> kernel-module-loader.

Also I cannot use gexps in module parameters.

Regards,
Florian
Brice Waegeneire April 2, 2020, 12:40 p.m. UTC | #3
Hello Florian,

Thank you for trying out this new service.

On 2020-04-01 19:34, pelzflorian (Florian Pelz) wrote:
> I tried with your patch to make the Guix install image load the
> uvesafb kernel module, but it fails and I get no log.  Is it possible
> to make the service log failures?
> 
> I just get:
> 
> failed to load service: kernel-module-loader
> 
> printed on the console (but not to /var/log/messages).

This a message saying it can't load that service, in this case because
it's parameters weren't formatted correctly, this is not specific to
this service that's how shepherd handle failing to load a service.
Please open a new issue about it if you think (as I do) that shepherd
should be more explicit when it fails to load a service.

Regarding this service, logging has been implemented in v5; the output
of modprobe will be logged if it fails, for example when trying to load
an invalid kernel module like “foo”.

- Brice
pelzflorian (Florian Pelz) April 3, 2020, 1:03 p.m. UTC | #4
On Thu, Apr 02, 2020 at 12:40:00PM +0000, Brice Waegeneire wrote:
> On 2020-04-01 19:34, pelzflorian (Florian Pelz) wrote:
> > failed to load service: kernel-module-loader
> This a message saying it can't load that service, in this case because
> it's parameters weren't formatted correctly, this is not specific to
> this service that's how shepherd handle failing to load a service.
> Please open a new issue about it if you think (as I do) that shepherd
> should be more explicit when it fails to load a service.

I meant compilation could fail if the parameters are incorrect.  I do
not know how else Shepherd should fail.  But this is not very
important and applies to many other services as well.

Thank you for adding logging.  All this works well (in testing, I have
not read the code).

Regards,
Florian
diff mbox series

Patch

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index c15c2c7814..aa42449098 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -26,11 +26,13 @@ 
   #:use-module (gnu bootloader u-boot)
   #:use-module (guix gexp)
   #:use-module (guix store)
+  #:use-module (guix utils)
   #:use-module (guix monads)
   #:use-module ((guix packages) #:select (package-version))
   #:use-module ((guix store) #:select (%store-prefix))
   #:use-module (gnu installer)
   #:use-module (gnu services dbus)
+  #:use-module (gnu services linux)
   #:use-module (gnu services networking)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services ssh)
@@ -50,6 +52,7 @@ 
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages nvi)
+  #:use-module (gnu packages xorg)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-26)
   #:export (installation-os
@@ -304,7 +307,8 @@  Access documentation at any time by pressing Alt-F2.\x1b[0m
     (define bare-bones-os
       (load "examples/bare-bones.tmpl"))
 
-    (list (service virtual-terminal-service-type)
+    (cons*
+          (service virtual-terminal-service-type)
 
           (service kmscon-service-type
                    (kmscon-configuration
@@ -408,7 +412,13 @@  Access documentation at any time by pressing Alt-F2.\x1b[0m
                    (list bare-bones-os
                          glibc-utf8-locales
                          texinfo
-                         (canonical-package guile-2.2))))))
+                         (canonical-package guile-2.2)))
+          (if (member (%current-system) '("x86_64-linux" "i686-linux"))
+              ;; Load uvesafb to show installer when no KMS is available.
+              `(,(kernel-module-loader-service
+                  '(("uvesafb" (string-append "v86d=" #$v86d "/sbin/v86d")
+                     "mode_option=1024x768"))))
+              '()))))
 
 (define %issue
   ;; Greeting.