GNU bug report logs - #55806
gnu/system/install.scm includes (service uvesafb-service-type) in %installation-services on all architectures

Previous Next

Package: guix;

Reported by: Pavel Shlyak <p.shlyak <at> pantherx.org>

Date: Sun, 5 Jun 2022 12:21:02 UTC

Severity: normal

Done: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55806 in the body.
You can then email your comments to 55806 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Sun, 05 Jun 2022 12:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pavel Shlyak <p.shlyak <at> pantherx.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 05 Jun 2022 12:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: bug-guix <at> gnu.org
Subject: gnu/system/install.scm includes (service uvesafb-service-type) in
 %installation-services on all architectures
Date: Sun, 5 Jun 2022 15:20:09 +0300
Reproducer:
guix system image -t iso9660 gnu/system/install.scm
This command fails on aarch64 host. It doesn’t if I manually remove uvesafb-service-type from the list. It is impossible(and not needed) to run uvesafb on non-x86 machines at the moment, so I think it should be included only in x86_64 (and probably 32bit x86 as well) builds.



Information forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Mon, 06 Jun 2022 13:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 55806 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Pavel Shlyak <p.shlyak <at> pantherx.org>, 55806 <at> debbugs.gnu.org
Subject: Re: bug#55806: gnu/system/install.scm includes (service
 uvesafb-service-type) in %installation-services on all architectures
Date: Mon, 06 Jun 2022 15:28:31 +0200
Hi,
Pavel Shlyak <p.shlyak <at> pantherx.org> writes:

> Reproducer:
> guix system image -t iso9660 gnu/system/install.scm
> This command fails on aarch64 host. It doesn’t if I manually remove uvesafb-service-type from the list. It is impossible(and not needed) to run uvesafb on non-x86 machines at the moment, so I think it should be included only in x86_64 (and probably 32bit x86 as well) builds.

