system: De-monadify 'operating-system-boot-parameters'.

* gnu/system.scm (operating-system-boot-parameters): Turn to direct
style instead of monadic.
(operating-system-bootcfg): Adjust accordingly.
(operating-system-boot-parameters-file): Likewise.
This commit is contained in:
Ludovic Courtès 2018-11-15 18:52:38 +01:00
parent e34ae75dc1
commit 35b4468127
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 27 additions and 28 deletions

View File

@ -938,7 +938,7 @@ listed in OS. The C library expects to find it under
(mlet* %store-monad (mlet* %store-monad
((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 os root-device (params -> (operating-system-boot-parameters os root-device
#:system-kernel-arguments? #:system-kernel-arguments?
#t)) #t))
(entry -> (boot-parameters->menu-entry params)) (entry -> (boot-parameters->menu-entry params))
@ -956,14 +956,13 @@ listed in OS. The C library expects to find it under
"Return a monadic <boot-parameters> record that describes the boot "Return a monadic <boot-parameters> record that describes the boot
parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments
such as '--root' and '--load' to <boot-parameters>." such as '--root' and '--load' to <boot-parameters>."
(mlet* %store-monad (let* ((initrd (operating-system-initrd-file os))
((initrd -> (operating-system-initrd-file os)) (store (operating-system-store-file-system os))
(store -> (operating-system-store-file-system os)) (bootloader (bootloader-configuration-bootloader
(bootloader -> (bootloader-configuration-bootloader
(operating-system-bootloader os))) (operating-system-bootloader os)))
(bootloader-name -> (bootloader-name bootloader)) (bootloader-name (bootloader-name bootloader))
(label -> (kernel->boot-label (operating-system-kernel os)))) (label (kernel->boot-label (operating-system-kernel os))))
(return (boot-parameters (boot-parameters
(label label) (label label)
(root-device root-device) (root-device root-device)
(kernel (operating-system-kernel-file os)) (kernel (operating-system-kernel-file os))
@ -974,7 +973,7 @@ such as '--root' and '--load' to <boot-parameters>."
(initrd initrd) (initrd initrd)
(bootloader-name bootloader-name) (bootloader-name bootloader-name)
(store-device (ensure-not-/dev (file-system-device store))) (store-device (ensure-not-/dev (file-system-device store)))
(store-mount-point (file-system-mount-point store)))))) (store-mount-point (file-system-mount-point store)))))
(define (device->sexp device) (define (device->sexp device)
"Serialize DEVICE as an sexp (really, as an object with a read syntax.)" "Serialize DEVICE as an sexp (really, as an object with a read syntax.)"
@ -996,8 +995,8 @@ and '--load' to the returned file (since the returned file is then usually
stored into the content-addressed \"system\" directory, it's usually not a stored into the content-addressed \"system\" directory, it's usually not a
good idea to give it because the content hash would change by the content hash good idea to give it because the content hash would change by the content hash
being stored into the \"parameters\" file)." being stored into the \"parameters\" file)."
(mlet* %store-monad ((root -> (operating-system-root-file-system os)) (let* ((root (operating-system-root-file-system os))
(device -> (file-system-device root)) (device (file-system-device root))
(params (operating-system-boot-parameters (params (operating-system-boot-parameters
os device os device
#:system-kernel-arguments? #:system-kernel-arguments?