guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: mapped-devices: Use 'mdadm-static' in 'raid-device-mapping'.


From: Ludovic Courtès
Subject: 02/05: mapped-devices: Use 'mdadm-static' in 'raid-device-mapping'.
Date: Thu, 27 Oct 2016 11:50:07 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 4ed2f515d69a199154c272997f4683b89ac0a9b8
Author: Ludovic Courtès <address@hidden>
Date:   Thu Oct 27 11:20:26 2016 +0200

    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'.
---
 gnu/system/mapped-devices.scm |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 2487638..e44f269 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -24,7 +24,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:autoload   (gnu packages cryptsetup) (cryptsetup)
-  #:autoload   (gnu packages linux) (mdadm)
+  #:autoload   (gnu packages linux) (mdadm-static)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:export (mapped-device
@@ -150,12 +150,14 @@ TARGET (e.g., \"/dev/md0\"), using 'mdadm'."
           (sleep 1)
           (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))))
 
 (define (close-raid-device sources 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)))
 
 (define raid-device-mapping



reply via email to

[Prev in Thread] Current Thread [Next in Thread]