[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#73202] [PATCH v3 13/14] gnu: bootloader: Match records outside the
From: |
Herman Rimm |
Subject: |
[bug#73202] [PATCH v3 13/14] gnu: bootloader: Match records outside the module. |
Date: |
Thu, 26 Sep 2024 12:09:10 +0200 |
* gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
Add macros.
Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b
---
gnu/bootloader.scm | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 6b08e61492..b1ed187aa2 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@pantherx.org>
;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
;;; Copyright © 2024 Lilah Tascheter <lilah@lunabee.space>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -115,6 +116,9 @@ (define-module (gnu bootloader)
bootloader-configuration->gexp
bootloader-configurations->gexp
+ match-bootloader-configuration
+ match-menu-entry
+
%efi-supported-systems
efi-arch
install-efi
@@ -642,6 +646,20 @@ (define (bootloader-configurations->gexp
bootloader-configs . rest)
(apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
bootloader-configs)))
+;; In lieu of exporting bootloader-configuration and menu-entry RTDs.
+(define-syntax match-bootloader-configuration
+ (syntax-rules ()
+ "Bind each BOOTLOADER-CONFIGURATION field in FIELDS."
+ ((_ bootloader-configuration (fields ...) body ...)
+ (match-record bootloader-configuration <bootloader-configuration>
+ (fields ...) body ...))))
+
+(define-syntax match-menu-entry
+ (syntax-rules ()
+ "Bind each MENU-ENTRY field in FIELDS."
+ ((_ menu-entry (fields ...) body ...)
+ (match-record menu-entry <menu-entry> (fields ...) body ...))))
+
;;;
;;; Bootloader installation to ESP.
--
2.45.2
- [bug#73202] [PATCH v2 00/15] Preparation for bootloader rewrite., (continued)
- [bug#73202] [PATCH v2 00/15] Preparation for bootloader rewrite., Herman Rimm, 2024/09/21
- [bug#73202] [PATCH v3 01/14] gnu: bootloader: Remove deprecated bootloader-configuration field., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 02/14] gnu: system: Remove useless boot parameters., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 03/14] gnu: tests: reconfigure: Remove bootloader install test., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 08/14] gnu: bootloader: Add bootloader-target record and infastructure., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 09/14] gnu: bootloader: Add bootloader-configurations->gexp., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 06/14] guix: utils: Add flatten and flat-map from haunt., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 07/14] guix: records: Add wrap-element procedure., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 11/14] gnu: build: bootloader: Add efi-bootnums procedure., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 13/14] gnu: bootloader: Match records outside the module.,
Herman Rimm <=
- [bug#73202] [PATCH v3 10/14] gnu: bootloader: Add device-subvol field to menu-entry record., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 05/14] guix: scripts: Rewrite reinstall-bootloader to use provenance data., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 04/14] guix: scripts: Remove unused code., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 14/14] teams: Add bootloading team., Herman Rimm, 2024/09/26
- [bug#73202] [PATCH v3 12/14] gnu: bootloader: Install any bootloader to ESP., Herman Rimm, 2024/09/26