From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WJzHOQPXqV9RLgAA0tVLHw (envelope-from ) for ; Mon, 09 Nov 2020 23:55:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GIuzNQPXqV/sFwAA1q6Kng (envelope-from ) for ; Mon, 09 Nov 2020 23:55:47 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6C4779405D2 for ; Mon, 9 Nov 2020 23:55:47 +0000 (UTC) Received: from localhost ([::1]:50560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcH0j-0000Qe-Gt for larch@yhetil.org; Mon, 09 Nov 2020 18:55:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcH02-0000QU-As for guix-patches@gnu.org; Mon, 09 Nov 2020 18:55:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcH02-00077V-0L for guix-patches@gnu.org; Mon, 09 Nov 2020 18:55:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcH01-0005p9-Vm for guix-patches@gnu.org; Mon, 09 Nov 2020 18:55:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44543] [PATCH] gnu: raspberry-pi: Add helpers for config.txt file generation. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Nov 2020 23:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44543 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44543@debbugs.gnu.org Cc: Danny Milosavljevic X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160496604822306 (code B ref -1); Mon, 09 Nov 2020 23:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Nov 2020 23:54:08 +0000 Received: from localhost ([127.0.0.1]:35915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcGzA-0005ni-Ik for submit@debbugs.gnu.org; Mon, 09 Nov 2020 18:54:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:38840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcGz9-0005nb-A8 for submit@debbugs.gnu.org; Mon, 09 Nov 2020 18:54:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcGz9-00008r-26 for guix-patches@gnu.org; Mon, 09 Nov 2020 18:54:07 -0500 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:19881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcGz6-0006zT-8r for guix-patches@gnu.org; Mon, 09 Nov 2020 18:54:06 -0500 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 2446759D954; Mon, 9 Nov 2020 23:53:58 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [88.70.113.160]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id C2E97539A1C; Mon, 9 Nov 2020 23:53:53 +0000 (UTC) From: Stefan Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Nov 2020 00:53:52 +0100 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT Received-SPF: pass client-ip=153.92.174.89; envelope-from=stefan-guix@vodafonemail.de; helo=vsmx011.vodafonemail.xion.oxcs.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/09 18:53:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: b5PWSwG4VhGb * gnu/packages/raspberry-pi.scm (raspi-config-file, raspi-custom.txt): New functions. (raspi-config.txt, raspi-u-boot-bootloader.txt, raspi-kernel.txt): New variables. --- gnu/packages/raspberry-pi.scm | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/raspberry-pi.scm = b/gnu/packages/raspberry-pi.scm index 7700c26d06..af3998c4d6 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -235,3 +235,47 @@ Raspberry Pi. Note: It does not work on Raspberry = Pi 1.") (install-file "arm64.bin" libexec) #t)))))))) (supported-systems '("aarch64-linux")))) + +(define-public (raspi-config-file name content) + "Creates a configuration file like config.txt for the Raspberry Pi = firmware. +CONTENT can be a list of strings, which are concatenated with a newline +character. Alternatively CONTENT can be a string with the full file = content." + (plain-file + name + (if (list? content) + (string-join content "\n" 'suffix) + content))) + +(define-public raspi-config.txt + ;; Creates a config.txt to start the ARM cores up in 64-bit mode if = necessary + ;; and to include bootloader.txt, kernel.txt, and a custom.txt, each = with + ;; separate configurations for the Raspberry Pi firmware. + (raspi-config-file + "config.txt" + `("# See = https://www.raspberrypi.org/documentation/configuration/config-txt/README.= md for details." + "" + ,(string-append "arm_64bit=3D" (if (target-aarch64?) "1" "0")) + "include bootloader.txt" + "include kernel.txt" + "include custom.txt"))) + +(define-public raspi-u-boot-bootloader.txt + ;; Creates a bootloader.txt file to be included by the config.txt to = load the + ;; U-Boot bootloader. + (raspi-config-file + "bootloader.txt" + "kernel=3Du-boot.bin")) + +(define-public raspi-kernel.txt + ;; Creates a kernel.txt to be included by the config.txt to ensure = that + ;; upstream kernel and device tree files can be used. + (raspi-config-file + "kernel.txt" + '("dtoverlay=3Dupstream" + "upstream_kernel=3D1"))) + +(define-public (raspi-custom.txt content) + "Creates a custom.txt to be included by the config.txt. CONTENT can = be a list +of strings, which are concatenated with a newline character. = Alternatively +CONTENT can be a string with the full file content." + (raspi-config-file "custom.txt" content)) --=20 2.26.0