From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mCFZH/Ae82aqbQEAqHPOHw:P1 (envelope-from ) for ; Tue, 24 Sep 2024 20:20:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mCFZH/Ae82aqbQEAqHPOHw (envelope-from ) for ; Tue, 24 Sep 2024 22:20:00 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=pbfQrjO9; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=P0XUCBbT; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727209200; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3a3IY6fqYD3pEhUSVl+DZ0ymqt5W8hqxGfUYDT95ckM=; b=OahpEX16ago4A97+JzPXBzU0cGkAEn8H5ghUEy/Nc6lSBInpBJh9S/9Wgg/thnPkrzIls6 lImqdJgZhKlGJwTyR+maiQIb9C4Y5Gzyu9l45Yzj74euGJw+9uga2uhKj+LZwrhHS0KDQ0 EU8pJn9bykpRYYZIQT2IHiDke9FibCFacL0Wz+tXLnZs9X5TSElCGJYZeQlRYzsFSeUe1z IB9QXH+aWZH8Gwf48g81H0SVOou0UY5gE7hosxf8lTBfEWPV8lUPIPBjGw38b5z1kobGQT vyAQZpdIFW3KPbi9vZWf6MqatJExzBWQ6dlWUeEy71ZfV0ROeKTh8c0i9SK+Ig== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727209200; a=rsa-sha256; cv=none; b=A6LnxCwHcz7DP4RrcylPFYRrXBDDobV9kGOK6KSERS357/ZFHZ0wY26Xp1YCbHcmht0vTE dB9jd3mWRInEvNFVZ1x3pRc3JD941Q7aZ7BEpeOotv/URGC4eK6MjwzAIp4epbmDp5wZbm bDVtxYfUtSF4YJu6XTZ2GdypniSacUOVvXMDlCwJR2XZ+gXafumC//3E1eOFBGBw8dha4T MgQOqplaztTIoStObgDtvSmd7g8U+jSr4/nmrXffxs6JbC1FosSQ4+U3A7MWbzTK+TzEAI y44RHPdXIQ9amY6GMOgOnE/uXWQUxCnbQ6W0VxBQqY0QlaCsLUeZ0rJ4IyA8fg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=pbfQrjO9; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=P0XUCBbT; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" 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 2F44EBE14 for ; Tue, 24 Sep 2024 22:20:00 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC0k-0005zv-6l; Tue, 24 Sep 2024 16:19:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC0Z-0005pE-91 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:19:39 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stC0X-0002vc-AR for guix-patches@gnu.org; Tue, 24 Sep 2024 16:19:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=AeaMXSs2EmrOHXViYuxLFpiHKRRi+sjA9ruRZfVehbI=; b=pbfQrjO9k1LPKF/hVeBsLh2BZdt4rYhWyJSduD0gjDnFGqfw1k1A0254fErUOVnK+FWq7juMKoxswPDyn8BiJI6bVgHddSelWqv+jL41ET5tC/4RO8Q2ZsCXEs/dT5Z/yWEdUXy0hICpHSs3e/QOz9YWlqRckh+h3W6oGcGrlZZ/qzZ3LPOATJNNgTaK4ep4L1mqTpGT2NMz1MA98ceUJHy3LQH/cVp8QDeNeLrFiBbEZAJgEVgsztIhgL6JpRwqLNG1r3Qchfm0ixhOezRJjFvjD0ONYBsSJ5R4FkiF2bF0oCssq2AFNXG3i85W9kbAcepMJ8m1aV6gW6hJrbSTvQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC0v-0004pT-Q1; Tue, 24 Sep 2024 16:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH v6 09/12] gnu: bootloader: Add Raspberry Pi bootloader. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, lilah@lunabee.space, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72457@debbugs.gnu.org Cc: Lilah Tascheter , Efraim Flashner , Lilah Tascheter , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Lilah Tascheter , Vagrant Cascadian Received: via spool by 72457-submit@debbugs.gnu.org id=B72457.172720914918449 (code B ref 72457); Tue, 24 Sep 2024 20:20:01 +0000 Received: (at 72457) by debbugs.gnu.org; 24 Sep 2024 20:19:09 +0000 Received: from localhost ([127.0.0.1]:38453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC03-0004mw-9x for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:19:08 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:48191 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stBzf-0004j7-L2 for 72457@debbugs.gnu.org; Tue, 24 Sep 2024 16:18:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727202616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3a3IY6fqYD3pEhUSVl+DZ0ymqt5W8hqxGfUYDT95ckM=; b=P0XUCBbT0foQXmStFpD1E/ugvw18fhC8y0FV30SG85LbILRRGihppZ6Y8TUB7WawKmwtiU FEk3VaAWDwgWUjDwdnjWEPOaiFB6jDCZOKYmDQBpLF8stRbgJZiah7ANyBCzKkKRO/eNT6 2M5Kj5sf5TDTSyhCjWlLmxaVBjRnyx6LycIuyDs9GPtNgfJK9RyimdULX86Khafs+2ITkJ 4zTXf5CFuORFnqfJEWLPaA5DaJ38I5YRvVddQQHqHa05iaEEfM5OL28lS0lEWMZM4YRvpW +1Zme/+zog4EA1t0xIkmQiB6SgoVK01Q2Exa7S+V7upEFU/gcDF+CgM6zfMnkg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id ff9bb520 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 24 Sep 2024 18:30:16 +0000 (UTC) Date: Tue, 24 Sep 2024 20:29:16 +0200 Message-ID: <04305a30e6f90c549268499d2ba487d67bc0e9d7.1727201267.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.41 X-Spam-Score: -4.41 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 2F44EBE14 X-TUID: nzLgvYS5VYt+ From: Lilah Tascheter Less adding and more making it an actual bootloader rather than some weirdly specified packages. The GRUB EFI bootloader can be recreated by combining a Raspberry Pi bootloader with grub-efi. * gnu/bootloader.scm (efi-bootloader-profile, efi-bootloader-chain): Delete procedures. * gnu/bootloader/u-boot.scm (rpi-config, install-rpi, make-u-boot-rpi-bootloader): New procedures. (u-boot-rpi-2-bootloader, u-boot-rpi-3-bootloader, u-boot-rpi-4-bootloader, u-boot-rpi-bootloader): New variables. * gnu/packages/bootloaders.scm (make-u-boot-bin-package): Delete procedure. (%u-boot-rpi-efi-description, %u-boot-rpi-efi-description-32-bit, u-boot-rpi-2-efi, u-boot-rpi-3-32b-efi, u-boot-rpi-4-32b-efi, u-boot-rpi-arm64-efi, u-boot-rpi-2-bin, u-boot-rpi-3_32b-bin, u-boot-rpi-4_32b-bin, u-boot-rpi-arm64-bin, u-boot-rpi-2-efi-bin, u-boot-rpi-3-32b-efi-bin, u-boot-rpi-4-32b-efi-bin, u-boot-rpi-arm64-efi-bin): Delete variables. * gnu/packages/raspberry-pi.scm (grub-efi-bootloader-chain-raspi-64): Delete procedure. * gnu/system/examples/raspberry-pi-64-nfs-root.tmpl (bootloader), gnu/system/examples/raspberry-pi-64.tmpl (bootloader): Use new target system. Change-Id: I5139a0b00ec89189e8e7c84e06a7a3b7240259cd --- gnu/bootloader.scm | 124 +----------------- gnu/bootloader/u-boot.scm | 70 ++++++++++ gnu/packages/bootloaders.scm | 94 +------------ gnu/packages/raspberry-pi.scm | 18 --- .../examples/raspberry-pi-64-nfs-root.tmpl | 23 ++-- gnu/system/examples/raspberry-pi-64.tmpl | 18 +-- 6 files changed, 102 insertions(+), 245 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 14066e11f9..5e4578add0 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -118,8 +118,7 @@ (define-module (gnu bootloader) %efi-supported-systems efi-arch - install-efi - efi-bootloader-chain)) + install-efi)) ;;; @@ -733,124 +732,3 @@ (define (install-efi bootloader-config plan) (('vendir => (vendir :path) (loader :devpath) (disk :device)) #~(install-efi #+(file-append (lazy-efibootmgr) "/sbin/efibootmgr") #$vendir #$loader #$disk #$plan)))))) - -(define (efi-bootloader-profile packages files hooks) - "Creates a profile from the lists of PACKAGES and FILES from the store. -This profile is meant to be used by the bootloader-installer. - -FILES is a list of file or directory names from the store, which will be -symlinked into the profile. If a directory name ends with '/', then the -directory content instead of the directory itself will be symlinked into the -profile. - -FILES may contain file like objects produced by procedures like plain-file, -local-file, etc., or package contents produced with file-append. - -HOOKS lists additional hook functions to modify the profile." - (define* (efi-bootloader-profile-hook manifest #:optional system) - (define build - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules ((guix build utils) - #:select (mkdir-p strip-store-file-name)) - ((ice-9 ftw) - #:select (scandir)) - ((srfi srfi-1) - #:select (append-map every remove)) - ((srfi srfi-26) - #:select (cut))) - (define (symlink-to file directory transform) - "Creates a symlink to FILE named (TRANSFORM FILE) in DIRECTORY." - (symlink file (string-append directory "/" (transform file)))) - (define (directory-content directory) - "Creates a list of absolute path names inside DIRECTORY." - (map (lambda (name) - (string-append directory name)) - (or (scandir directory (lambda (name) - (not (member name '("." ".."))))) - '()))) - (define name-ends-with-/? (cut string-suffix? "/" <>)) - (define (name-is-store-entry? name) - "Return #t if NAME is a direct store entry and nothing inside." - (not (string-index (strip-store-file-name name) #\/))) - (let* ((files '#$files) - (directories (filter name-ends-with-/? files)) - (names-from-directories - (append-map (lambda (directory) - (directory-content directory)) - directories)) - (names (append names-from-directories - (remove name-ends-with-/? files)))) - (mkdir-p #$output) - (if (every file-exists? names) - (begin - (for-each (lambda (name) - (symlink-to name #$output - (if (name-is-store-entry? name) - strip-store-file-name - basename))) - names) - #t) - #f))))) - - (gexp->derivation "efi-bootloader-profile" - build - #:system system - #:local-build? #t - #:substitutable? #f - #:properties - `((type . profile-hook) - (hook . efi-bootloader-profile-hook)))) - - (profile (content (packages->manifest packages)) - (name "efi-bootloader-profile") - (hooks (cons efi-bootloader-profile-hook hooks)) - (locales? #f) - (allow-collisions? #f) - (relative-symlinks? #f))) - -(define* (efi-bootloader-chain final-bootloader - #:key - (packages '()) - (files '()) - (hooks '()) - installer - disk-image-installer) - "Define a chain of bootloaders with the FINAL-BOOTLOADER, optional PACKAGES, -and optional directories and files from the store given in the list of FILES. - -The package of the FINAL-BOOTLOADER and all PACKAGES and FILES will be placed -in an efi-bootloader-profile, which will be passed to the INSTALLER. - -FILES may contain file-like objects produced by procedures like plain-file, -local-file, etc., or package contents produced with file-append. - -If a directory name in FILES ends with '/', then the directory content instead -of the directory itself will be symlinked into the efi-bootloader-profile. - -The procedures in the HOOKS list can be used to further modify the bootloader -profile. It is possible to pass a single function instead of a list. - -If the INSTALLER argument is used, then this gexp procedure will be called to -install the efi-bootloader-profile. Otherwise the installer of the -FINAL-BOOTLOADER will be called. - -If the DISK-IMAGE-INSTALLER is used, then this gexp procedure will be called -to install the efi-bootloader-profile into a disk image. Otherwise the -disk-image-installer of the FINAL-BOOTLOADER will be called." - (bootloader - (inherit final-bootloader) - (name "efi-bootloader-chain") - (package - (efi-bootloader-profile (cons (bootloader-package final-bootloader) - packages) - files - (if (list? hooks) - hooks - (list hooks)))) - (installer - (or installer - (bootloader-installer final-bootloader))) - (disk-image-installer - (or disk-image-installer - (bootloader-disk-image-installer final-bootloader))))) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 2d351c9dc2..264138249b 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -28,7 +28,10 @@ (define-module (gnu bootloader u-boot) #:use-module (gnu bootloader) #:use-module (gnu bootloader extlinux) #:use-module (gnu packages bootloaders) + #:use-module (gnu packages raspberry-pi) + #:use-module (gnu system boot) #:use-module (guix gexp) + #:use-module (guix utils) #:export (u-boot-a20-olinuxino-lime-bootloader u-boot-a20-olinuxino-lime2-bootloader u-boot-a20-olinuxino-micro-bootloader @@ -49,6 +52,10 @@ (define-module (gnu bootloader u-boot) u-boot-puma-rk3399-bootloader u-boot-rock64-rk3328-bootloader u-boot-rockpro64-rk3399-bootloader + u-boot-rpi-2-bootloader + u-boot-rpi-3-bootloader + u-boot-rpi-4-bootloader + u-boot-rpi-bootloader u-boot-sifive-unmatched-bootloader u-boot-qemu-riscv64-bootloader u-boot-starfive-visionfive2-bootloader @@ -231,3 +238,66 @@ (define-u-bootloader-copy u-boot-ts7970-q-2g-1000mhz-c-bootloader (define-u-bootloader-copy u-boot-qemu-riscv64-bootloader u-boot-qemu-riscv64 "u-boot.bin") + + +;;; +;;; Raspberry Pi bootloader definitions. +;;; + +(define (rpi-config 64bit?) + "Raspberry Pi config.txt which includes a user-specified custom.txt." + (plain-file "config.txt" + (string-join + (list (string-append "arm_64bit=" (if 64bit? "1" "0")) + "enable_uart=1" + "kernel=u-boot.bin" + "include custom.txt") + #\newline + 'suffix))) + +(define (install-rpi u-boot-32 u-boot-64) + "Install the U-Boot from U-BOOT-64 for a 64-bit target, if available. +Otherwise install using U-BOOT-32." + (lambda* (#:key bootloader-config #:allow-other-keys . args) + (with-targets (bootloader-configuration-targets bootloader-config) + ('install (apply install-extlinux-config args)) + (('firmware => (firmware :path)) + (let* ((32? (bootloader-configuration-32bit? bootloader-config)) + (64bit? (and (not 32?) (target-64bit?) u-boot-64))) + #~(with-directory-excursion #$firmware + (atomic-copy #$(file-append (if 64bit? u-boot-64 u-boot-32) + "/libexec/u-boot.bin") + "u-boot.bin") + (atomic-copy #$(rpi-config 64bit?) "config.txt"))))))) + +(define* (make-u-boot-rpi-bootloader #:key u-boot-32 u-boot-64) + "Make a Raspberry Pi bootloader using either U-BOOT-32 or U-BOOT-64." + (bootloader (name 'u-boot) + (default-targets + (list (bootloader-target (type 'install) + (offset 'firmware) + (path "extlinux")) + (bootloader-target (type 'firmware) + (offset 'root) + (path "boot")))) + (installer (install-rpi u-boot-32 u-boot-64)))) + +;; These neither install firmware nor device-tree files for the Raspberry Pi. +;; They just assume them to be existing in 'install in the same way that some +;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. +;; They can be used with either extlinux or as UEFI firmware, alongside +;; e.g. GRUB. +(define u-boot-rpi-2-bootloader + (make-u-boot-rpi-bootloader #:u-boot-32 u-boot-rpi-2)) + +(define u-boot-rpi-3-bootloader + (make-u-boot-rpi-bootloader #:u-boot-32 u-boot-rpi-3-32b + #:u-boot-64 u-boot-rpi-arm64)) + +(define u-boot-rpi-4-bootloader + (make-u-boot-rpi-bootloader #:u-boot-32 u-boot-rpi-4-32b + #:u-boot-64 u-boot-rpi-arm64)) + +;; Usable for any 64-bit Raspberry Pi. +(define u-boot-rpi-bootloader + (make-u-boot-rpi-bootloader #:u-boot-64 u-boot-rpi-arm64)) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 00b502aaee..e08f471a97 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1451,40 +1451,8 @@ (define-public u-boot-pinebook-pro-rk3399 (modify-inputs (package-inputs base) (append arm-trusted-firmware-rk3399)))))) -(define*-public (make-u-boot-bin-package u-boot-package - #:key - (u-boot-bin "u-boot.bin")) - "Return a package with a single U-BOOT-BIN file from the U-BOOT-PACKAGE. -The package name will be that of the U-BOOT package suffixed with \"-bin\"." - (package - (name (string-append (package-name u-boot-package) "-bin")) - (version (package-version u-boot-package)) - (source #f) - (build-system trivial-build-system) - (arguments - (list - #:builder - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (mkdir #$output) - (symlink (search-input-file %build-inputs - (string-append "libexec/" #$u-boot-bin)) - (string-append #$output "/" #$u-boot-bin)))))) - (inputs (list u-boot-package)) - (home-page (package-home-page u-boot-package)) - (synopsis (package-synopsis u-boot-package)) - (description (string-append - (package-description u-boot-package) - "\n\n" - (format #f - "This package only contains the file ~a." - u-boot-bin))) - (license (package-license u-boot-package)))) - -(define-public %u-boot-rpi-efi-configs - '("CONFIG_OF_EMBED" - "CONFIG_OF_BOARD=y")) +;; get dtbs from firmware to support dtoverlays +(define-public %u-boot-rpi-configs '("CONFIG_OF_EMBED" "CONFIG_OF_BOARD=y")) (define %u-boot-rpi-description-32-bit "This is a 32-bit build of U-Boot.") @@ -1493,76 +1461,26 @@ (define %u-boot-rpi-description-64-bit "This is a common 64-bit build of U-Boot for all 64-bit capable Raspberry Pi variants.") -(define %u-boot-rpi-efi-description - "It allows network booting and uses the device-tree from the firmware, -allowing the usage of overlays. It can act as an EFI firmware for the -grub-efi-netboot-removable-bootloader.") - -(define %u-boot-rpi-efi-description-32-bit - (string-append %u-boot-rpi-efi-description " " - %u-boot-rpi-description-32-bit)) - (define-public u-boot-rpi-2 (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit)) (define-public u-boot-rpi-3-32b (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit)) (define-public u-boot-rpi-4-32b (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit)) (define-public u-boot-rpi-arm64 (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-64-bit)) -(define-public u-boot-rpi-2-efi - (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32-bit)) - -(define-public u-boot-rpi-3-32b-efi - (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32-bit)) - -(define-public u-boot-rpi-4-32b-efi - (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32-bit)) - -(define-public u-boot-rpi-arm64-efi - (make-u-boot-package "rpi_arm64""aarch64-linux-gnu" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description (string-append - %u-boot-rpi-efi-description " " - %u-boot-rpi-description-64-bit))) - -(define-public u-boot-rpi-2-bin (make-u-boot-bin-package u-boot-rpi-2)) - -(define-public u-boot-rpi-3_32b-bin (make-u-boot-bin-package u-boot-rpi-3-32b)) - -(define-public u-boot-rpi-4_32b-bin (make-u-boot-bin-package u-boot-rpi-4-32b)) - -(define-public u-boot-rpi-arm64-bin (make-u-boot-bin-package u-boot-rpi-arm64)) - -(define-public u-boot-rpi-2-efi-bin (make-u-boot-bin-package u-boot-rpi-2-efi)) - -(define-public u-boot-rpi-3-32b-efi-bin - (make-u-boot-bin-package u-boot-rpi-3-32b-efi)) - -(define-public u-boot-rpi-4-32b-efi-bin - (make-u-boot-bin-package u-boot-rpi-4-32b-efi)) - -(define-public u-boot-rpi-arm64-efi-bin - (make-u-boot-bin-package u-boot-rpi-arm64-efi)) - (define u-boot-ts-mx6 ;; There is no release; use the latest commit of the ;; 'imx_v2015.04_3.14.52_1.1.0_ga' branch. diff --git a/gnu/packages/raspberry-pi.scm b/gnu/packages/raspberry-pi.scm index 216c74cb9c..88dbc2cf6b 100644 --- a/gnu/packages/raspberry-pi.scm +++ b/gnu/packages/raspberry-pi.scm @@ -19,8 +19,6 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages raspberry-pi) - #:use-module (gnu bootloader) - #:use-module (gnu bootloader grub) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages algebra) @@ -329,22 +327,6 @@ (define (make-raspi-bcm28-dtbs linux) (format #f "The device-tree files for Raspberry Pi models from ~a." (package-name linux))))) -(define-public grub-efi-bootloader-chain-raspi-64 - ;; A bootloader capable to boot a Raspberry Pi over network via TFTP or from - ;; a local storage like a micro SD card. It neither installs firmware nor - ;; device-tree files for the Raspberry Pi. It just assumes them to be - ;; existing in boot/efi in the same way that some UEFI firmware with ACPI - ;; data is usually assumed to be existing on PCs. It creates firmware - ;; configuration files and a bootloader-chain with U-Boot to provide an EFI - ;; API for the final GRUB bootloader. It also serves as a blue-print to - ;; create an a custom bootloader-chain with firmware and device-tree - ;; packages or files. - (efi-bootloader-chain grub-efi-netboot-removable-bootloader - #:packages (list u-boot-rpi-arm64-efi-bin) - #:files (list %raspi-config-txt - %raspi-bcm27-dtb-txt - %raspi-u-boot-bootloader-txt))) - (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 diff --git a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl index 1baca02491..85476854f3 100644 --- a/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl +++ b/gnu/system/examples/raspberry-pi-64-nfs-root.tmpl @@ -25,14 +25,21 @@ (operating-system (host-name "raspberrypi-guix") (timezone "Europe/Berlin") - (bootloader (bootloader-configuration - (bootloader grub-efi-bootloader-chain-raspi-64) - (targets (list "/boot/efi")) - (theme (grub-theme - (resolution '(1920 . 1080)) - (image (file-append - %artwork-repository - "/grub/GuixSD-fully-black-16-9.svg")))))) + (bootloader (list (bootloader-configuration + (bootloader u-boot-rpi-bootloader) + (targets (list (bootloader-target + (type 'install) + (path "/boot/efi"))))) + (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets (list (bootloader-target + (type 'esp) + (path "/boot/efi")))) + (theme + (grub-theme + (resolution '(1920 . 1080)) + (image (file-append %artwork-repository + "/grub/GuixSD-fully-black-16-9.svg"))))))) (kernel-arguments '("ip=dhcp")) (kernel (customize-linux #:linux linux-libre-arm64-generic #:extra-version "arm64-generic-netboot" diff --git a/gnu/system/examples/raspberry-pi-64.tmpl b/gnu/system/examples/raspberry-pi-64.tmpl index 414d8ac7a5..d5b90b9705 100644 --- a/gnu/system/examples/raspberry-pi-64.tmpl +++ b/gnu/system/examples/raspberry-pi-64.tmpl @@ -24,14 +24,16 @@ (operating-system (host-name "raspberrypi-guix") (timezone "Europe/Berlin") - (bootloader (bootloader-configuration - (bootloader grub-efi-bootloader-chain-raspi-64) - (targets (list "/boot/efi")) - (theme (grub-theme - (resolution '(1920 . 1080)) - (image (file-append - %artwork-repository - "/grub/GuixSD-fully-black-16-9.svg")))))) + (bootloader (list (bootloader-configuration + (bootloader u-boot-rpi-bootloader) + (targets (list (bootloader-target + (type 'install) + (path "/boot/efi")))) + (theme + (grub-theme + (resolution '(1920 . 1080)) + (image (file-append %artwork-repository + "/grub/GuixSD-fully-black-16-9.svg"))))))) (kernel (customize-linux #:linux linux-libre-arm64-generic ;; It is possible to use a specific defconfig ;; file, for example the "bcmrpi3_defconfig" with -- 2.45.2