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 yAHxMPFWsl+CZAAA0tVLHw (envelope-from ) for ; Mon, 16 Nov 2020 10:39:45 +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 oCLULPFWsl/uYAAA1q6Kng (envelope-from ) for ; Mon, 16 Nov 2020 10:39:45 +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 370409401CD for ; Mon, 16 Nov 2020 10:39:45 +0000 (UTC) Received: from localhost ([::1]:33960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kebvE-0005Uc-0t for larch@yhetil.org; Mon, 16 Nov 2020 05:39:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kebuY-0005Sg-2T for guix-patches@gnu.org; Mon, 16 Nov 2020 05:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kebuX-0007ZJ-OJ for guix-patches@gnu.org; Mon, 16 Nov 2020 05:39:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kebuX-0003QB-Ka for guix-patches@gnu.org; Mon, 16 Nov 2020 05:39: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, 16 Nov 2020 10:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44543 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 44543@debbugs.gnu.org X-Debbugs-Original-Cc: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160552312013117 (code B ref -1); Mon, 16 Nov 2020 10:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Nov 2020 10:38:40 +0000 Received: from localhost ([127.0.0.1]:55169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kebuC-0003PV-CP for submit@debbugs.gnu.org; Mon, 16 Nov 2020 05:38:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:49574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kebu7-0003PL-FG for submit@debbugs.gnu.org; Mon, 16 Nov 2020 05:38:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kebu7-0004su-6h for guix-patches@gnu.org; Mon, 16 Nov 2020 05:38:35 -0500 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:32514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kebu3-0007Me-Uf for guix-patches@gnu.org; Mon, 16 Nov 2020 05:38:34 -0500 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 16373602D7E; Mon, 16 Nov 2020 10:38:25 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [145.254.41.84]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 7C17C6047B2; Mon, 16 Nov 2020 10:38:20 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Stefan In-Reply-To: <20201116103231.2c151d33@scratchpost.org> Date: Mon, 16 Nov 2020 11:38:19 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6C52CE60-8585-4FC4-BCBC-B901CB75B35F@vodafonemail.de> References: <20201116103231.2c151d33@scratchpost.org> X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT Received-SPF: pass client-ip=153.92.174.39; envelope-from=stefan-guix@vodafonemail.de; helo=mx009.vodafonemail.xion.oxcs.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 05:38:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: hNF7nb1lHSJV Hi Danny! > It would be nice to also have some clients of that stuff in that file. >=20 > I.e. actually boot the raspberry pi using some chainloader config. >=20 > Otherwise it's hard to say whether this is a good API. When the API = is actually > used it's much easier to say. There will be more patches to come, then there will be a use of these = functions. The firmware blob using these files can=E2=80=99t be handled by Guix, = this will have to be left as an exercise. But could I add a skeleton for = it? Maybe something like this (but better using the copy-build-system):=20= (define (raspi-firmware url version hash) (package (build-system trivial-build-system) (arguments '(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((source (assoc-ref %build-inputs "source")) (out (assoc-ref %outputs "out")) (boot (string-append out "/boot")) (opt (string-append out "/opt"))) (mkdir-p boot) (copy-recursively (string-append source "/boot") = boot) (delete-file (string-append boot "/kernel.img")) (delete-file (string-append boot "/kernel7.img")) (delete-file (string-append boot "/kernel7l.img")) (delete-file (string-append boot "/kernel8.img")) (mkdir-p opt) (copy-recursively (string-append source "/opt") opt) (delete-file-recursively (string-append opt = "/vc/src")) #t)))) =E2=80=A6)) Further steps will be some functionality to modify the U-Boot = configuration (done with Kconfig) and to have a specific U-Boot package. Then I=E2=80=99ll care for a kernel. The board will only boot if all of this is in place. This is how I use it all currently (left out kernel, kernel-arguments, = initrd-modules): (operating-system (bootloader=20 (bootloader-configuration (bootloader (bootloader-chain (list (file-append raspi-firmware "/boot/") (file-append u-boot-rpi-3 = "/libexec/u-boot.bin") raspi-config.txt raspi-u-boot-bootloader.txt ;; Additional configurations to use. (raspi-custom.txt '("disable_overscan=3D1" "hdmi_force_hotplug=3D1" "audio=3Don" "dtoverlay=3Dgpio-ir" "dtoverlay=3Ddisable-wifi" = "dtoverlay=3Dvc4-fkms-v3d,cma-64"))) grub-efi-netboot-bootloader=20 #:installer (install-grub-efi-netboot "efi/boot") #:copy-files? #t)) (theme (grub-theme (resolution=20 '(1920 . 1080)) (image (file-append %artwork-repository = "/grub/GuixSD-fully-black-16-9.svg")))) (target "/boot") (keyboard-layout keyboard-layout))) =E2=80=A6) The above bootloader-chain could certainly be added to Guix, but leaving = out the raspi-firmware and the raspi-custom.txt =E2=80=93 maybe as a = function to allow adding an own raspi-custom.txt. If someone copies the = firmware by hand onto an SD card, then such a bootloader provided as = e.g. raspi-grub-bootloader would work. Bye Stefan