Subject: Re: [bug#40274] [PATCH v6 2/2] gnu: Add kernel-module-loader-service.

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Sat, 4 Apr 2020 19:46:34 +0200

On Sat, Apr 04, 2020 at 04:49:16PM +0000, Brice Waegeneire wrote:
> Please do send feedback on using it, especially since you are the only one
> in need of specifying module parameters ATM. I kept your usage in mind when
> writing this patch version.
> 
> - Brice

It does not seem to work.  There is nothing in /var/log/messages but
when I do

[email-masked] # herd start kernel-module-loader
herd: exception caught while executing 'start' on service 'kernel-module-loader':
In procedure module-lookup: Unbound variable: get-line

I attach my changes.

Regards,
Florian
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index c15c2c7814..1348c63f25 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,23 @@ 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.
+              `(,(service kernel-module-loader-service-type '("uvesafb"))
+                ,(let ((uvesafb-options
+                        #~(with-output-to-file #$output
+                            (lambda _
+                              (format #t
+                                (string-join `("options" "uvesafb"
+                                               ,(string-append "v86d=" #$v86d
+                                                               "/sbin/v86d")
+                                               "mode_option=1024x768")))))))
+                   (simple-service 'uvesafb-configuration etc-service-type
+                                   (list `("modprobe.d/uvesafb.conf"
+                                           ,(computed-file "uvesafb-options"
+                                                           uvesafb-options))))))
+              '()))))
 
 (define %issue
   ;; Greeting.