system: De-monadify 'operating-system-bootcfg'.
* 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.
This commit is contained in:
parent
5ece56dc73
commit
9782c82217
|
@ -935,21 +935,19 @@ listed in OS. The C library expects to find it under
|
||||||
(define* (operating-system-bootcfg os #:optional (old-entries '()))
|
(define* (operating-system-bootcfg os #:optional (old-entries '()))
|
||||||
"Return the bootloader configuration file for OS. Use OLD-ENTRIES,
|
"Return the bootloader configuration file for OS. Use OLD-ENTRIES,
|
||||||
a list of <menu-entry>, to populate the \"old entries\" menu."
|
a list of <menu-entry>, to populate the \"old entries\" menu."
|
||||||
(mlet* %store-monad
|
(let* ((root-fs (operating-system-root-file-system os))
|
||||||
((root-fs -> (operating-system-root-file-system os))
|
(root-device (file-system-device root-fs))
|
||||||
(root-device -> (file-system-device root-fs))
|
(params (operating-system-boot-parameters
|
||||||
(params -> (operating-system-boot-parameters os root-device
|
os root-device
|
||||||
#:system-kernel-arguments?
|
#:system-kernel-arguments? #t))
|
||||||
#t))
|
(entry (boot-parameters->menu-entry params))
|
||||||
(entry -> (boot-parameters->menu-entry params))
|
(bootloader-conf (operating-system-bootloader os)))
|
||||||
(bootloader-conf -> (operating-system-bootloader os)))
|
|
||||||
(define generate-config-file
|
(define generate-config-file
|
||||||
(bootloader-configuration-file-generator
|
(bootloader-configuration-file-generator
|
||||||
(bootloader-configuration-bootloader bootloader-conf)))
|
(bootloader-configuration-bootloader bootloader-conf)))
|
||||||
|
|
||||||
;; TODO: Remove the 'lower-object' call to make it non-monadic.
|
(generate-config-file bootloader-conf (list entry)
|
||||||
(lower-object (generate-config-file bootloader-conf (list entry)
|
#:old-entries old-entries)))
|
||||||
#:old-entries old-entries))))
|
|
||||||
|
|
||||||
(define* (operating-system-boot-parameters os root-device
|
(define* (operating-system-boot-parameters os root-device
|
||||||
#:key system-kernel-arguments?)
|
#:key system-kernel-arguments?)
|
||||||
|
|
|
@ -648,8 +648,8 @@ to USB sticks meant to be read-only."
|
||||||
(type file-system-type))
|
(type file-system-type))
|
||||||
file-systems-to-keep)))))
|
file-systems-to-keep)))))
|
||||||
|
|
||||||
(mlet* %store-monad ((os-drv (operating-system-derivation os))
|
(mlet* %store-monad ((os-drv (operating-system-derivation os))
|
||||||
(bootcfg (operating-system-bootcfg os)))
|
(bootcfg -> (operating-system-bootcfg os)))
|
||||||
(if (string=? "iso9660" file-system-type)
|
(if (string=? "iso9660" file-system-type)
|
||||||
(iso9660-image #:name name
|
(iso9660-image #:name name
|
||||||
#:file-system-label root-label
|
#:file-system-label root-label
|
||||||
|
@ -713,7 +713,7 @@ of the GNU system as described by OS."
|
||||||
file-systems-to-keep)))))
|
file-systems-to-keep)))))
|
||||||
(mlet* %store-monad
|
(mlet* %store-monad
|
||||||
((os-drv (operating-system-derivation os))
|
((os-drv (operating-system-derivation os))
|
||||||
(bootcfg (operating-system-bootcfg os)))
|
(bootcfg -> (operating-system-bootcfg os)))
|
||||||
(qemu-image #:os-drv os-drv
|
(qemu-image #:os-drv os-drv
|
||||||
#:bootcfg-drv bootcfg
|
#:bootcfg-drv bootcfg
|
||||||
#:bootloader (bootloader-configuration-bootloader
|
#:bootloader (bootloader-configuration-bootloader
|
||||||
|
@ -827,8 +827,8 @@ bootloader refers to: OS kernel, initrd, bootloader data, etc."
|
||||||
;; Use a fixed UUID to improve determinism.
|
;; Use a fixed UUID to improve determinism.
|
||||||
(operating-system-uuid os 'dce))
|
(operating-system-uuid os 'dce))
|
||||||
|
|
||||||
(mlet* %store-monad ((os-drv (operating-system-derivation os))
|
(mlet* %store-monad ((os-drv (operating-system-derivation os))
|
||||||
(bootcfg (operating-system-bootcfg os)))
|
(bootcfg -> (operating-system-bootcfg os)))
|
||||||
;; XXX: When FULL-BOOT? is true, we end up creating an image that contains
|
;; 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.
|
;; 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
|
;; This is more than needed (we only need the kernel, initrd, GRUB for its
|
||||||
|
|
|
@ -858,12 +858,13 @@ static checks."
|
||||||
(return #f))))
|
(return #f))))
|
||||||
(bootcfg (if (eq? 'container action)
|
(bootcfg (if (eq? 'container action)
|
||||||
(return #f)
|
(return #f)
|
||||||
(operating-system-bootcfg
|
(lower-object
|
||||||
os
|
(operating-system-bootcfg
|
||||||
(if (eq? 'init action)
|
os
|
||||||
'()
|
(if (eq? 'init action)
|
||||||
(map boot-parameters->menu-entry
|
'()
|
||||||
(profile-boot-parameters))))))
|
(map boot-parameters->menu-entry
|
||||||
|
(profile-boot-parameters)))))))
|
||||||
(bootcfg-file -> (bootloader-configuration-file bootloader))
|
(bootcfg-file -> (bootloader-configuration-file bootloader))
|
||||||
(bootloader-installer
|
(bootloader-installer
|
||||||
(let ((installer (bootloader-installer bootloader))
|
(let ((installer (bootloader-installer bootloader))
|
||||||
|
|
Loading…
Reference in New Issue