GNU bug report logs - #51346
[PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags

Previous Next

Package: guix-patches;

Reported by: Josselin Poiret <dev <at> jpoiret.xyz>

Date: Sat, 23 Oct 2021 09:47:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 51346 <at> debbugs.gnu.org
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





This bug report was last modified 3 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.