(define-module (rpi-boot-firmware) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix build-system trivial) #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (nonguix licenses)) (define %firmware-files '("start4.elf" "start4cd.elf" "start4db.elf" "start4x.elf" "fixup4.dat" "fixup4cd.dat" "fixup4db.dat" "fixup4x.dat")) (define %overlay-files '("overlays/upstream.dtbo" "overlays/upstream-pi4.dtbo")) (define %firmware-commit "04edf7a2c7880a792496ca209cbafb51d30e66eb") (define-public rpi-boot-firmware (package (name "rpi-boot-firmware") (version "04edf7a") (source (origin (method url-fetch) (uri (string-append "https://github.com/raspberrypi/rpi-firmware/archive/" %firmware-commit ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "0hj25mwhqq5wzdg0qxprw8pi9150nzpjkdndfnv1w150cf7kjmma")))) (build-system trivial-build-system) (native-inputs (list tar xz gzip)) (arguments (list #:modules '((guix build utils)) #:builder #~(begin (use-modules (guix build utils)) (let ((source #+(package-source this-package))) (set-path-environment-variable "PATH" '("bin") (list #+tar #+xz #+gzip)) (invoke "tar" "xzf" source) (with-directory-excursion (string-append "rpi-firmware-" #$%firmware-commit) (for-each (lambda (f) (install-file f #$output)) '#$%firmware-files) (for-each (lambda (f) (install-file f (string-append #$output "/overlays"))) '#$%overlay-files)))))) (home-page "https://github.com/raspberrypi/rpi-firmware") (synopsis "Non-free first-stage boot firmware for Raspberry Pi") (description "The proprietary VideoCore boot firmware (@code{start4.elf} and its @code{fixup4*} companions) that the Raspberry Pi 4's boot EEPROM loads from the FAT boot partition before handing off to U-Boot or the kernel.") (license (nonfree "https://github.com/raspberrypi/rpi-firmware/blob/master/LICENCE.txt")))) rpi-boot-firmware