Files
guix-router/packages/u-boot-rpi-arm64-guix-router.scm
ssmithxandClaude Opus 5.5 f4ed3b8e9d Boot Guix on real Pi 4 hardware with a declarative image
Replace the GRUB/efi-raw + prepare-rpi-image.sh post-processing approach
with a declarative SD image:

- rpi4-image.scm: MBR image with FAT "RPI-BOOT" (start4.elf, u-boot.bin,
  config.txt, overlays, DTB) and ext4 "Guix" root.
- rpi4.scm: u-boot-bootloader variant with no raw-disk installer, so
  reconfigure only rewrites extlinux.conf; serial console on ttyS1;
  linux-rpi4 kernel; root account with uid 0.
- packages/rpi4-linux.scm: nonguix linux + CLK_BCM2835, SD (sdhci-iproc),
  GENET built in.
- packages/u-boot-rpi-arm64-guix-router.scm + rpi-env-layout.patch:
  move load addresses so a 36 MB distro kernel doesn't overlap FDT/initrd.
- run-qemu-rpi4.sh: direct-kernel QEMU raspi4b smoke test.
- Docs: PITFALLS #16-21, README boot flow; Phase 1 confirmed on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 11:44:08 -04:00

24 lines
899 B
Scheme

;;; Raspberry Pi 4 U-Boot with a memory layout that fits a Guix kernel.
;;;
;;; Upstream rpi.env reserves only ~36 MB for the kernel at 0x80000 and puts
;;; the FDT at 0x02600000 and the initrd at 0x02700000. booti relocates our
;;; Image (image_size ~36.4 MB) to 0x200000, so it would overwrite both. See
;;; patches/rpi-env-layout.patch for the new layout.
(define-module (u-boot-rpi-arm64-guix-router)
#:use-module (gnu packages bootloaders)
#:use-module (guix packages)
#:use-module (guix gexp))
(define-public u-boot-rpi-arm64-guix-router
(package
(inherit u-boot-rpi-arm64)
(name "u-boot-rpi-arm64-guix-router")
(source
(origin
(inherit (package-source u-boot-rpi-arm64))
(patches
(append (origin-patches (package-source u-boot-rpi-arm64))
(list (local-file "patches/rpi-env-layout.patch"))))))))
u-boot-rpi-arm64-guix-router