mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-05 16:55:56 +02:00
system: Add swap flags.
* gnu/system/file-systems.scm (swap-space)[priority, discard?]: Add them. * guix/build/syscalls.scm (SWAP_FLAG_PREFER, SWAP_FLAG_PRIO_MASK, SWAP_FLAG_PRIO_SHIFT, SWAP_FLAG_DISCARD): Add them. * gnu/build/file-systems.scm (swap-space->flags-bit-mask): Add it. * gnu/services/base.scm (swap-service-type): Use it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
committed by
Ludovic Courtès
parent
f574dbd163
commit
0831dfab75
@@ -58,7 +58,8 @@
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages terminals)
|
||||
#:use-module ((gnu build file-systems)
|
||||
#:select (mount-flags->bit-mask))
|
||||
#:select (mount-flags->bit-mask
|
||||
swap-space->flags-bit-mask))
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (guix modules)
|
||||
@@ -2223,7 +2224,9 @@ instance."
|
||||
(let ((device #$device-lookup))
|
||||
(and device
|
||||
(begin
|
||||
(restart-on-EINTR (swapon device))
|
||||
(restart-on-EINTR (swapon device
|
||||
#$(swap-space->flags-bit-mask
|
||||
swap)))
|
||||
#t)))))
|
||||
(stop #~(lambda _
|
||||
(let ((device #$device-lookup))
|
||||
|
||||
Reference in New Issue
Block a user