From patchwork Thu Oct 31 21:15:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 69715 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1980F27BBE9; Thu, 31 Oct 2024 21:17:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B073627BBE2 for ; Thu, 31 Oct 2024 21:17:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6cXU-0005Hd-9g; Thu, 31 Oct 2024 17:17:08 -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 1t6cXP-0005HA-LS for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:03 -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 1t6cXP-0006OZ-D1 for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:03 -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=zCCRAJucOJvNVxoBexJZtBKSVI+lZAKCgggQbZi3iDI=; b=Hti5NLwjKrjJURefH3Y8y/zYLVMpzAmO+oVRGYLRCeeDEG6CjM3Y3geaMGPsRkMXYgIGA5T3Vg6aw6od8J4YJNxHwzUMiHGUX8/2XPQ7+F8VSE4CgCvOMagw7y5hRRXsglqGolsEiBAn9upPR+lUFfPaPuHyOXUXNdHKaPefA5CVa1NTkjJ5Pj4awyLSLQ/dOSFoKtFLKaKu7OSiqScA1XurMCZAKc2WYW/IShEGV281A2RebadEyfxbxOnQKbofuq6tz/PxuE/qREDegft9uP15clvxsUGs3/IM42MHo8z8gBiz5MMqA+AvTnz28FdOpln/IX1x1wINr2CmRnod4Q==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6cXO-0000xR-TA for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#74109] [PATCH v2 1/2] gnu: bootloader: grub: Add procedure to share EFI installer code. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 31 Oct 2024 21:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74109 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74109@debbugs.gnu.org Received: via spool by 74109-submit@debbugs.gnu.org id=B74109.17304094083645 (code B ref 74109); Thu, 31 Oct 2024 21:17:02 +0000 Received: (at 74109) by debbugs.gnu.org; 31 Oct 2024 21:16:48 +0000 Received: from localhost ([127.0.0.1]:44366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6cX9-0000wi-Mg for submit@debbugs.gnu.org; Thu, 31 Oct 2024 17:16:48 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43653 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6cX4-0000w4-1u for 74109@debbugs.gnu.org; Thu, 31 Oct 2024 17:16:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1730409393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F07iECtxj+QLyYfw7XbWDwKwgq+iJdg/iJpNuF1IXp4=; b=fCOGNcReMH2ooE4MqkSjTQA7hq2qwxxb83MvO0rIfaZE5/oUH9U4akvUZc/61wMhM4fq9A 9QgxibOG/Q5JtCcImr/McKI2qWWxn1vz/8CHERoS4bE+H4jEw4f7q2T0Hpt9//ZDDs63Xp w1FWq/rmPy9R44ZxI31M24hmg0jcqOHYUWM/6bCUIfqMwY/WAFVU5l3S5dkoj5AepcJBWc XgCorlGzzswPpLhIOI9uKyXvwcotk/y+Di7yf1yeQPwsk7hGyQouBr+XGQkfBIWdNEe5Jz ezqvY0mBo27asetSv6nYhuXqIBSDDl32C2qYkOh2hvxQCD2KoDTwQCJmHkBUpA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c3772a9a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74109@debbugs.gnu.org>; Thu, 31 Oct 2024 21:16:33 +0000 (UTC) Date: Thu, 31 Oct 2024 22:15:49 +0100 Message-ID: <7eaba6235cafeccce847e9e0e3ed523bafb23930.1730408855.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 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 X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/grub.scm (make-grub-efi-bootloader): Add procedure. (install-grub-efi, install-grub-efi32): Remove variables. (install-grub-efi-removable): Deprecate variable. Change-Id: Ie10b506bb1088179d459ddafe3229fd730ac45aa --- gnu/bootloader/grub.scm | 83 ++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 55 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 2723eda5f4..f4a197567e 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2022 Karl Hallsby ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,6 +29,7 @@ (define-module (gnu bootloader grub) #:use-module (guix build union) + #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix store) #:use-module (guix utils) @@ -54,6 +56,7 @@ (define-module (gnu bootloader grub) grub-theme-gfxmode install-grub-efi-removable + make-grub-efi-installer make-grub-efi-netboot-installer grub-bootloader @@ -621,7 +624,16 @@ (define install-grub-disk-image "-d" "." image)))) -(define install-grub-efi +(define* (make-grub-efi-installer #:key efi32? removable?) + "Return a G-expression of a procedure for installing GRUB on a UEFI +system. If EFI32? is #t, then a 32-bit target will be used. If +REMOVABLE? is #t, GRUB will be installed for Removable Media Boot." + (define extra-args + (list (and efi32? + #~(cond ((target-x86?) "--target=i386-efi") + ((target-arm?) "--target=arm-efi"))) + ;; This does not update UEFI boot entries, like --no-nvram. + (and removable? "--removable"))) #~(lambda (bootloader efi-dir mount-point) ;; There is nothing useful to do when called in the context of a disk ;; image generation. @@ -638,57 +650,10 @@ (define install-grub-efi ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or ;; root partition. (setenv "GRUB_ENABLE_CRYPTODISK" "y") - (invoke/quiet grub-install "--boot-directory" install-dir - "--bootloader-id=Guix" - "--efi-directory" target-esp))))) - -(define install-grub-efi-removable - #~(lambda (bootloader efi-dir mount-point) - ;; NOTE: mount-point is /mnt in guix system init /etc/config.scm /mnt/point - ;; NOTE: efi-dir comes from target list of booloader configuration - ;; There is nothing useful to do when called in the context of a disk - ;; image generation. - (when efi-dir - ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the - ;; system whose root is mounted at MOUNT-POINT. - (let ((grub-install (string-append bootloader "/sbin/grub-install")) - (install-dir (string-append mount-point "/boot")) - ;; When installing Guix, it's common to mount EFI-DIR below - ;; MOUNT-POINT rather than /boot/efi on the live image. - (target-esp (if (file-exists? (string-append mount-point efi-dir)) - (string-append mount-point efi-dir) - efi-dir))) - ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or - ;; root partition. - (setenv "GRUB_ENABLE_CRYPTODISK" "y") - (invoke/quiet grub-install "--boot-directory" install-dir - "--removable" - ;; "--no-nvram" - "--bootloader-id=Guix" - "--efi-directory" target-esp))))) - -(define install-grub-efi32 - #~(lambda (bootloader efi-dir mount-point) - ;; There is nothing useful to do when called in the context of a disk - ;; image generation. - (when efi-dir - ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the - ;; system whose root is mounted at MOUNT-POINT. - (let ((grub-install (string-append bootloader "/sbin/grub-install")) - (install-dir (string-append mount-point "/boot")) - ;; When installing Guix, it's common to mount EFI-DIR below - ;; MOUNT-POINT rather than /boot/efi on the live image. - (target-esp (if (file-exists? (string-append mount-point efi-dir)) - (string-append mount-point efi-dir) - efi-dir))) - ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or - ;; root partition. - (setenv "GRUB_ENABLE_CRYPTODISK" "y") - (invoke/quiet grub-install "--boot-directory" install-dir - "--bootloader-id=Guix" - (cond ((target-x86?) "--target=i386-efi") - ((target-arm?) "--target=arm-efi")) - "--efi-directory" target-esp))))) + (invoke/quiet grub-install "--bootloader-id=Guix" + "--boot-directory" install-dir + "--efi-directory" target-esp + #$@(filter identity extra-args)))))) (define* (make-grub-efi-netboot-installer grub-efi grub-cfg subdir) "Make a bootloader-installer for a grub-efi-netboot bootloader, which expects @@ -849,7 +814,7 @@ (define grub-efi-bootloader (bootloader (name 'grub-efi) (package grub-efi) - (installer install-grub-efi) + (installer (make-grub-efi-installer)) (disk-image-installer #f) (configuration-file grub-cfg) (configuration-file-generator grub-configuration-file))) @@ -858,12 +823,12 @@ (define grub-efi-removable-bootloader (bootloader (inherit grub-efi-bootloader) (name 'grub-efi-removable-bootloader) - (installer install-grub-efi-removable))) + (installer (make-grub-efi-installer #:removable? #t)))) (define grub-efi32-bootloader (bootloader (inherit grub-efi-bootloader) - (installer install-grub-efi32) + (installer (make-grub-efi-installer #:efi32? #t)) (name 'grub-efi32) (package grub-efi32))) @@ -909,4 +874,12 @@ (define-syntax grub-configuration (bootloader grub-bootloader) fields ...)))) + +;;; +;;; Deprecated bootloader and installer variables. +;;; + +(define-deprecated/alias install-grub-efi-removable + (make-grub-efi-installer #:removable? #t)) + ;;; grub.scm ends here From patchwork Thu Oct 31 21:15:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 69716 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ACD6527BBE2; Thu, 31 Oct 2024 21:17:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DB33327BBEA for ; Thu, 31 Oct 2024 21:17:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6cXi-0005IA-Ji; Thu, 31 Oct 2024 17:17:23 -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 1t6cXP-0005HB-Ov for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:03 -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 1t6cXP-0006Ob-GK for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:03 -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=bFWeR6NS+AYxEmJVo3SazWK4Aib9Rgv4nb552nN0uOE=; b=MGsksIScYg4IPWsr3Xtte8nENbyAYyjwg5ygF9Diew4bvylNv4xSvnEh5GyzP9epN0cToHehOw0gb3CFBmApMs5vfsaQTkD3U3m8hJx/O2hhYZsI7FWInvDu7U5YhRUSL/IcyLtHz0idd1rH1PKPMyTrGfg+3W7zYYuHARBMkoyv/NVN7iWNLyPf/PvsgWEkXNrEkDI5385OeJxLyRGKkt3cFWBc3fOH+yUICMATnr5mhtusHKB8jXH47f6mPhxWRyZcMgP7WD+gKO856OWk6/MdFahjBi5UXuEs8P7wDUa9+KkqBCF9j7KiQW+MDGfO0KHRggjf9p3xPsynFixDFg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t6cXP-0000xY-B3 for guix-patches@gnu.org; Thu, 31 Oct 2024 17:17:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#74109] [PATCH v2 2/2] gnu: bootloader: u-boot: Add procedure to share installer code. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 31 Oct 2024 21:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74109 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74109@debbugs.gnu.org Received: via spool by 74109-submit@debbugs.gnu.org id=B74109.17304094093651 (code B ref 74109); Thu, 31 Oct 2024 21:17:03 +0000 Received: (at 74109) by debbugs.gnu.org; 31 Oct 2024 21:16:49 +0000 Received: from localhost ([127.0.0.1]:44368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6cXA-0000wk-AT for submit@debbugs.gnu.org; Thu, 31 Oct 2024 17:16:48 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43653 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6cX5-0000w4-AX for 74109@debbugs.gnu.org; Thu, 31 Oct 2024 17:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1730409393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+nxd3wlRKi5kVjAYSC5tHvBCODcef7xZ/o0LQVDpt/U=; b=ICyPdi/gbHKzcP9bd7Bd4l3yoBWuYMU2lx4AyoKTIWwKB1LMqWUDJjJYdoA26ekTb4Rb2K ryD9+9A/uvt/2oMpisfwVpVxHeJu+bn+ptnZwubp6DMU9DTVI8fJ1H+u7KEgFwlgJMQTLm JxSHTRspRwD4HwWgCzxpc0RDCvHGlBeU5qM2BBZNBkzvnPjL2GpJiQsIh83tQiuFghZK0i ehttGKQjqUYh+bGJXypFVfQyWq+Plrg+Tby4zY1rRXZMT0HZ+lwEvsrqoOj7r9YBrT0519 xwkiEvNK0sE4AtDBwUD8gWC1gxML/1seFK7BiPtEAlpG+QABzRt99J+N7kkFIQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 433069b6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74109@debbugs.gnu.org>; Thu, 31 Oct 2024 21:16:33 +0000 (UTC) Date: Thu, 31 Oct 2024 22:15:50 +0100 Message-ID: <19a389de12d56ef271ab7c7637b3f5fcab2d0cd6.1730408855.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 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 X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/u-boot.scm (make-u-boot-installer): Add procedure. (install-u-boot-ts7970-q-2g-1000mhz-c-u-boot, install-qemu-riscv64-u-boot): Remove variables. (install-starfive-visionfive2-uEnv.txt, u-boot-ts7970-q-2g-1000mhz-c-bootloader, u-boot-qemu-riscv64-bootloader): Use make-u-boot-installer. Change-Id: I0b0b507925a7c8ca608f7307d442d9588862ae91 --- gnu/bootloader/u-boot.scm | 47 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index c5437a7b63..5e149eaea0 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2023 Efraim Flashner -;;; Copyright © 2023 Herman Rimm +;;; Copyright © 2023-2024 Herman Rimm ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. @@ -28,6 +28,7 @@ (define-module (gnu bootloader u-boot) #:use-module (gnu bootloader) #:use-module (gnu packages bootloaders) #:use-module (guix gexp) + #:use-module (ice-9 match) #:export (u-boot-bootloader u-boot-a20-olinuxino-lime-bootloader u-boot-a20-olinuxino-lime2-bootloader @@ -53,6 +54,18 @@ (define-module (gnu bootloader u-boot) u-boot-ts7970-q-2g-1000mhz-c-bootloader u-boot-wandboard-bootloader)) +(define (make-u-boot-installer file) + (let ((file + (match file + ((? string?) + (list #~(install-file (string-append bootloader #$file) + install-dir))) + ((? file-like?) (list #~(install-file #$file install-dir))) + (#f '())))) + #~(lambda (bootloader device mount-point) + (let ((install-dir (string-append mount-point "/boot"))) + #$@file)))) + (define install-u-boot #~(lambda (bootloader root-index image) (if bootloader @@ -145,12 +158,6 @@ (define install-rockpro64-rk3399-u-boot (define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot) -(define install-u-boot-ts7970-q-2g-1000mhz-c-u-boot - #~(lambda (bootloader device mount-point) - (let ((u-boot.imx (string-append bootloader "/libexec/u-boot.imx")) - (install-dir (string-append mount-point "/boot"))) - (install-file u-boot.imx install-dir)))) - (define install-sifive-unmatched-u-boot #~(lambda (bootloader root-index image) (let ((spl (string-append bootloader "/libexec/spl/u-boot-spl.bin")) @@ -171,24 +178,14 @@ (define install-starfive-visionfive2-u-boot image (* 2082 512))))) (define install-starfive-visionfive2-uEnv.txt - #~(lambda (bootloader device mount-point) - (mkdir-p (string-append mount-point "/boot")) - (call-with-output-file (string-append mount-point "/boot/uEnv.txt") - (lambda (port) - (format port - ;; if board SPI use vender's u-boot, will find - ;; ""starfive/starfive_visionfive2.dtb"", We cannot guarantee - ;; that users will update this u-boot, so set it. - "fdtfile=starfive/jh7110-starfive-visionfive-2-v1.3b.dtb~%"))))) - -(define install-qemu-riscv64-u-boot - #~(lambda (bootloader device mount-point) - (let ((u-boot.bin (string-append bootloader "/libexec/u-boot.bin")) - (install-dir (string-append mount-point "/boot"))) - (install-file u-boot.bin install-dir)))) + (make-u-boot-installer + ;; If the board SPI uses the vendor's U-Boot, it will find starfive/ + ;; starfive_visionfive2.dtb. We cannot guarantee that users will + ;; update this U-Boot, so set the FDT explicitly. + (plain-file "uEnv.txt" + "fdtfile=starfive/jh7110-starfive-visionfive-2-v1.3b.dtb~%"))) - ;;; ;;; Bootloader definitions. ;;; @@ -329,7 +326,7 @@ (define u-boot-ts7970-q-2g-1000mhz-c-bootloader (bootloader (inherit u-boot-bootloader) (package u-boot-ts7970-q-2g-1000mhz-c) - (installer install-u-boot-ts7970-q-2g-1000mhz-c-u-boot) + (installer (make-u-boot-installer "libexec/u-boot.imx")) (disk-image-installer #f))) (define u-boot-sifive-unmatched-bootloader @@ -349,5 +346,5 @@ (define u-boot-qemu-riscv64-bootloader (bootloader (inherit u-boot-bootloader) (package u-boot-qemu-riscv64) - (installer install-qemu-riscv64-u-boot) + (installer (make-u-boot-installer "libexec/u-boot.bin")) (disk-image-installer #f)))