Subject: [bug#48314] Patches to install guix system on Raspberry Pi

From: Vagrant Cascadian <[email-masked]>
Date: Sat, 13 Nov 2021 10:51:38 -0800

On 2021-11-13, Vagrant Cascadian wrote:
> Subject: [PATCH 3/8] * gnu/packages/bootloader.scm (make-u-boot-package): Add
>  keyword parameters 'name' and 'description'.
> ...
>  (u-boot-rpi-0-w, u-boot-rpi, u-boot-rpi-2, u-boot-rpi-3,
>  u-boot-rpi-4, u-boot-rpi-64, u-boot-rpi-0-w-efi, u-boot-rpi-efi,
>  u-boot-rpi-2-efi, u-boot-rpi-3-efi, u-boot-rpi-4-efi, u-boot-rpi-efi-64): New
>  packages.
...
> +(define-public u-boot-rpi-64
> +  (make-preinstalled-u-boot-package
> +   "rpi_arm64"
> +   "aarch64-linux-gnu"
> +   #:name "rpi-64"
> +   #:description %u-boot-rpi-description-64-bit))
>
> And this "u-boot-rpi-arm64".
>
> In other words, keep names consistent with the upstream defconfig they
> are based on.
...
> I think without addressing the rest of the patch series, adding to guix
> master the following packages could make the remaining diff smaller:
>
>   u-boot-rpi-2 (rpi_2_defconfig)
>   u-boot-rpi-3-32b (rpi_3_32b_defconfig)
>   u-boot-rpi-4-32b (rpi_4_32b_defconfig)
>   u-boot-rpi-arm64 (rpi_arm64_defconfig)

Patch that builds, but haven't tested on an actual board (do have rpi2
and rpi3b+ could test sometime):

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 706ddf0207..f5a3fd51e0 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -994,6 +994,18 @@ (define-public u-boot-pinebook-pro-rk3399
        `(("firmware" ,arm-trusted-firmware-rk3399)
          ,@(package-native-inputs base))))))

+(define-public u-boot-rpi-2
+  (make-u-boot-package "rpi_2" "arm-linux-gnueabihf"))
+
+(define-public u-boot-rpi-3-32b
+  (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf"))
+
+(define-public u-boot-rpi-4-32b
+  (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf"))
+
+(define-public u-boot-rpi-arm64
+  (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu"))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")

Which leads me to wonder, why have the name and description argument at
all, when you could just inherit and set the name, like done with the
boneblack?

(define-public u-boot-am335x-boneblack
  (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf")))
    (package
      (inherit base)
      (name "u-boot-am335x-boneblack")
      (description "U-Boot is a bootloader used mostly for ARM
boards. It also initializes the boards (RAM etc).
...

And of course, thanks for working on this! :)

live well,
  vagrant