diff mbox series

[bug#52062] gnu: system: Make old-style swap use default flags

Message ID 20211123175646.31930-1-dev@jpoiret.xyz
State Accepted
Headers show
Series [bug#52062] gnu: system: Make old-style swap use default flags | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Josselin Poiret Nov. 23, 2021, 5:56 p.m. UTC
* gnu/services/base.scm (swap-service-type): Fix it.
---
 gnu/services/base.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Josselin Poiret Nov. 23, 2021, 6:08 p.m. UTC | #1
Pushed as d48b404cf577cbfcd29b294e193a4db0c3e580b1 by Tobias.

Sorry for this omission, I wonder how that got past my tests.  Maybe
`guix system vm` removes swap-devices?

Best,
Josselin Poiret
Tobias Geerinckx-Rice Nov. 23, 2021, 7:51 p.m. UTC | #2
Josselin Poiret via Guix-patches via 写道:
> Sorry for this omission, I wonder how that got past my tests. 
> Maybe
> `guix system vm` removes swap-devices?

More: 
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/vm.scm#n647

Kind regards,

T G-R
diff mbox series

Patch

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 20736eb13f..ba01f5d764 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2225,8 +2225,10 @@  (define device-lookup
                      (and device
                           (begin
                             (restart-on-EINTR (swapon device
-                                                      #$(swap-space->flags-bit-mask
-                                                         swap)))
+                                                      #$(if (swap-space? swap)
+                                                            (swap-space->flags-bit-mask
+                                                             swap)
+                                                            0)))
                             #t)))))
         (stop #~(lambda _
                   (let ((device #$device-lookup))