gnu: install: Add uvesafb service only on targets that support v86d.
Fixes <https://issues.guix.gnu.org/55806>. * gnu/system/install.scm (%installation-services): Refactor into a procedure, so that it can capture the system it's installing for. Conditionally add uvesafb-service-type based on whether v86d is supported by the target architecture. (installation-os)[services]: Use the %installation-service procedure. (uvesafb-shepherd-service): Remove %host-type checks. Signed-off-by: Florian Pelz <pelzflorian@pelzflorian.de>
This commit is contained in:
parent
478d2e4b02
commit
0aa4311790
@ -6,6 +6,7 @@
|
||||
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||
;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
|
||||
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@ -31,8 +32,10 @@
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix monads)
|
||||
#:use-module (guix modules)
|
||||
#:use-module ((guix packages) #:select (package-version))
|
||||
#:use-module ((guix packages) #:select (package-version supported-package?))
|
||||
#:use-module (guix platform)
|
||||
#:use-module ((guix store) #:select (%store-prefix))
|
||||
#:use-module (guix utils)
|
||||
#:use-module (gnu installer)
|
||||
#:use-module (gnu system locale)
|
||||
#:use-module (gnu services avahi)
|
||||
@ -283,11 +286,7 @@ templates under @file{/etc/configuration}.")))
|
||||
(provision '(maybe-uvesafb))
|
||||
(requirement '(file-systems))
|
||||
(start #~(lambda ()
|
||||
;; uvesafb is only supported on x86 and x86_64.
|
||||
(or (not (and (string-suffix? "linux-gnu" %host-type)
|
||||
(or (string-prefix? "x86_64" %host-type)
|
||||
(string-prefix? "i686" %host-type))))
|
||||
(file-exists? "/dev/fb0")
|
||||
(or (file-exists? "/dev/fb0")
|
||||
(invoke #+(file-append kmod "/bin/modprobe")
|
||||
"uvesafb"
|
||||
(string-append "v86d=" #$v86d "/sbin/v86d")
|
||||
@ -305,7 +304,10 @@ templates under @file{/etc/configuration}.")))
|
||||
"Load the @code{uvesafb} kernel module with the right options.")
|
||||
(default-value #t)))
|
||||
|
||||
(define %installation-services
|
||||
(define* (%installation-services #:key (system (or (and=>
|
||||
(%current-target-system)
|
||||
platform-target->system)
|
||||
(%current-system))))
|
||||
;; List of services of the installation system.
|
||||
(let ((motd (plain-file "motd" "
|
||||
\x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
|
||||
@ -322,6 +324,8 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
|
||||
(define bare-bones-os
|
||||
(load "examples/bare-bones.tmpl"))
|
||||
|
||||
(append
|
||||
;; Generic services
|
||||
(list (service virtual-terminal-service-type)
|
||||
|
||||
(service kmscon-service-type
|
||||
@ -428,13 +432,17 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
|
||||
glibc-utf8-locales
|
||||
texinfo
|
||||
guile-3.0)
|
||||
%default-locale-libcs))
|
||||
%default-locale-libcs)))
|
||||
|
||||
;; Specific system services
|
||||
|
||||
;; Machines without Kernel Mode Setting (those with many old and
|
||||
;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI
|
||||
;; installer. Some may also need a kernel parameter like nomodeset
|
||||
;; or vga=793, but we leave that for the user to specify in GRUB.
|
||||
(service uvesafb-service-type))))
|
||||
`(,@(if (supported-package? v86d system)
|
||||
(list (service uvesafb-service-type))
|
||||
'())))))
|
||||
|
||||
(define %issue
|
||||
;; Greeting.
|
||||
@ -498,7 +506,7 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
|
||||
(comment "Guest of GNU"))))
|
||||
|
||||
(issue %issue)
|
||||
(services %installation-services)
|
||||
(services (%installation-services))
|
||||
|
||||
;; We don't need setuid programs, except for 'passwd', which can be handy
|
||||
;; if one is to allow remote SSH login to the machine being installed.
|
||||
|
Loading…
Reference in New Issue
Block a user