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

From: Danny Milosavljevic <[email-masked]>
Date: Mon, 16 Nov 2020 15:01:08 +0100

Hi Stefan,

thanks!

On Mon, 16 Nov 2020 11:38:19 +0100
Stefan <[email-masked]> wrote:

> The firmware blob using these files can’t be handled by Guix, this will have to be left as an exercise. But could I add a skeleton for it? Maybe something like this (but better using the copy-build-system): 

There is a free software Raspberry VC firmware on
https://github.com/librerpi/rpi-open-firmware/ (currently cannot handle graphics
and USB and lots of other important things--but it DOES boot) and development
is ongoing.

We can just package that free software firmware and use it.

I've already started packaging it for Guix.

> (operating-system
>   (bootloader 
>     (bootloader-configuration
>       (bootloader (bootloader-chain
>                    (list (file-append raspi-firmware "/boot/")
>                          (file-append u-boot-rpi-3 "/libexec/u-boot.bin")
>                          raspi-config.txt
>                          raspi-u-boot-bootloader.txt
>                          ;; Additional configurations to use.
>                          (raspi-custom.txt '("disable_overscan=1"
>                                              "hdmi_force_hotplug=1"
>                                              "audio=on"
>                                              "dtoverlay=gpio-ir"
>                                              "dtoverlay=disable-wifi"
>                                              "dtoverlay=vc4-fkms-v3d,cma-64")))
>                    grub-efi-netboot-bootloader 
>                    #:installer (install-grub-efi-netboot "efi/boot")
>                    #:copy-files? #t))

I advice to add a user-level function for a free software Raspberry Pi 3 efi
netboot bootloader to Guix (and a non-efi-netboot one, too, maybe).

Something like

(define (raspi-3-efi-netboot-bootloader efi-boot custom-text)
  (bootloader-chain like you do above custom-text))

I don't think that it's reasonable to expect the user to use bootloader-chain
by himself (it's not user-friendly to have to do that).

> The above bootloader-chain could certainly be added to Guix, but leaving out the raspi-firmware and the raspi-custom.txt – maybe as a function to allow adding an own raspi-custom.txt. If someone copies the firmware by hand onto an SD card, then such a bootloader provided as e.g. raspi-grub-bootloader would work.

Yeah.