summaryrefslogtreecommitdiff
path: root/guix
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 /guix
parent76114232d7c140fb9fee84510b72fcfe6ee27714 (diff)
downloadguix-patches-2ca982ff41270288913ad6b7d5d9e1cad87b06d9.tar
guix-patches-2ca982ff41270288913ad6b7d5d9e1cad87b06d9.tar.gz
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 'guix')
-rw-r--r--guix/scripts/system.scm20
-rw-r--r--guix/scripts/system/reconfigure.scm22
2 files changed, 23 insertions, 19 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 40401d7e03..83bbefd3dc 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -253,7 +253,7 @@ the ownership of '~a' may be incorrect!~%")
#:target target)
(return
(info (G_ "bootloader successfully installed on '~a'~%")
- (bootloader-configuration-target bootloader))))))))
+ (bootloader-configuration-targets bootloader))))))))
;;;
@@ -768,14 +768,13 @@ and TARGET arguments."
skip-safety-checks?
install-bootloader?
dry-run? derivations-only?
- use-substitutes? bootloader-target target
+ use-substitutes? target
full-boot?
container-shared-network?
(mappings '())
(gc-root #f))
"Perform ACTION for IMAGE. INSTALL-BOOTLOADER? specifies whether to install
-bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the
-target root directory.
+bootloader; TARGET is the target root directory.
FULL-BOOT? is used for the 'vm' action; it determines whether to
boot directly to the kernel or to the bootloader. CONTAINER-SHARED-NETWORK?
@@ -856,13 +855,13 @@ static checks."
#:target (or target "/"))
(return
(info (G_ "bootloader successfully installed on '~a'~%")
- (bootloader-configuration-target bootloader))))
+ (bootloader-configuration-targets bootloader))))
(with-shepherd-error-handling
- (upgrade-shepherd-services local-eval os)
- (return (format #t (G_ "\
+ (upgrade-shepherd-services local-eval os)
+ (return (format #t (G_ "\
To complete the upgrade, run 'herd restart SERVICE' to stop,
upgrade, and restart each service that was not automatically restarted.\n")))
- (return (format #t (G_ "\
+ (return (format #t (G_ "\
Run 'herd status' to view the list of services on your system.\n"))))))
((init)
(newline)
@@ -1218,9 +1217,9 @@ resulting from command-line parsing."
(target-file (match args
((first second) second)
(_ #f)))
- (bootloader-target
+ (bootloader-targets
(and bootloader?
- (bootloader-configuration-target
+ (bootloader-configuration-targets
(operating-system-bootloader os)))))
(define (graph-backend)
@@ -1269,7 +1268,6 @@ resulting from command-line parsing."
opts)
#:install-bootloader? bootloader?
#:target target-file
- #:bootloader-target bootloader-target
#:gc-root (assoc-ref opts 'gc-root)))))
#:target target
#:system system)))
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm
index 49da6ecb16..bf23fb06af 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -207,10 +207,10 @@ services as defined by OS."
(define (install-bootloader-program installer disk-installer
bootloader-package bootcfg
- bootcfg-file device target)
+ bootcfg-file devices target)
"Return an executable store item that, upon being evaluated, will install
-BOOTCFG to BOOTCFG-FILE, a target file name, on DEVICE, a file system device,
-at TARGET, a mount point, and subsequently run INSTALLER from
+BOOTCFG to BOOTCFG-FILE, a target file name, on DEVICES, a list of file system
+devices, at TARGET, a mount point, and subsequently run INSTALLER from
BOOTLOADER-PACKAGE."
(program-file
"install-bootloader.scm"
@@ -254,11 +254,17 @@ BOOTLOADER-PACKAGE."
;; The bootloader might not support installation on a
;; mounted directory using the BOOTLOADER-INSTALLER
;; procedure. In that case, fallback to installing the
- ;; bootloader directly on DEVICE using the
+ ;; bootloader directly on DEVICES using the
;; BOOTLOADER-DISK-IMAGE-INSTALLER procedure.
(if #$installer
- (#$installer #$bootloader-package #$device #$target)
- (#$disk-installer #$bootloader-package 0 #$device)))
+ (for-each (lambda (device)
+ (#$installer #$bootloader-package device
+ #$target))
+ '#$devices)
+ (for-each (lambda (device)
+ (#$disk-installer #$bootloader-package
+ 0 device))
+ '#$devices)))
(lambda args
(delete-file new-gc-root)
(match args
@@ -284,7 +290,7 @@ additional configurations specified by MENU-ENTRIES can be selected."
(disk-installer (and run-installer?
(bootloader-disk-image-installer bootloader)))
(package (bootloader-package bootloader))
- (device (bootloader-configuration-target configuration))
+ (devices (bootloader-configuration-targets configuration))
(bootcfg-file (bootloader-configuration-file bootloader)))
(eval #~(parameterize ((current-warning-port (%make-void-port "w")))
(primitive-load #$(install-bootloader-program installer
@@ -292,7 +298,7 @@ additional configurations specified by MENU-ENTRIES can be selected."
package
bootcfg
bootcfg-file
- device
+ devices
target))))))