aboutsummaryrefslogtreecommitdiff
path: root/gnu/system/linux-initrd.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-03-21 21:55:20 +0100
committerLudovic Courtès <ludo@gnu.org>2017-03-21 22:33:07 +0100
commit278d486b0c0e3ec0378f6a2ccf6946fb176d088b (patch)
tree8bc8975dc235f698ea745758634d21a5f763a4fb /gnu/system/linux-initrd.scm
parent4f7a9e0bffab0cf53992c33ed75ff5fb394eda7b (diff)
downloadguix-278d486b0c0e3ec0378f6a2ccf6946fb176d088b.tar
guix-278d486b0c0e3ec0378f6a2ccf6946fb176d088b.tar.gz
file-systems: Do not use (gnu packages …).
Fixes a regression introduced in 7208995426714c9fc3ad59cadc3cc0f52df0f018 whereby (gnu system file-systems) would pull in (gnu packages …) module, which in turn breaks when importing things like (gnu build shepherd). * gnu/system/file-systems.scm (file-system-type-predicate): Export. (file-system-packages): Move to... * gnu/system/linux-initrd.scm (file-system-packages): ... here. Add docstring. * gnu/services/base.scm: Use it. * tests/file-systems.scm ("does not pull (gnu packages …)"): New test.
Diffstat (limited to 'gnu/system/linux-initrd.scm')
-rw-r--r--gnu/system/linux-initrd.scm23
1 files changed, 22 insertions, 1 deletions
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 1f1c306828..dfe198e43e 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -43,6 +43,7 @@
#:use-module (srfi srfi-26)
#:export (expression->initrd
raw-initrd
+ file-system-packages
base-initrd))
@@ -199,6 +200,26 @@ to it are lost."
#:volatile-root? '#$volatile-root?)))
#:name "raw-initrd")))
+(define* (file-system-packages file-systems #:key (volatile-root? #f))
+ "Return the list of statically-linked, stripped packages to check
+FILE-SYSTEMS."
+ `(,@(if (find (lambda (fs)
+ (string-prefix? "ext" (file-system-type fs)))
+ file-systems)
+ (list e2fsck/static)
+ '())
+ ,@(if (find (lambda (fs)
+ (string-suffix? "fat" (file-system-type fs)))
+ file-systems)
+ (list fatfsck/static)
+ '())
+ ,@(if (find (file-system-type-predicate "btrfs") file-systems)
+ (list btrfs-progs/static)
+ '())
+ ,@(if volatile-root?
+ (list unionfs-fuse/static)
+ '())))
+
(define* (base-initrd file-systems
#:key
(linux linux-libre)