mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
mapped-devices: Use 'mdadm-static' in 'raid-device-mapping'.
* gnu/system/mapped-devices.scm (open-raid-device, close-raid-device): Use MDADM-STATIC instead of MDADM. Use 'file-append'.
This commit is contained in:
parent
631fda7e90
commit
4ed2f515d6
1 changed files with 5 additions and 3 deletions
|
@ -24,7 +24,7 @@ (define-module (gnu system mapped-devices)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu services shepherd)
|
#:use-module (gnu services shepherd)
|
||||||
#:autoload (gnu packages cryptsetup) (cryptsetup)
|
#:autoload (gnu packages cryptsetup) (cryptsetup)
|
||||||
#:autoload (gnu packages linux) (mdadm)
|
#:autoload (gnu packages linux) (mdadm-static)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (mapped-device
|
#:export (mapped-device
|
||||||
|
@ -150,12 +150,14 @@ (define (open-raid-device sources target)
|
||||||
(sleep 1)
|
(sleep 1)
|
||||||
(loop (+ 1 attempts))))
|
(loop (+ 1 attempts))))
|
||||||
|
|
||||||
(zero? (apply system* (string-append #$mdadm "/sbin/mdadm")
|
;; Use 'mdadm-static' rather than 'mdadm' to avoid pulling its whole
|
||||||
|
;; closure (80 MiB) in the initrd when a RAID device is needed for boot.
|
||||||
|
(zero? (apply system* #$(file-append mdadm-static "/sbin/mdadm")
|
||||||
"--assemble" #$target sources))))
|
"--assemble" #$target sources))))
|
||||||
|
|
||||||
(define (close-raid-device sources target)
|
(define (close-raid-device sources target)
|
||||||
"Return a gexp that stops the RAID device TARGET."
|
"Return a gexp that stops the RAID device TARGET."
|
||||||
#~(zero? (system* (string-append #$mdadm "/sbin/mdadm")
|
#~(zero? (system* #$(file-append mdadm-static "/sbin/mdadm")
|
||||||
"--stop" #$target)))
|
"--stop" #$target)))
|
||||||
|
|
||||||
(define raid-device-mapping
|
(define raid-device-mapping
|
||||||
|
|
Loading…
Reference in a new issue