I can definitely write a patch for that, it won't be worse that what we
have right now.  I wonder how we could handle the case when there's no
KMS for a particular hardware combination (if that's possible), since
kmscon requires that.  FTR, we require kmscon to be able to display
non-latin fonts such as CJK or arabic in the installer.

Now that I think about it, if we have a hard requirement on KMS, we
could just use a lightweight wayland compositor like cage to display the
installer, which would likely simplify the process since we'd have more
"usual" tools at our disposal.

Best,
-- 
Josselin Poiret




Information forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Mon, 06 Jun 2022 14:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 55806 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Josselin Poiret <dev <at> jpoiret.xyz>, Pavel Shlyak <p.shlyak <at> pantherx.org>,
 55806 <at> debbugs.gnu.org
Subject: [PATCH] gnu: install: Add uvesafb service only on targets that
 support v86d.
Date: Mon,  6 Jun 2022 16:16:34 +0200
* 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.
---
 gnu/system/install.scm | 245 +++++++++++++++++++++--------------------
 1 file changed, 128 insertions(+), 117 deletions(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index e46c1d34dd..5e4215864e 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -31,8 +31,10 @@ (define-module (gnu system install)
   #: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)
@@ -305,7 +307,10 @@ (define uvesafb-service-type
     "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,120 +327,126 @@ (define (normal-tty tty)
     (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)
-
-          ;; Use the Avahi daemon to discover substitute servers on the local
-          ;; network.  It can be faster than fetching from remote servers.
-          (service avahi-service-type)
-
-          ;; 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)
-                                       (guix (current-guix))))
-
-          ;; 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 bash "/bin/sh"))))
-
-          ;; Loopback device, needed by OpenSSH notably.
-          (service static-networking-service-type
-                   (list %loopback-static-networking))
-
-          (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
-                   (append
-                    (list bare-bones-os
-                          glibc-utf8-locales
-                          texinfo
-                          guile-3.0)
-                    %default-locale-libcs))
-
-          ;; 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))))
+    (append
+     ;; Generic services
+     (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)
+
+           ;; Use the Avahi daemon to discover substitute servers on the local
+           ;; network.  It can be faster than fetching from remote servers.
+           (service avahi-service-type)
+
+           ;; 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)
+                                        (guix (current-guix))))
+
+           ;; 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 bash "/bin/sh"))))
+
+           ;; Loopback device, needed by OpenSSH notably.
+           (service static-networking-service-type
+                    (list %loopback-static-networking))
+
+           (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
+                    (append
+                     (list bare-bones-os
+                           glibc-utf8-locales
+                           texinfo
+                           guile-3.0)
+                     %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.
+     `(,@(if (supported-package? v86d system)
+             (list (service uvesafb-service-type))
+             '())))))
 
 (define %issue
   ;; Greeting.
@@ -499,7 +510,7 @@ (define installation-os
                   (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.
-- 
2.36.1





Information forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Mon, 06 Jun 2022 16:10:02 GMT) Full text and rfc822 format available.

Message #14 received at 55806 <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: Pavel Shlyak <p.shlyak <at> pantherx.org>, 55806 <at> debbugs.gnu.org
Subject: Re: bug#55806: [PATCH] gnu: install: Add uvesafb service only on
 targets that support v86d.
Date: Mon, 6 Jun 2022 18:09:31 +0200
Thank you so much Josselin.  I didn't know how to do this.
At the time building for ARM was no priority.

On Mon, Jun 06, 2022 at 04:16:34PM +0200, Josselin Poiret via Bug reports for GNU Guix wrote:
> -          (service guix-service-type
> -                   (guix-configuration (authorize-key? #t)
> -                                       (guix (current-guix))))

I had to remove the (guix (current-guix)) but now `guix system image
-t iso9660 gnu/system/install.scm` builds on a rock64 aarch64 machine,
but it is still building and I could not yet test in qemu.  I have not
tried the embedded-installation image.

(I also had to disable tests on guile-fibers, but it is unrelated to
the bug and may be needed only on rock64, which has other unrelated
hangups when much RAM is used.)

I don't commit much except translations, but guess I should remove the
not working %host-type shenanigans in uvesafb-service-type, add your
copyright line and push.  I will do so when there are no other
comments.

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Mon, 06 Jun 2022 17:16:01 GMT) Full text and rfc822 format available.

Message #17 received at 55806 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
Cc: Pavel Shlyak <p.shlyak <at> pantherx.org>, 55806 <at> debbugs.gnu.org
Subject: Re: bug#55806: [PATCH] gnu: install: Add uvesafb service only on
 targets that support v86d.
Date: Mon, 06 Jun 2022 19:15:48 +0200
Hello Florian,
"pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de> writes:

> On Mon, Jun 06, 2022 at 04:16:34PM +0200, Josselin Poiret via Bug reports for GNU Guix wrote:
>> -          (service guix-service-type
>> -                   (guix-configuration (authorize-key? #t)
>> -                                       (guix (current-guix))))
>
> I had to remove the (guix (current-guix)) but now `guix system image
> -t iso9660 gnu/system/install.scm` builds on a rock64 aarch64 machine,
> but it is still building and I could not yet test in qemu.  I have not
> tried the embedded-installation image.

Silly me, I really should move some of my WIP patches to other branches
to avoid these issues :(

Feel free to commit with the changes you mentioned, and thanks for the
tests (I only checked minimally with cross-compilation since I don't
have any aarch64 machines)!

Best,
-- 
Josselin Poiret




Reply sent to "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>:
You have taken responsibility. (Tue, 07 Jun 2022 10:51:02 GMT) Full text and rfc822 format available.

Notification sent to Pavel Shlyak <p.shlyak <at> pantherx.org>:
bug acknowledged by developer. (Tue, 07 Jun 2022 10:51:02 GMT) Full text and rfc822 format available.

Message #22 received at 55806-done <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: 55806-done <at> debbugs.gnu.org, Pavel Shlyak <p.shlyak <at> pantherx.org>
Subject: Re: bug#55806: [PATCH] gnu: install: Add uvesafb service only on
 targets that support v86d.
Date: Tue, 7 Jun 2022 12:50:09 +0200
Pushed as 0aa43117907581779cf3f343c6175d98369b7e07.

Closing, even though I didn’t manage to boot it on QEMU.

Ideally Guix System would run as seemlessly as the Ubuntu ARM cdimages
work on Macs, but I can’t test and it is a different issue.

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#55806; Package guix. (Tue, 07 Jun 2022 11:06:01 GMT) Full text and rfc822 format available.

Message #25 received at 55806-done <at> debbugs.gnu.org (full text, mbox):

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Josselin Poiret <dev <at> jpoiret.xyz>
Cc: 55806-done <at> debbugs.gnu.org, Pavel Shlyak <p.shlyak <at> pantherx.org>
Subject: Re: bug#55806: [PATCH] gnu: install: Add uvesafb service only on
 targets that support v86d.
Date: Tue, 7 Jun 2022 13:05:19 +0200
On Tue, Jun 07, 2022 at 12:50:26PM +0200, pelzflorian (Florian Pelz) wrote:
> Ideally Guix System would run as seemlessly as the Ubuntu ARM cdimages
> work on Macs, but I can’t test and it is a different issue.

*on QEMU on Macs




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Jul 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.