Subject: [bug#44543] [PATCH] gnu: raspberry-pi: Add helpers for config.txt file generation.

From: Stefan <[email-masked]>
Date: Sat, 27 Mar 2021 23:03:15 +0100

Hi Léo!

> I would prefer if you opened one single bug with all the changes so I
> can test the whole thing, right now I don't feel at ease reviewing
> things like this.

I see. I’m doing little steps, sending patches for the parts which I think are ready.

> How can I be sure what you are submitting is the
> right abstraction for your future work?

True. In this case you only have the bootloader examples that I gave.

This patch is just a building block to generate some config.txt in a modular and comfortable way. There is a bootloader installer copying any listed file-like-object.

Who knows, in future there might be a TianoCore bootloader, then a similar patch might be required to provide a raspi-tianocore-bootloader-txt.

> Are you sure that abstraction
> will be right for your future patches?

Yes. There are basically three decisions to take for a Guix System: 32 or 64 bit, which device tree (depends on the linux kernel), which bootloader. Beyond this anything is a custom setting. 

> If anything needs to be changed
> I feel like one big patchset about Raspberry Pi 3B+ support will be
> easier to review (at least for me).

I see, this is not yet testable for you out of the box to boot a system.

What is testable right now is an incomplete bootloader. At least it is possible to inspect what files will be generated by this patch and copied into /boot. It must even be buildable for x86_64.

 (bootloader
   (bootloader-configuration
     (target "/boot")
     (bootloader
       (efi-bootloader-chain
         (list raspi-config-txt
               raspi-bcm27-dtb-txt
               raspi-u-boot-bootloader-txt)
         grub-efi-netboot-bootloader
         #:installer
          (chain-efi-bootloader-installer (install-grub-efi-netboot "efi/boot")))))

Bye

Stefan

P.S. If you change your mind and want to test that bootloader, then you should know that GRUB depends on qemu and unfortunately qemu is failing its test on aarch64 since some months. Then this patch may help you get going. 

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 2262aa6197..3732320df8 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -161,8 +161,9 @@
       (arguments
       `(;; FIXME: Disable tests on i686 to work around
         ;; <https://bugs.gnu.org/40527>.
-       #:tests? ,(or (%current-target-system)
-                     (not (string=? "i686-linux" (%current-system))))
+       #:tests? ,(and (not (target-aarch64?))
+                      (or (%current-target-system)
+                          (not (string=? "i686-linux" (%current-system)))))
  
         #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
                                 "--enable-docs"