diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-08-02 12:27:57 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-08-02 13:53:25 +0200 |
commit | 7f8ad82bf23b032ad6bd85bb1daa87cc83de509c (patch) | |
tree | fb7bf803a52eb6c58d2ee44afd42152092f32248 | |
parent | dfe06f6e7f486eb42a2b71e9d0ae52dfe8e3bb26 (diff) | |
download | patches-7f8ad82bf23b032ad6bd85bb1daa87cc83de509c.tar patches-7f8ad82bf23b032ad6bd85bb1daa87cc83de509c.tar.gz |
mapped-devices: Make RAID device opening message clearer.
* gnu/system/mapped-devices.scm (open-raid-device): Rename 'source' to
'sources'. Make 'waiting' message more informative.
(close-raid-device): Rename 'source' to 'sources'.
-rw-r--r-- | gnu/system/mapped-devices.scm | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index 1cfd649278..2a0706e50b 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -128,20 +128,24 @@ (open open-luks-device) (close close-luks-device))) -(define (open-raid-device source target) - "Return a gexp that assembles SOURCE (a list of devices) to the RAID device -TARGET, using 'mdadm'." - #~(let ((every (@ (srfi srfi-1) every))) - (let loop () - (unless (every file-exists? '#$source) - (format #t "waiting a bit...~%") - (sleep 1) - (loop))) - (zero? (system* (string-append #$mdadm "/sbin/mdadm") - "--assemble" #$target - #$@source)))) - -(define (close-raid-device source target) +(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 loop () + (unless (every file-exists? sources) + (format #t "waiting for RAID source devices~{ ~a~}...~%" + sources) + (sleep 1) + (loop))) + + (zero? (system* (string-append #$mdadm "/sbin/mdadm") + "--assemble" #$target sources))))) + +(define (close-raid-device sources target) "Return a gexp that stops the RAID device TARGET." #~(zero? (system* (string-append #$mdadm "/sbin/mdadm") "--stop" #$target))) |