mapped-devices: raid-device-mapping: Avoid non-top-level 'use-modules'.
Fixes <http://bugs.gnu.org/24135>. Reported by myglc2 <myglc2@gmail.com>. * gnu/system/mapped-devices.scm (open-raid-device): Avoid non-top-level 'use-modules' form.
This commit is contained in:
parent
9d1e56b76d
commit
10618627bf
|
@ -131,10 +131,13 @@
|
|||
(define (open-raid-device sources target)
|
||||
"Return a gexp that assembles SOURCES (a list of devices) to the RAID device
|
||||
TARGET (e.g., \"/dev/md0\"), using 'mdadm'."
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-1) (ice-9 format))
|
||||
#~(let ((sources '#$sources)
|
||||
|
||||
(let ((sources '#$sources))
|
||||
;; XXX: We're not at the top level here. We could use a
|
||||
;; non-top-level 'use-modules' form but that doesn't work when the
|
||||
;; code is eval'd, like the Shepherd does.
|
||||
(every (@ (srfi srfi-1) every))
|
||||
(format (@ (ice-9 format) format)))
|
||||
(let loop ((attempts 0))
|
||||
(unless (every file-exists? sources)
|
||||
(when (> attempts 20)
|
||||
|
@ -147,7 +150,7 @@ TARGET (e.g., \"/dev/md0\"), using 'mdadm'."
|
|||
(loop (+ 1 attempts))))
|
||||
|
||||
(zero? (system* (string-append #$mdadm "/sbin/mdadm")
|
||||
"--assemble" #$target sources)))))
|
||||
"--assemble" #$target sources))))
|
||||
|
||||
(define (close-raid-device sources target)
|
||||
"Return a gexp that stops the RAID device TARGET."
|
||||
|
|
Loading…
Reference in New Issue