>From de24448076379a1792a7e1031471d5ae33c8c440 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Fri, 10 Apr 2020 14:35:38 +0200 Subject: [PATCH] installer: Load uvesafb kernel module. This enables the installer to display when no Kernel Mode Setting is available (e.g. many AMD GPUs, old SIS GPUs). * gnu/system/install.scm (%installation-services): Add kernel-module-loader service for loading uvesafb. --- gnu/system/install.scm | 231 ++++++++++++++++++++++------------------- 1 file changed, 126 insertions(+), 105 deletions(-) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index c15c2c7814..d9fc0a6941 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Andreas Enge ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2020 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,11 +27,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 +53,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,111 +308,128 @@ 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) - - (service kmscon-service-type - (kmscon-configuration - (virtual-terminal "tty1") - (login-program (installer-program)))) - - (login-service (login-configuration - (motd motd))) - - ;; Documentation. The manual is in UTF-8, but - ;; 'console-font-service' sets up Unicode support and loads a font - ;; with all the useful glyphs like em dash and quotation marks. - (service documentation-service-type "tty2") - - ;; Documentation add-on. - %configuration-template-service - - ;; A bunch of 'root' ttys. - (normal-tty "tty3") - (normal-tty "tty4") - (normal-tty "tty5") - (normal-tty "tty6") - - ;; The usual services. - (syslog-service) - - ;; The build daemon. Register the default substitute server key(s) - ;; as trusted to allow the installation process to use substitutes by - ;; default. - (service guix-service-type - (guix-configuration (authorize-key? #t))) - - ;; Start udev so that useful device nodes are available. - ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for - ;; regulations-compliant WiFi access. - (udev-service #:rules (list lvm2 crda)) - - ;; Add the 'cow-store' service, which users have to start manually - ;; since it takes the installation directory as an argument. - (cow-store-service) - - ;; Install Unicode support and a suitable font. - (service console-font-service-type - (map (match-lambda - ("tty2" - ;; Use a font that contains characters such as - ;; curly quotes as found in the manual. - '("tty2" . "LatGrkCyr-8x16")) - (tty - ;; Use a font that doesn't have more than 256 - ;; glyphs so that we can use colors with varying - ;; brightness levels (see note in setfont(8)). - `(,tty . "lat9u-16"))) - '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) - - ;; To facilitate copy/paste. - (service gpm-service-type) - - ;; Add an SSH server to facilitate remote installs. - (service openssh-service-type - (openssh-configuration - (port-number 22) - (permit-root-login #t) - ;; The root account is passwordless, so make sure - ;; a password is set before allowing logins. - (allow-empty-passwords? #f) - (password-authentication? #t) - - ;; Don't start it upfront. - (%auto-start? #f))) - - ;; Since this is running on a USB stick with a overlayfs as the root - ;; file system, use an appropriate cache configuration. - (nscd-service (nscd-configuration - (caches %nscd-minimal-caches))) - - ;; Having /bin/sh is a good idea. In particular it allows Tramp - ;; connections to this system to work. - (service special-files-service-type - `(("/bin/sh" ,(file-append (canonical-package bash) - "/bin/sh")))) - - ;; Loopback device, needed by OpenSSH notably. - (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback))))) - - (service wpa-supplicant-service-type) - (dbus-service) - (service connman-service-type - (connman-configuration - (disable-vpn? #t))) - - ;; Keep a reference to BARE-BONES-OS to make sure it can be - ;; installed without downloading/building anything. Also keep the - ;; things needed by 'profile-derivation' to minimize the amount of - ;; download. - (service gc-root-service-type - (list bare-bones-os - glibc-utf8-locales - texinfo - (canonical-package guile-2.2)))))) + (cons* + (service virtual-terminal-service-type) + + (service kmscon-service-type + (kmscon-configuration + (virtual-terminal "tty1") + (login-program (installer-program)))) + + (login-service (login-configuration + (motd motd))) + + ;; Documentation. The manual is in UTF-8, but + ;; 'console-font-service' sets up Unicode support and loads a font + ;; with all the useful glyphs like em dash and quotation marks. + (service documentation-service-type "tty2") + + ;; Documentation add-on. + %configuration-template-service + + ;; A bunch of 'root' ttys. + (normal-tty "tty3") + (normal-tty "tty4") + (normal-tty "tty5") + (normal-tty "tty6") + + ;; The usual services. + (syslog-service) + + ;; The build daemon. Register the default substitute server key(s) + ;; as trusted to allow the installation process to use substitutes by + ;; default. + (service guix-service-type + (guix-configuration (authorize-key? #t))) + + ;; Start udev so that useful device nodes are available. + ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for + ;; regulations-compliant WiFi access. + (udev-service #:rules (list lvm2 crda)) + + ;; Add the 'cow-store' service, which users have to start manually + ;; since it takes the installation directory as an argument. + (cow-store-service) + + ;; Install Unicode support and a suitable font. + (service console-font-service-type + (map (match-lambda + ("tty2" + ;; Use a font that contains characters such as + ;; curly quotes as found in the manual. + '("tty2" . "LatGrkCyr-8x16")) + (tty + ;; Use a font that doesn't have more than 256 + ;; glyphs so that we can use colors with varying + ;; brightness levels (see note in setfont(8)). + `(,tty . "lat9u-16"))) + '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) + + ;; To facilitate copy/paste. + (service gpm-service-type) + + ;; Add an SSH server to facilitate remote installs. + (service openssh-service-type + (openssh-configuration + (port-number 22) + (permit-root-login #t) + ;; The root account is passwordless, so make sure + ;; a password is set before allowing logins. + (allow-empty-passwords? #f) + (password-authentication? #t) + + ;; Don't start it upfront. + (%auto-start? #f))) + + ;; Since this is running on a USB stick with a overlayfs as the root + ;; file system, use an appropriate cache configuration. + (nscd-service (nscd-configuration + (caches %nscd-minimal-caches))) + + ;; Having /bin/sh is a good idea. In particular it allows Tramp + ;; connections to this system to work. + (service special-files-service-type + `(("/bin/sh" ,(file-append (canonical-package bash) + "/bin/sh")))) + + ;; Loopback device, needed by OpenSSH notably. + (service static-networking-service-type + (list (static-networking (interface "lo") + (ip "127.0.0.1") + (requirement '()) + (provision '(loopback))))) + + (service wpa-supplicant-service-type) + (dbus-service) + (service connman-service-type + (connman-configuration + (disable-vpn? #t))) + + ;; Keep a reference to BARE-BONES-OS to make sure it can be + ;; installed without downloading/building anything. Also keep the + ;; things needed by 'profile-derivation' to minimize the amount of + ;; download. + (service gc-root-service-type + (list bare-bones-os + glibc-utf8-locales + texinfo + (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. -- 2.26.0