summaryrefslogtreecommitdiff
path: root/gnu/bootloader.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-08-06 16:33:02 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-08-29 01:05:26 -0400
commit2ca982ff41270288913ad6b7d5d9e1cad87b06d9 (patch)
tree90e95707a8e50c941f65fb16b69842c5cae245e8 /gnu/bootloader.scm
parent76114232d7c140fb9fee84510b72fcfe6ee27714 (diff)
gnu: bootloader: Support multiple targets.
Fixes <https://issues.guix.gnu.org/40997>. * gnu/bootloader.scm (<bootloader-configuration>): New 'targets' field. (%bootloader-configuration-target): New procedure. (bootloader-configuration-target): Add deprecation warning. (bootloader-configuration-targets): New procedure. * guix/scripts/system.scm (install): Access targets via bootloader-configuration-targets. (perform-action)[bootloader-target]: Remove unused argument and update doc. Access targets via bootloader-configuration-targets and fix indentation. (process-action): Access targets via bootloader-configuration-targets. Do not provide the unused BOOTLOADER-TARGET argument when applying `perform-action'. * guix/scripts/system/reconfigure.scm (install-bootloader-program): Rename DEVICE argument to DEVICES. Adjust doc and comment. Apply `installer' and `disk-installer' for every DEVICES. (install-bootloader): Access targets via bootloader-configuration-targets and rename variable from DEVICE to DEVICES. * gnu/tests/install.scm: Adjust accordingly. * tests/guix-system.sh: Likewise. * gnu/tests/reconfigure.scm (run-install-bootloader-test): Adjust the DEVICES argument so that it is a list. * doc/guix.texi: Update doc.
Diffstat (limited to 'gnu/bootloader.scm')
-rw-r--r--gnu/bootloader.scm22
1 files changed, 20 insertions, 2 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 6d7352ddd21..98807a4810b 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -55,7 +55,8 @@
55 bootloader-configuration 55 bootloader-configuration
56 bootloader-configuration? 56 bootloader-configuration?
57 bootloader-configuration-bootloader 57 bootloader-configuration-bootloader
58 bootloader-configuration-target 58 bootloader-configuration-target ;deprecated
59 bootloader-configuration-targets
59 bootloader-configuration-menu-entries 60 bootloader-configuration-menu-entries
60 bootloader-configuration-default-entry 61 bootloader-configuration-default-entry
61 bootloader-configuration-timeout 62 bootloader-configuration-timeout
@@ -183,7 +184,9 @@ record."
183 bootloader-configuration make-bootloader-configuration 184 bootloader-configuration make-bootloader-configuration
184 bootloader-configuration? 185 bootloader-configuration?
185 (bootloader bootloader-configuration-bootloader) ;<bootloader> 186 (bootloader bootloader-configuration-bootloader) ;<bootloader>
186 (target bootloader-configuration-target ;string 187 (targets %bootloader-configuration-targets ;list of strings
188 (default #f))
189 (target %bootloader-configuration-target ;deprecated
187 (default #f)) 190 (default #f))
188 (menu-entries bootloader-configuration-menu-entries ;list of <menu-entry> 191 (menu-entries bootloader-configuration-menu-entries ;list of <menu-entry>
189 (default '())) 192 (default '()))
@@ -204,6 +207,21 @@ record."
204 (serial-speed bootloader-configuration-serial-speed ;integer | #f 207 (serial-speed bootloader-configuration-serial-speed ;integer | #f
205 (default #f))) 208 (default #f)))
206 209
210;;; Deprecated.
211(define (bootloader-configuration-target config)
212 (warning (G_ "the 'target' field is deprecated, please use 'targets' \
213instead~%"))
214 (%bootloader-configuration-target config))
215
216(define (bootloader-configuration-targets config)
217 (or (%bootloader-configuration-targets config)
218 ;; TODO: Remove after the deprecated 'target' field is removed.
219 (list (bootloader-configuration-target config))
220 ;; XXX: At least the GRUB installer (see (gnu bootloader grub)) has this
221 ;; peculiar behavior of installing fonts and GRUB modules when DEVICE is #f,
222 ;; hence the default value of '(#f) rather than '().
223 (list #f)))
224
207 225
208;;; 226;;;
209;;; Bootloaders. 227;;; Bootloaders.