mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-10 08:30:39 +02:00
system: hurd: Add swap-services to hurd-default-essential-services.
* gnu/services/base.scm (swap-service-type): Do not include 'udev' requirement for the Hurd. Use system* with "swapon", "swapoff" for the Hurd. * gnu/system.scm (hurd-default-essential-services): Add swap-services. * gnu/services/base.scm (swap-service-type): Change-Id: I1d4d445c614921752dc84aa0dd6ff42cdbf62aa8
This commit is contained in:
parent
6dbfe1a118
commit
a16c94446e
2 changed files with 20 additions and 13 deletions
|
@ -44,6 +44,7 @@
|
||||||
#:autoload (guix diagnostics) (warning formatted-message &fix-hint)
|
#:autoload (guix diagnostics) (warning formatted-message &fix-hint)
|
||||||
#:autoload (guix i18n) (G_)
|
#:autoload (guix i18n) (G_)
|
||||||
#:use-module (guix combinators)
|
#:use-module (guix combinators)
|
||||||
|
#:use-module (guix utils)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu services admin)
|
#:use-module (gnu services admin)
|
||||||
#:use-module (gnu services shepherd)
|
#:use-module (gnu services shepherd)
|
||||||
|
@ -2677,7 +2678,7 @@ NAME-udev-hardware."
|
||||||
(with-imported-modules (source-module-closure '((gnu build file-systems)))
|
(with-imported-modules (source-module-closure '((gnu build file-systems)))
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
(provision (list (swap->shepherd-service-name swap)))
|
(provision (list (swap->shepherd-service-name swap)))
|
||||||
(requirement `(udev ,@requirements))
|
(requirement `(,@(if (target-hurd?) '() '(udev)) ,@requirements))
|
||||||
(documentation "Enable the given swap space.")
|
(documentation "Enable the given swap space.")
|
||||||
(modules `((gnu build file-systems)
|
(modules `((gnu build file-systems)
|
||||||
,@%default-modules))
|
,@%default-modules))
|
||||||
|
@ -2685,16 +2686,21 @@ NAME-udev-hardware."
|
||||||
(let ((device #$device-lookup))
|
(let ((device #$device-lookup))
|
||||||
(and device
|
(and device
|
||||||
(begin
|
(begin
|
||||||
(restart-on-EINTR (swapon device
|
#$(if (target-hurd?)
|
||||||
#$(if (swap-space? swap)
|
#~(system* "swapon" device)
|
||||||
(swap-space->flags-bit-mask
|
#~(restart-on-EINTR
|
||||||
swap)
|
(swapon device
|
||||||
0)))
|
#$(if (swap-space? swap)
|
||||||
|
(swap-space->flags-bit-mask
|
||||||
|
swap)
|
||||||
|
0))))
|
||||||
#t)))))
|
#t)))))
|
||||||
(stop #~(lambda _
|
(stop #~(lambda _
|
||||||
(let ((device #$device-lookup))
|
(let ((device #$device-lookup))
|
||||||
(when device
|
(when device
|
||||||
(restart-on-EINTR (swapoff device)))
|
#$(if (target-hurd?)
|
||||||
|
#~(system* "swapoff" device)
|
||||||
|
#~(restart-on-EINTR (swapoff device))))
|
||||||
#f)))
|
#f)))
|
||||||
(respawn? #f))))
|
(respawn? #f))))
|
||||||
(description "Turn on the virtual memory swap area.")))
|
(description "Turn on the virtual memory swap area.")))
|
||||||
|
|
|
@ -845,11 +845,11 @@ bookkeeping."
|
||||||
(let ((host-name (operating-system-host-name os))
|
(let ((host-name (operating-system-host-name os))
|
||||||
(hosts-file (%operating-system-hosts-file os))
|
(hosts-file (%operating-system-hosts-file os))
|
||||||
(entries (operating-system-directory-base-entries os)))
|
(entries (operating-system-directory-base-entries os)))
|
||||||
(list (service system-service-type entries)
|
(cons* (service system-service-type entries)
|
||||||
%boot-service
|
%boot-service
|
||||||
%hurd-startup-service
|
%hurd-startup-service
|
||||||
%activation-service
|
%activation-service
|
||||||
(service shepherd-root-service-type)
|
(service shepherd-root-service-type)
|
||||||
|
|
||||||
(service user-processes-service-type)
|
(service user-processes-service-type)
|
||||||
;; Make sure that privileged-programs activation script
|
;; Make sure that privileged-programs activation script
|
||||||
|
@ -873,7 +873,8 @@ bookkeeping."
|
||||||
(list `("hosts" ,hosts-file)))
|
(list `("hosts" ,hosts-file)))
|
||||||
(service hosts-service-type
|
(service hosts-service-type
|
||||||
(local-host-entries host-name)))
|
(local-host-entries host-name)))
|
||||||
(service profile-service-type (operating-system-packages os)))))
|
(service profile-service-type (operating-system-packages os))
|
||||||
|
(swap-services os))))
|
||||||
|
|
||||||
(define* (operating-system-services os)
|
(define* (operating-system-services os)
|
||||||
"Return all the services of OS, including \"essential\" services."
|
"Return all the services of OS, including \"essential\" services."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue