guix-commits
[Top][All Lists]
Advanced

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

01/05: gnu: Add mdadm-static.


From: Ludovic Courtès
Subject: 01/05: gnu: Add mdadm-static.
Date: Thu, 27 Oct 2016 11:50:07 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 631fda7e90c5327cb365b785b221f37a899e8bce
Author: Ludovic Courtès <address@hidden>
Date:   Thu Oct 27 11:18:53 2016 +0200

    gnu: Add mdadm-static.
    
    * gnu/packages/linux.scm (mdadm-static): New variable.
---
 gnu/packages/linux.scm |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c959f62..3db3a58 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2374,6 +2374,35 @@ assemble, report on, and monitor arrays.  It can also 
move spares between raid
 arrays when needed.")
     (license license:gpl2+)))
 
+(define-public mdadm-static
+  (package
+    (inherit mdadm)
+    (name "mdadm-static")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mdadm)
+       ((#:make-flags flags)
+        `(cons "LDFLAGS = -static" ,flags))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'install 'remove-cruft
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out         (assoc-ref outputs "out"))
+                      (precious?   (lambda (file)
+                                     (member file '("." ".." "sbin"))))
+                      (directories (scandir out (negate precious?))))
+                 (with-directory-excursion out
+                   (for-each delete-file-recursively directories)
+                   (remove-store-references "sbin/mdadm")
+                   (delete-file "sbin/mdmon")
+                   #t))))))
+       ((#:modules modules %gnu-build-system-modules)
+        `((ice-9 ftw) ,@modules))
+       ((#:strip-flags _ '())
+        ''("--strip-all"))                        ;strip a few extra KiB
+       ((#:allowed-references _ '("out"))
+        '("out"))))                               ;refer only self
+    (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
+
 (define-public libaio
   (package
     (name "libaio")



reply via email to

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