From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: bug#40538: installer: Support uvesafb to install on machines without KMS. Date: Fri, 10 Apr 2020 14:54:47 +0200 Message-ID: <20200410125447.smn6xhcixe7hpday@pelzflorian.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="uiuomdfkzsqeuylv" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:40202) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMtCW-0008GG-BT for bug-guix@gnu.org; Fri, 10 Apr 2020 08:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMtCU-0000vC-8T for bug-guix@gnu.org; Fri, 10 Apr 2020 08:56:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMtCU-0000v6-3k for bug-guix@gnu.org; Fri, 10 Apr 2020 08:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jMtCU-0005ld-2c for bug-guix@gnu.org; Fri, 10 Apr 2020 08:56:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:40038) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMtBO-0007UM-63 for bug-guix@gnu.org; Fri, 10 Apr 2020 08:54:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMtBL-0006aQ-NM for bug-guix@gnu.org; Fri, 10 Apr 2020 08:54:54 -0400 Received: from pelzflorian.de ([5.45.111.108]:46354 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jMtBK-0006Zk-MD for bug-guix@gnu.org; Fri, 10 Apr 2020 08:54:51 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 24B4636055C for ; Fri, 10 Apr 2020 14:54:49 +0200 (CEST) Content-Disposition: inline List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: 40538@debbugs.gnu.org --uiuomdfkzsqeuylv Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable uvesafb should be run in the Guix System installer image so the GUI installer can be used on more systems, including AMD GPU systems. uvesafb is needed to support systems that otherwise need nonfree firmware or drivers (many current and older AMD GPUs as well as old machines like Uniwill U50SI1 with Silicon Integrated Systems GPU). I attach a patch I made previously at (plus proper indentation and copyright statement). I believe it could be included in the installer even though it is a little hacky. Note that the installed system will need uvesafb (or nonfree firmware) too, so the patch alone won=E2=80=99t make these systems work out of the = box. But these things are easier to setup when the system can be installed via the GUI installer. I wrote the same about the issue previously at . On some machines uvesafb still requires to add a kernel parameter nomodeset (or sometimes possibly vga=3D793 or something; nomodeset was enough on tested machines, some machines don=E2=80=99t need nomodeset). In my testing so far uvesafb did not cause any trouble on systems that don=E2=80=99t need it. I have not tested non-x86 systems and just hope t= he code won=E2=80=99t break those. When the dust has settled on the kernel-module-configuration-service discussed by Brice Waegeneire and Danny Milosavljevic , a proper uvesafb service can be added. Then I can make and test one and it could also be used in the installer. That would be the clean solution. In particular, it could detect the resolution to use for uvesafb automatically by running the attached code testvbe.scm as root. But how to run that code depends on the kernel-module-configuration-service if/when it exists. (I did not know how to extend etc-service-type with a file created at runtime not build time, but maybe kernel-module-configuration-service works differently anyway.) On Fri, Apr 10, 2020 at 12:38:05PM +0200, Ludovic Court=C3=A8s wrote: > "pelzflorian (Florian Pelz)" skribis: > > On an Acer Aspire 5738PG with ATI Mobility Radeon HD 4570 the > > installer remains black. I pressed ctrl-alt-f3 and typed > > > > modprobe uvesafb v86d=3D$(guix build v86d | head -n1)/sbin/v86d mode_= option=3D1024x768 >=20 > Could we come up with a udev rule or a modprobe.d snippet so that this > happens automatically? >=20 > I found things like: >=20 > https://bbs.archlinux.org/viewtopic.php?id=3D165480 >=20 > Or should we give up on v86d like Gentoo: >=20 > https://wiki.gentoo.org/wiki/Uvesafb >=20 > ? >=20 > (Perhaps this is best discussed in a specific issue on bug-guix.) I believe uvesafb can easily be supported on Guix System via kernel-module-loader-service/configuration-service. Regards, Florian --uiuomdfkzsqeuylv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-installer-Load-uvesafb-kernel-module.patch" Content-Transfer-Encoding: quoted-printable >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 avai= lable (e.g. many AMD GPUs, old SIS GPUs). * gnu/system/install.scm (%installation-services): Add kernel-module-load= er 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 =A9 2016 Andreas Enge ;;; Copyright =A9 2017 Marius Bakke ;;; Copyright =A9 2017, 2019 Tobias Geerinckx-Rice +;;; Copyright =A9 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")) =20 - (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 k= ey(s) - ;; as trusted to allow the installation process to use substit= utes 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 CRD= A for - ;; regulations-compliant WiFi access. - (udev-service #:rules (list lvm2 crda)) - - ;; Add the 'cow-store' service, which users have to start manu= ally - ;; 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 a= s - ;; 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 vary= ing - ;; 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 th= e 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 Tra= mp - ;; 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 amoun= t 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 roo= t + ;; 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=3D= " #$v86d + "/sbin/v= 86d") + "mode_option=3D1024x768"= ))))))) + (simple-service 'uvesafb-configuration etc-service-type + (list `("modprobe.d/uvesafb.conf" + ,(computed-file "uvesafb-options" + uvesafb-options)))= ))) + '())))) =20 (define %issue ;; Greeting. --=20 2.26.0 --uiuomdfkzsqeuylv Content-Type: application/vnd.lotus-screencam Content-Disposition: attachment; filename="testvbe.scm" Content-Transfer-Encoding: quoted-printable (use-modules (ice-9 match) (ice-9 popen))=0A(format #t "~a~%"=0A (let ((in = (open-pipe* OPEN_READ "/gnu/store/2n96ak0dkkbv3kijfi3dxrrxz8pkj0d1-v86d-0.1= =2E10-testvbe/sbin/testvbe")))=0A (define (skip-head)=0A "Skip head o= f testvbe output."=0A (let ((line ((@ (ice-9 textual-ports) get-line) i= n)))=0A (cond ((eof-object? line) (error "Invalid testvbe output."))= =0A ((string=3D? "---------------------------" line) #t)=0A (else= (skip-head)))))=0A (define (line->resolution line)=0A "Return a list= of the horizontal and vertical resolution given=0Ain a LINE of testvbe out= put. The return value is a list of two exact=0Aintegers."=0A (match (f= ilter=0A (lambda (str) (not (string-null? str)))=0A (string-split= line char-set:blank))=0A ((_ _ res _) =0A (map string->numbe= r=0A (list-head (string-split res (char-set #\x #\-)) 2)))))=0A (begin= =0A (skip-head)=0A (let loop ((best (list 800 600)))=0A (let = ((line ((@ (ice-9 textual-ports) get-line) in)))=0A (if (eof-object? line)= =0A (let ((best-string (map number->string best)))=0A (match be= st-string=0A ((horiz vert)=0A (string-append horiz "x" vert)= )))=0A (let ((current (line->resolution line)))=0A (loop (if (>= (apply * current) (apply * best))=0A current=0A best)))))))))=0A=0A --uiuomdfkzsqeuylv--