GNU bug report logs - #41120
uvesafb service is unsupported on aarch64

Previous Next

Package: guix;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Thu, 7 May 2020 05:41:01 UTC

Severity: normal

Merged with 48393

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 41120 in the body.
You can then email your comments to 41120 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#41120; Package guix. (Thu, 07 May 2020 05:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 07 May 2020 05:41:02 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: bug-guix <at> gnu.org
Subject: uvesafb service is unsupported on aarch64
Date: Thu, 7 May 2020 08:40:15 +0300
[Message part 1 (text/plain, inline)]
the uvesafb-service which was added to the installation image isn't
supported on aarch64 (or probably any non-x86 system) and causes the
creation of an installation image to fail.


-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 07 May 2020 07:07:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 07 May 2020 09:06:21 +0200
Hello Efraim,

> the uvesafb-service which was added to the installation image isn't
> supported on aarch64 (or probably any non-x86 system) and causes the
> creation of an installation image to fail.

Thanks for reporting. There's this small snippet in uvesafb-service:

--8<---------------cut here---------------start------------->8---
  (or (not (and (string-suffix? "linux-gnu" %host-type)
                (or (string-prefix? "x86_64" %host-type)
                    (string-prefix? "i686" %host-type))))
--8<---------------cut here---------------end--------------->8---

which must then fail? Do you have a specific error message?

Thanks,

Mathieu




Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 07 May 2020 08:07:02 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 7 May 2020 11:05:22 +0300
[Message part 1 (text/plain, inline)]
On Thu, May 07, 2020 at 09:06:21AM +0200, Mathieu Othacehe wrote:
> 
> Hello Efraim,
> 
> > the uvesafb-service which was added to the installation image isn't
> > supported on aarch64 (or probably any non-x86 system) and causes the
> > creation of an installation image to fail.
> 
> Thanks for reporting. There's this small snippet in uvesafb-service:
> 
> --8<---------------cut here---------------start------------->8---
>   (or (not (and (string-suffix? "linux-gnu" %host-type)
>                 (or (string-prefix? "x86_64" %host-type)
>                     (string-prefix? "i686" %host-type))))
> --8<---------------cut here---------------end--------------->8---
> 
> which must then fail? Do you have a specific error message?
> 

It fails while building v86d. Looking at the or statement, it should
probably close after (file-exists? "/dev/fb0") and then the whole thing
wrapped in a when or an if. I checked and /dev/fb0 doesn't exist on my
machine.

Actually that didn't make a difference, it still tried to build v86d.
Even changing the '(or (not' to '(if (and (and' it still tries to build
v86d. My guess is that it's not evaluating the conditionals until it's
time to run the service so it makes sure v86d is there.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 07 May 2020 08:14:02 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 7 May 2020 11:12:34 +0300
[Message part 1 (text/plain, inline)]
On Thu, May 07, 2020 at 09:06:21AM +0200, Mathieu Othacehe wrote:
> 
> Hello Efraim,
> 
> > the uvesafb-service which was added to the installation image isn't
> > supported on aarch64 (or probably any non-x86 system) and causes the
> > creation of an installation image to fail.
> 
> Thanks for reporting. There's this small snippet in uvesafb-service:
> 
> --8<---------------cut here---------------start------------->8---
>   (or (not (and (string-suffix? "linux-gnu" %host-type)
>                 (or (string-prefix? "x86_64" %host-type)
>                     (string-prefix? "i686" %host-type))))
> --8<---------------cut here---------------end--------------->8---
> 
> which must then fail? Do you have a specific error message?
> 

I haven't tested the produced image, but the following builds without
trying to also build v86d

         (start
           (if (and (and (string-suffix? "linux-gnu" %host-type)
                         (or (string-prefix? "x86_64" %host-type)
                             (string-prefix? "i686" %host-type)))
                    (file-exists? "/dev/fb0"))
             #~(lambda ()
                 ;; uvesafb is only supported on x86 and x86_64.
                 (invoke #+(file-append kmod "/bin/modprobe")
                         "uvesafb"
                         (string-append "v86d=" #$v86d "/sbin/v86d")
                         "mode_option=1024x768"))
             #~(lambda () #t)))

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 07 May 2020 14:56:01 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Mathieu Othacehe <m.othacehe <at> gmail.com>, 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 7 May 2020 16:55:11 +0200
[Message part 1 (text/plain, inline)]
On Thu, May 07, 2020 at 11:12:34AM +0300, Efraim Flashner wrote:
> I haven't tested the produced image, but the following builds without
> trying to also build v86d
> 
>          (start
>            (if (and (and (string-suffix? "linux-gnu" %host-type)
>                          (or (string-prefix? "x86_64" %host-type)
>                              (string-prefix? "i686" %host-type)))
>                     (file-exists? "/dev/fb0"))
>              #~(lambda ()
>                  ;; uvesafb is only supported on x86 and x86_64.
>                  (invoke #+(file-append kmod "/bin/modprobe")
>                          "uvesafb"
>                          (string-append "v86d=" #$v86d "/sbin/v86d")
>                          "mode_option=1024x768"))
>              #~(lambda () #t)))

This way uvesafb is started unconditionally on x86_64, even when it is
not needed, leading to video corruption on some boots in QEMU.

I have more success with moving the file-exists check into the
#~(lambda …) like the attached patch.  But I’m not sure it really
fixes ARM builds.

I tested via

qemu-system-x86_64 -m 1024 -smp 1 -enable-kvm -nic user,model=virtio-net-pci -boot menu=on,order=d -drive media=cdrom,file=/gnu/store/0cgbp4y7awk4spg49ajw077xyzk24fi0-iso9660-image

and on hardware.  With QEMU, uvesafb is needed if and only if
nomodeset is passed as a kernel parameter.

Now how to build an ARM image for QEMU?

Sorry I left such a mess with uvesafb.

Regards,
Florian
[0001-installer-Do-not-load-uvesafb-on-non-x86-install-ima.patch (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 07 May 2020 14:59:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: Mathieu Othacehe <m.othacehe <at> gmail.com>, 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 7 May 2020 16:58:01 +0200
[Message part 1 (text/plain, inline)]
On Thu, May 07, 2020 at 04:55:13PM +0200, pelzflorian (Florian Pelz) wrote:
> I have more success with moving the file-exists check into the
> #~(lambda …) like the attached patch.

Sorry I forgot to git add.  This is the patch.
[0001-installer-Do-not-load-uvesafb-on-non-x86-install-ima.patch (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Fri, 08 May 2020 09:10:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: dannym <at> scratchpost.org, ludo <at> gnu.org, janneke <at> gnu.org,
 Efraim Flashner <efraim <at> flashner.co.il>, 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Fri, 08 May 2020 11:09:03 +0200
Hello,

Thanks for working on that Florian & Efraim.

> +           (if (and (string-suffix? "linux-gnu" %host-type)
> +                    (or (string-prefix? "x86_64" %host-type)
> +                        (string-prefix? "i686" %host-type)))
> +               #~(lambda ()
> +                   ;; uvesafb is only supported on x86 and x86_64.
> +                   (or (file-exists? "/dev/fb0")
> +                       (invoke #+(file-append kmod "/bin/modprobe")
> +                               "uvesafb"
> +                               (string-append "v86d=" #$v86d "/sbin/v86d")
> +                               "mode_option=1024x768")))
> +               #~(lambda () #t)))
>           (respawn? #f)
>           (one-shot? #t))))

The issue with using %host-type at build time is that it won't support
system build with --system and --target. For instance if cross-compiling
for aarch64-linux-gnu on a x86_64 system, %host-type will be
"x86_64-..." and we will try to build v86d for aarch64.

We could maybe do something like that:

--8<---------------cut here---------------start------------->8---
(define (operating-system-hardware-specific-services)
  #~(let-system (system target)
                (cond
                 ((target-arm? system target)
                  '())
                 ((target-intel? system target)
                  (list uvesafb-shepherd-service)))))

(define (operating-system-kernel-specific-services)
  #~(let-system (system target)
                (cond
                 ((target-linux? system target)
                  linux-specific-services)
                 ((target-hurd? system target)
                  hurd-specific-services))))
--8<---------------cut here---------------end--------------->8---

This way, uvesafb-shepherd-service would be built and installed only
when producing a system targeting an Intel CPU. We could also extend
this mechanism to have kernel specific services.

That would mean, we need to dig out Ludo patch introducing
let-system[1], but I think it was almost ready.

Adding janneke, Danny and Ludo to the discussion.

WDYT?

Thanks,

Mathieu

[1]: https://lists.gnu.org/archive/html/guix-patches/2017-11/msg00274.html




Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Wed, 13 May 2020 12:52:01 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: ludo <at> gnu.org, 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Wed, 13 May 2020 14:50:58 +0200
[Message part 1 (text/plain, inline)]
Hello,

> We could maybe do something like that:
>
> (define (operating-system-hardware-specific-services)
>   #~(let-system (system target)
>                 (cond
>                  ((target-arm? system target)
>                   '())
>                  ((target-intel? system target)
>                   (list uvesafb-shepherd-service)))))
>
> (define (operating-system-kernel-specific-services)
>   #~(let-system (system target)
>                 (cond
>                  ((target-linux? system target)
>                   linux-specific-services)
>                  ((target-hurd? system target)
>                   hurd-specific-services))))
>
> This way, uvesafb-shepherd-service would be built and installed only
> when producing a system targeting an Intel CPU. We could also extend
> this mechanism to have kernel specific services.
>
> That would mean, we need to dig out Ludo patch introducing
> let-system[1], but I think it was almost ready.

Here's a rebased version of Ludo's patch. I'm not sure about the merge
resolution in "lower-object", but otherwise it works fine!

Ludo, would it be of to push it?

Thanks,

Mathieu
[0001-gexp-Compilers-can-now-return-lowerable-objects.patch (text/x-diff, inline)]
From dde0a1ca499a4ef0592d10158a00add16386bebb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
Date: Wed, 13 May 2020 14:34:17 +0200
Subject: [PATCH 1/2] gexp: Compilers can now return lowerable objects.

* guix/gexp.scm (lower-object): Iterate if LOWERED is a struct.
(lower+expand-object): New procedure.
(gexp->sexp): Use it.
(define-gexp-compiler): Adjust docstring.
---
 guix/gexp.scm | 71 ++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 48 insertions(+), 23 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index 2a4b36519c..a9a4b89ab4 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -226,32 +226,59 @@ procedure to expand it; otherwise return #f."
 corresponding to OBJ for SYSTEM, cross-compiling for TARGET if TARGET is true.
 OBJ must be an object that has an associated gexp compiler, such as a
 <package>."
-  (match (lookup-compiler obj)
-    (#f
-     (raise (condition (&gexp-input-error (input obj)))))
-    (lower
-     ;; Cache in STORE the result of lowering OBJ.
-     (mlet %store-monad ((target (if (eq? target 'current)
-                                     (current-target-system)
-                                     (return target)))
-                         (graft? (grafting?)))
-       (mcached (let ((lower (lookup-compiler obj)))
-                  (lower obj system target))
-                obj
-                system target graft?)))))
+  (let loop ((obj obj))
+    (match (lookup-compiler obj)
+      (#f
+       (raise (condition (&gexp-input-error (input obj)))))
+      (lower
+       ;; Cache in STORE the result of lowering OBJ.
+       (mlet* %store-monad
+           ((target (if (eq? target 'current)
+                        (current-target-system)
+                        (return target)))
+            (graft? (grafting?))
+            (lowered (mcached (let ((lower (lookup-compiler obj)))
+                                (lower obj system target))
+                              obj
+                              system target graft?)))
+         (if (and (struct? lowered) (not (eq? lowered obj)))
+             (loop lowered)
+             (return lowered)))))))
+
+(define* (lower+expand-object obj
+                              #:optional (system (%current-system))
+                              #:key target (output "out"))
+  "Return as a value in %STORE-MONAD the output of object OBJ expands to for
+SYSTEM and TARGET.  Object such as <package>, <file-append>, or <plain-file>
+expand to file names, but it's possible to expand to a plain data type."
+  (let loop ((obj obj)
+             (expand (and (struct? obj) (lookup-expander obj))))
+    (match (lookup-compiler obj)
+      (#f
+       (raise (condition (&gexp-input-error (input obj)))))
+      (lower
+       (mlet %store-monad ((lowered (lower obj system target)))
+         ;; LOWER might return something that needs to be further lowered.
+         (if (struct? lowered)
+             ;; If we lack an expander, delegate to that of LOWERED.
+             (if (not expand)
+                 (loop lowered (lookup-expander lowered))
+                 (return (expand obj lowered output)))
+             (return lowered)))))))               ;lists, vectors, etc.
 
 (define-syntax define-gexp-compiler
   (syntax-rules (=> compiler expander)
     "Define NAME as a compiler for objects matching PREDICATE encountered in
 gexps.
 
-In the simplest form of the macro, BODY must return a derivation for PARAM, an
-object that matches PREDICATE, for SYSTEM and TARGET (the latter of which is
-#f except when cross-compiling.)
+In the simplest form of the macro, BODY must return (1) a derivation for
+a record of the specified type, for SYSTEM and TARGET (the latter of which is
+#f except when cross-compiling), (2) another record that can itself be
+compiled down to a derivation, or (3) an object of a primitive data type.
 
 The more elaborate form allows you to specify an expander:
 
-  (define-gexp-compiler something something?
+  (define-gexp-compiler something-compiler <something>
     compiler => (lambda (param system target) ...)
     expander => (lambda (param drv output) ...))
 
@@ -1148,12 +1175,10 @@ and in the current monad setting (system type, etc.)"
                   (or n? native?)))
                refs))
         (($ <gexp-input> (? struct? thing) output n?)
-         (let ((target (if (or n? native?) #f target))
-               (expand (lookup-expander thing)))
-           (mlet %store-monad ((obj (lower-object thing system
-                                                  #:target target)))
-             ;; OBJ must be either a derivation or a store file name.
-             (return (expand thing obj output)))))
+         (let ((target (if (or n? native?) #f target)))
+           (lower+expand-object thing system
+                                #:target target
+                                #:output output)))
         (($ <gexp-input> (? self-quoting? x))
          (return x))
         (($ <gexp-input> x)
-- 
2.26.2

[0002-gexp-Add-let-system.patch (text/x-diff, inline)]
From 8fe7504a0935de7f0c8cba1236f3114d4e368093 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
Date: Wed, 13 May 2020 14:35:20 +0200
Subject: [PATCH 2/2] gexp: Add 'let-system'.

* guix/gexp.scm (<system-binding>): New record type.
(let-system): New macro.
(system-binding-compiler): New procedure.
(default-expander): Add catch-all case.
* tests/gexp.scm ("let-system", "let-system, target")
("let-system, ungexp-native, target")
("let-system, nested"): New tests.
* doc/guix.texi (G-Expressions): Document it.
---
 doc/guix.texi  | 26 +++++++++++++++++++++++++
 guix/gexp.scm  | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/gexp.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index d6fbd85fde..0281a4be45 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7811,6 +7811,32 @@ are also added to the load path of the gexp returned by
 Return @code{#t} if @var{obj} is a G-expression.
 @end deffn
 
+@deffn {Scheme Syntax} let-system @var{system}
+@deffnx {Scheme Syntax} let-system (@var{system} @var{target})
+Bind @var{system} to the currently targeted system---e.g.,
+@code{"x86_64-linux"}---within @var{body}.
+
+In the second case, additionally bind @var{target} to the current
+cross-compilation target---a GNU triplet such as
+@code{"arm-linux-gnueabihf"}---or @code{#f} if we are not
+cross-compiling.
+
+@code{let-system} is useful in the occasional case where the object
+spliced into the gexp depends on the target system, as in this example:
+
+@example
+#~(system*
+   #+(let-system system
+       (cond ((string-prefix? "armhf-" system)
+              (file-append qemu "/bin/qemu-system-arm"))
+             ((string-prefix? "x86_64-" system)
+              (file-append qemu "/bin/qemu-system-x86_64"))
+             (else
+              (error "dunno!"))))
+   "-net" "user" #$image)
+@end example
+@end deffn
+
 G-expressions are meant to be written to disk, either as code building
 some derivation, or as plain files in the store.  The monadic procedures
 below allow you to do that (@pxref{The Store Monad}, for more
diff --git a/guix/gexp.scm b/guix/gexp.scm
index a9a4b89ab4..a70b723e57 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -112,6 +112,7 @@
             gexp-compiler?
             file-like?
             lower-object
+            let-system
 
             lower-inputs
 
@@ -195,7 +196,9 @@ returns its output file name of OBJ's OUTPUT."
     ((? derivation? drv)
      (derivation->output-path drv output))
     ((? string? file)
-     file)))
+     file)
+    (obj                                           ;lists, vectors, etc.
+     obj)))
 
 (define (register-compiler! compiler)
   "Register COMPILER as a gexp compiler."
@@ -324,6 +327,52 @@ The expander specifies how an object is converted to its sexp representation."
                     (derivation-file-name lowered)
                     lowered)))
 
+
+;;;
+;;; System dependencies.
+;;;
+
+;; Binding form for the current system and cross-compilation target.
+(define-record-type <system-binding>
+  (system-binding proc)
+  system-binding?
+  (proc system-binding-proc))
+
+(define-syntax let-system
+  (syntax-rules ()
+    "Introduce a system binding in a gexp.  The simplest form is:
+
+  (let-system system
+    (cond ((string=? system \"x86_64-linux\") ...)
+          (else ...)))
+
+which binds SYSTEM to the currently targeted system.  The second form is
+similar, but it also shows the cross-compilation target:
+
+  (let-system (system target)
+    ...)
+
+Here TARGET is bound to the cross-compilation triplet or #f."
+    ((_ (system target) exp0 exp ...)
+     (system-binding (lambda (system target)
+                       exp0 exp ...)))
+    ((_ system exp0 exp ...)
+     (system-binding (lambda (system target)
+                       exp0 exp ...)))))
+
+(define-gexp-compiler system-binding-compiler <system-binding>
+  compiler => (lambda (binding system target)
+                (match binding
+                  (($ <system-binding> proc)
+                   (with-monad %store-monad
+                     ;; PROC is expected to return a lowerable object.
+                     ;; 'lower-object' takes care of residualizing it to a
+                     ;; derivation or similar.
+                     (return (proc system target))))))
+
+  ;; Delegate to the expander of the object returned by PROC.
+  expander => #f)
+
 
 ;;;
 ;;; File declarations.
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 6a42d3eb57..c1d65b2c4e 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -322,6 +322,56 @@
                  (string-append (derivation->output-path drv)
                                 "/bin/touch"))))))
 
+(test-equal "let-system"
+  (list `(begin ,(%current-system) #t) '(system-binding) '())
+  (let ((exp  #~(begin
+                  #$(let-system system system)
+                  #t)))
+    (list (gexp->sexp* exp)
+          (match (gexp-inputs exp)
+            (((($ (@@ (guix gexp) <system-binding>)) "out"))
+             '(system-binding))
+            (x x))
+          (gexp-native-inputs exp))))
+
+(test-equal "let-system, target"
+  (list `(list ,(%current-system) #f)
+        `(list ,(%current-system) "aarch64-linux-gnu"))
+  (let ((exp #~(list #$@(let-system (system target)
+                                    (list system target)))))
+    (list (gexp->sexp* exp)
+          (gexp->sexp* exp "aarch64-linux-gnu"))))
+
+(test-equal "let-system, ungexp-native, target"
+  `(here it is: ,(%current-system) #f)
+  (let ((exp #~(here it is: #+@(let-system (system target)
+                                           (list system target)))))
+    (gexp->sexp* exp "aarch64-linux-gnu")))
+
+(test-equal "let-system, nested"
+  (list `(system* ,(string-append "qemu-system-" (%current-system))
+                  "-m" "256")
+        '()
+        '(system-binding))
+  (let ((exp #~(system*
+                #+(let-system (system target)
+                              (file-append (@@ (gnu packages virtualization)
+                                               qemu)
+                                           "/bin/qemu-system-"
+                                           system))
+                "-m" "256")))
+    (list (match (gexp->sexp* exp)
+            (('system* command rest ...)
+             `(system* ,(and (string-prefix? (%store-prefix) command)
+                             (basename command))
+                       ,@rest))
+            (x x))
+          (gexp-inputs exp)
+          (match (gexp-native-inputs exp)
+            (((($ (@@ (guix gexp) <system-binding>)) "out"))
+             '(system-binding))
+            (x x)))))
+
 (test-assert "ungexp + ungexp-native"
   (let* ((exp    (gexp (list (ungexp-native %bootstrap-guile)
                              (ungexp coreutils)
-- 
2.26.2


Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 14 May 2020 08:17:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>,
 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Thu, 14 May 2020 10:16:30 +0200
Hi,

Mathieu Othacehe <othacehe <at> gnu.org> skribis:

> Here's a rebased version of Ludo's patch. I'm not sure about the merge
> resolution in "lower-object", but otherwise it works fine!
>
> Ludo, would it be of to push it?

I’d like to think a bit more about it.  In particular, ‘let-system’ is
not great because we’d also want to know the target in many cases.

Sorry for the delay, I need to swap that in!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Fri, 15 May 2020 22:44:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 29296-done <at> debbugs.gnu.org, janneke <at> gnu.org,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>,
 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Sat, 16 May 2020 00:43:34 +0200
Hi Mathieu,

Mathieu Othacehe <othacehe <at> gnu.org> skribis:

> Here's a rebased version of Ludo's patch. I'm not sure about the merge
> resolution in "lower-object", but otherwise it works fine!

I took another look, and you’re right, it does the job.  There were a
couple of issues: returning a self-quoting value as in

  (let-system s s)

wouldn’t work, and also caching wasn’t quite right (could be seen by
comparing GUIX_PROFILING="add-data-to-store-cache object-cache" before
and after).

Anyway, it took me much more time than I thought, but it’s here now:

  502f609d05 vm: Use 'let-system'.
  300a54bb98 utils: 'target-arm32?' & co. take an optional parameter.
  644cb40cd8 gexp: Add 'let-system'.
  d03001a31a gexp: Compilers can now return lowerable objects.

Let me know how it goes!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Mon, 18 May 2020 12:18:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 29296-done <at> debbugs.gnu.org, 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Mon, 18 May 2020 14:16:36 +0200
Hey Ludo,

> Anyway, it took me much more time than I thought, but it’s here now:
>
>   502f609d05 vm: Use 'let-system'.
>   300a54bb98 utils: 'target-arm32?' & co. take an optional parameter.
>   644cb40cd8 gexp: Add 'let-system'.
>   d03001a31a gexp: Compilers can now return lowerable objects.
>
> Let me know how it goes!

Thanks a lot, it's a great addition. I plan to use it soon to have
kernel/architecture specific services, as I proposed earlier in this
thread.

Mathieu




Merged 41120 48393. Request was from Leo Famulari <leo <at> famulari.name> to control <at> debbugs.gnu.org. (Fri, 20 Aug 2021 18:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Wed, 29 Dec 2021 02:31:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Tue, 28 Dec 2021 21:30:27 -0500
On Thu, May 07, 2020 at 08:40:15AM +0300, Efraim Flashner wrote:
> the uvesafb-service which was added to the installation image isn't
> supported on aarch64 (or probably any non-x86 system) and causes the
> creation of an installation image to fail.

This is still an issue, right?




Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Wed, 29 Dec 2021 08:22:01 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Leo Famulari <leo <at> famulari.name>
Cc: 41120 <at> debbugs.gnu.org
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Wed, 29 Dec 2021 10:20:52 +0200
[Message part 1 (text/plain, inline)]
On Tue, Dec 28, 2021 at 09:30:27PM -0500, Leo Famulari wrote:
> On Thu, May 07, 2020 at 08:40:15AM +0300, Efraim Flashner wrote:
> > the uvesafb-service which was added to the installation image isn't
> > supported on aarch64 (or probably any non-x86 system) and causes the
> > creation of an installation image to fail.
> 
> This is still an issue, right?

I believe so. Borrowing from the manual I tried the following command
and it showed that it was going to build v86d.

guix system image --system=armhf-linux -e '((@ (gnu system install) os-with-u-boot) (@ (gnu system install) installation-os) "A20-OLinuXino-Lime2")' -n

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Wed, 29 Dec 2021 22:10:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 41120 <at> debbugs.gnu.org, bug-guix <at> gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Wed, 29 Dec 2021 23:03:25 +0100
[Message part 1 (text/plain, inline)]
I wrote the attached quick fix, then noticed that this bug is 
paired with #29296 which seems to propose a whole 'nother 
mechanism?

I'm not sure I grok the latter's advantage yet.

Kind regards,

T G-R

[0001-install-Add-uvesafb-service-only-on-x86.patch (text/x-patch, inline)]
From 29d6ce59a0f3953de627d110adaa7978051ca077 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me <at> tobias.gr>
Date: Wed, 29 Dec 2021 23:01:11 +0100
Subject: [PATCH] install: Add uvesafb service only on x86.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/system/install.scm (%installation-services): Turn into…
(installation-services): …this procedure.  Adjust sole user.
Add the uvesafb-service-type only when targetting x86.
---
 gnu/system/install.scm | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 073d7df1db..36c24992bd 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2015 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2016 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2017 Marius Bakke <mbakke <at> fastmail.com>
-;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian <at> pelzflorian.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim <at> flashner.co.il>
 ;;;
@@ -33,6 +33,7 @@ (define-module (gnu system install)
   #:use-module (guix modules)
   #:use-module ((guix packages) #:select (package-version))
   #: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)
@@ -303,7 +304,7 @@ (define uvesafb-service-type
     "Load the @code{uvesafb} kernel module with the right options.")
    (default-value #t)))
 
-(define %installation-services
+(define (installation-services)
   ;; List of services of the installation system.
   (let ((motd (plain-file "motd" "
 \x1b[1;37mWelcome to the installation of GNU Guix!\x1b[0m
@@ -320,7 +321,9 @@ (define (normal-tty tty)
     (define bare-bones-os
       (load "examples/bare-bones.tmpl"))
 
-    (list (service virtual-terminal-service-type)
+    (append
+        (list
+          (service virtual-terminal-service-type)
 
           (service kmscon-service-type
                    (kmscon-configuration
@@ -426,13 +429,15 @@ (define bare-bones-os
                           glibc-utf8-locales
                           texinfo
                           guile-3.0)
-                    %default-locale-libcs))
+                    %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))))
+        (if (or (target-x86-32?) (target-x86-64?))
+            ;; x86 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.
+            (list (service uvesafb-service-type))
+            '()))))
 
 (define %issue
   ;; Greeting.
@@ -496,7 +501,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.34.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Wed, 29 Dec 2021 22:10:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#41120; Package guix. (Thu, 04 Aug 2022 23:04:01 GMT) Full text and rfc822 format available.

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

From: Pavel Shlyak <p.shlyak <at> pantherx.org>
To: 41120 <at> debbugs.gnu.org
Subject: uvesafb service is unsupported on aarch64
Date: Fri, 5 Aug 2022 02:03:37 +0300
This one is done with https://issues.guix.gnu.org/55806. I suggest closing it as resolved.



Reply sent to "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>:
You have taken responsibility. (Fri, 05 Aug 2022 13:00:02 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Fri, 05 Aug 2022 13:00:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: 41120-done <at> debbugs.gnu.org
Cc: Pavel Shlyak <p.shlyak <at> pantherx.org>
Subject: Re: bug#41120: uvesafb service is unsupported on aarch64
Date: Fri, 05 Aug 2022 14:59:07 +0200
Pavel Shlyak <p.shlyak <at> pantherx.org> writes:
> This one is done with https://issues.guix.gnu.org/55806. I suggest closing it as resolved.

Indeed.  With 55806, the uvesafb is added if (supported-package? v86d
system), avoiding the need to check the system.  I’m Closing by sending
a mail to 41120-done <at> debbugs.gnu.org.

Regards,
Florian




Reply sent to "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>:
You have taken responsibility. (Fri, 05 Aug 2022 13:00:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Fri, 05 Aug 2022 13:00:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 1 year and 207 days ago.

Previous Next


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