Subject: Re: bug#41120: uvesafb service is unsupported on aarch64

From: Mathieu Othacehe <[email-masked]>
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