[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#33405] [PATCH 06/10] system: De-monadify 'operating-system-bootcfg'
From: |
Ludovic Courtès |
Subject: |
[bug#33405] [PATCH 06/10] system: De-monadify 'operating-system-bootcfg'. |
Date: |
Fri, 16 Nov 2018 10:36:20 +0100 |
* gnu/system.scm (operating-system-bootcfg): Remove 'mlet*' and
'lower-object' call.
* gnu/system/vm.scm (system-disk-image)
(system-qemu-image/shared-store): Adjust accordingly.
* guix/scripts/system.scm (perform-action): Add 'lower-object' call for
BOOTCFG.
---
gnu/system.scm | 20 +++++++++-----------
gnu/system/vm.scm | 10 +++++-----
guix/scripts/system.scm | 13 +++++++------
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 96b3b7d0e0..1766c8f90f 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -935,21 +935,19 @@ listed in OS. The C library expects to find it under
(define* (operating-system-bootcfg os #:optional (old-entries '()))
"Return the bootloader configuration file for OS. Use OLD-ENTRIES,
a list of <menu-entry>, to populate the \"old entries\" menu."
- (mlet* %store-monad
- ((root-fs -> (operating-system-root-file-system os))
- (root-device -> (file-system-device root-fs))
- (params -> (operating-system-boot-parameters os root-device
- #:system-kernel-arguments?
- #t))
- (entry -> (boot-parameters->menu-entry params))
- (bootloader-conf -> (operating-system-bootloader os)))
+ (let* ((root-fs (operating-system-root-file-system os))
+ (root-device (file-system-device root-fs))
+ (params (operating-system-boot-parameters
+ os root-device
+ #:system-kernel-arguments? #t))
+ (entry (boot-parameters->menu-entry params))
+ (bootloader-conf (operating-system-bootloader os)))
(define generate-config-file
(bootloader-configuration-file-generator
(bootloader-configuration-bootloader bootloader-conf)))
- ;; TODO: Remove the 'lower-object' call to make it non-monadic.
- (lower-object (generate-config-file bootloader-conf (list entry)
- #:old-entries old-entries))))
+ (generate-config-file bootloader-conf (list entry)
+ #:old-entries old-entries)))
(define* (operating-system-boot-parameters os root-device
#:key system-kernel-arguments?)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 6064e0f899..e6f0f78120 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -648,8 +648,8 @@ to USB sticks meant to be read-only."
(type file-system-type))
file-systems-to-keep)))))
- (mlet* %store-monad ((os-drv (operating-system-derivation os))
- (bootcfg (operating-system-bootcfg os)))
+ (mlet* %store-monad ((os-drv (operating-system-derivation os))
+ (bootcfg -> (operating-system-bootcfg os)))
(if (string=? "iso9660" file-system-type)
(iso9660-image #:name name
#:file-system-label root-label
@@ -713,7 +713,7 @@ of the GNU system as described by OS."
file-systems-to-keep)))))
(mlet* %store-monad
((os-drv (operating-system-derivation os))
- (bootcfg (operating-system-bootcfg os)))
+ (bootcfg -> (operating-system-bootcfg os)))
(qemu-image #:os-drv os-drv
#:bootcfg-drv bootcfg
#:bootloader (bootloader-configuration-bootloader
@@ -827,8 +827,8 @@ bootloader refers to: OS kernel, initrd, bootloader data,
etc."
;; Use a fixed UUID to improve determinism.
(operating-system-uuid os 'dce))
- (mlet* %store-monad ((os-drv (operating-system-derivation os))
- (bootcfg (operating-system-bootcfg os)))
+ (mlet* %store-monad ((os-drv (operating-system-derivation os))
+ (bootcfg -> (operating-system-bootcfg os)))
;; XXX: When FULL-BOOT? is true, we end up creating an image that contains
;; BOOTCFG and all its dependencies, including the output of OS-DRV.
;; This is more than needed (we only need the kernel, initrd, GRUB for its
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 9ba9428a08..c0f16cb2a7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -858,12 +858,13 @@ static checks."
(return #f))))
(bootcfg (if (eq? 'container action)
(return #f)
- (operating-system-bootcfg
- os
- (if (eq? 'init action)
- '()
- (map boot-parameters->menu-entry
- (profile-boot-parameters))))))
+ (lower-object
+ (operating-system-bootcfg
+ os
+ (if (eq? 'init action)
+ '()
+ (map boot-parameters->menu-entry
+ (profile-boot-parameters)))))))
(bootcfg-file -> (bootloader-configuration-file bootloader))
(bootloader-installer
(let ((installer (bootloader-installer bootloader))
--
2.19.1
- [bug#33405] [PATCH 00/10] De-monadify and clean up system code, Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 01/10] bootloader: De-monadify configuration file generators., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 10/10] guix system: Clarify 'perform-action'., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 08/10] guix system: Simplify bootloader package handling., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 04/10] system: De-monadify 'operating-system-boot-parameters'., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 03/10] linux-initrd: Return file-like objects instead of monadic values., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 05/10] system: Please Emacs., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 06/10] system: De-monadify 'operating-system-bootcfg'.,
Ludovic Courtès <=
- [bug#33405] [PATCH 07/10] vm: Remove explicit calls to 'operating-system-derivation'., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 09/10] guix system: De-monadify bootloader installation script., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 02/10] system: Simplify kernel argument handling., Ludovic Courtès, 2018/11/16
- [bug#33405] [PATCH 00/10] De-monadify and clean up system code, Mathieu Othacehe, 2018/11/16
- [bug#33405] [PATCH 00/10] De-monadify and clean up system code, Danny Milosavljevic, 2018/11/16