guix-patches
[Top][All Lists]
Advanced

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

[bug#51346] [PATCH v2 3/4] gnu: system: Filter out boot dependencies fro


From: Josselin Poiret
Subject: [bug#51346] [PATCH v2 3/4] gnu: system: Filter out boot dependencies from swap-space.
Date: Wed, 27 Oct 2021 15:09:12 +0000

* gnu/systems.scm (swap-services): Filter them.
---
 gnu/system.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 2797c07e36..e3accb3c1e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -586,7 +586,23 @@ (define (device-mapping-services os)
 
 (define (swap-services os)
   "Return the list of swap services for OS."
-  (map swap-service (operating-system-swap-devices os)))
+  (define early-userspace-file-systems
+    (filter file-system-needed-for-boot?
+            (operating-system-file-systems os)))
+
+  (define early-userspace-mapped-devices
+    (operating-system-boot-mapped-devices os))
+
+  (define (filter-deps swap)
+    (swap-space
+     (inherit swap)
+     (dependencies (remove (lambda (dep)
+                            (or (member dep early-userspace-mapped-devices)
+                                (member dep early-userspace-file-systems)))
+                          (swap-space-dependencies swap)))))
+
+  (map (compose swap-service filter-deps)
+       (operating-system-swap-devices os)))
 
 (define* (system-linux-image-file-name #:optional
                                        (target (or (%current-target-system)
-- 
2.33.1






reply via email to

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