From 4bcedf553998e4c413b572395679d2d881fb7318 Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 13 Apr 2022 21:19:36 +0200 Subject: [PATCH v3 7/8] gnu: raspberry-pi: New function to make a package with device-tree files. * gnu/packages/raspberry-pi.scm (make-raspi-bcm28-dtbs): New function to make a package with device-tree files for Raspberry Pi models from the kernel given as argument. diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 0707516f72..d808f61ac2 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -30,6 +30,7 @@ (define-module (gnu packages raspberry-pi) #:use-module (gnu packages file) #:use-module (gnu packages gcc) #:use-module (gnu packages linux) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix download) #:use-module (guix git-download) @@ -291,6 +292,26 @@ (define-public (raspi-custom-txt content) character. Alternatively CONTENT can be a string with the full file content." (raspi-config-file "custom.txt" content)) +(define-public (make-raspi-bcm28-dtbs linux) + "Make a package with the device-tree files for Raspberry Pi models from the +kernel LINUX." + (package + (inherit linux) + (name "raspi-bcm28-dtbs") + (source #f) + (build-system copy-build-system) + (arguments + `(#:phases (modify-phases %standard-phases (delete 'unpack)) + #:install-plan + (list (list (string-append (assoc-ref %build-inputs "linux") + "/lib/dtbs/broadcom/") + "." #:include-regexp '("/bcm....-rpi.*\\.dtb"))))) + (inputs `(("linux" ,linux))) + (synopsis "Device-tree files for a Raspberry Pi") + (description + (simple-format #f "The device-tree files for Raspberry Pi models from ~a." + (package-name linux))))) + (define (make-raspi-defconfig arch defconfig sha256-as-base32) "Make for the architecture ARCH a file-like object from the DEFCONFIG file with the hash SHA256-AS-BASE32. This object can be used as the #:defconfig -- 2.35.1