diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 18:44:17 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-11-02 22:25:11 +0100 |
| commit | d62e201cfd0f1e48c14586489d0e2b80ce943d4f (patch) | |
| tree | d6c4989b36b54f154f21363ac72bd9896729f2de /doc | |
| parent | 3a391e68dafe81560d3e4936a1ec5ac3b06d43bb (diff) | |
services: Add 'system-service-type'.
* gnu/services.scm (system-derivation): New procedure.
(system-service-type): New variable.
(boot-script-entry): New procedure.
(boot-service-type): Extend SYSTEM-SERVICE-TYPE.
(etc-entry): New procedure.
(etc-service-type): Extend SYSTEM-SERVICE-TYPE.
(fold-services): Change default #:target-type to SYSTEM-SERVICE-TYPE.
* gnu/system.scm (operating-system-directory-base-entries): New procedure.
(essential-services): Use it. Add an instance of
SYSTEM-SERVICE-TYPE.
(operating-system-boot-script): Pass #:target-type to 'fold-services'.
(operating-system-derivation): Rewrite in terms of 'fold-services'.
* gnu/system/linux-container.scm (system-container): Remove.
(container-script): Use 'operating-system-derivation'.
* guix/scripts/system.scm (export-extension-graph): Replace
BOOT-SERVICE-TYPE by SYSTEM-SERVICE-TYPE.
* doc/images/service-graph.dot: Add 'system' node and edges.
* doc/guix.texi (Service Composition): Mention SYSTEM-SERVICE-TYPE.
(Service Reference): Document it. Update 'fold-services'
documentation.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 26 | ||||
| -rw-r--r-- | doc/images/service-graph.dot | 5 |
2 files changed, 22 insertions, 9 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 74e0977db50..6ab98deef3a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -7589,8 +7589,11 @@ as arrows, a typical system might provide something like this: | |||
| 7589 | 7589 | ||
| 7590 | @image{images/service-graph,,5in,Typical service extension graph.} | 7590 | @image{images/service-graph,,5in,Typical service extension graph.} |
| 7591 | 7591 | ||
| 7592 | At the bottom, we see the @dfn{boot service}, which produces the boot | 7592 | @cindex system service |
| 7593 | script that is executed at boot time from the initial RAM disk. | 7593 | At the bottom, we see the @dfn{system service}, which produces the |
| 7594 | directory containing everything to run and boot the system, as returned | ||
| 7595 | by the @command{guix system build} command. @xref{Service Reference}, | ||
| 7596 | to learn about the other service types shown here. | ||
| 7594 | @xref{system-extension-graph, the @command{guix system extension-graph} | 7597 | @xref{system-extension-graph, the @command{guix system extension-graph} |
| 7595 | command}, for information on how to generate this representation for a | 7598 | command}, for information on how to generate this representation for a |
| 7596 | particular operating system definition. | 7599 | particular operating system definition. |
| @@ -7853,12 +7856,14 @@ Return true if @var{obj} is a service extension. | |||
| 7853 | 7856 | ||
| 7854 | At the core of the service abstraction lies the @code{fold-services} | 7857 | At the core of the service abstraction lies the @code{fold-services} |
| 7855 | procedure, which is responsible for ``compiling'' a list of services | 7858 | procedure, which is responsible for ``compiling'' a list of services |
| 7856 | down to a single boot script. In essence, it propagates service | 7859 | down to a single directory that contains everything needed to boot and |
| 7857 | extensions down the service graph, updating each node parameters on the | 7860 | run the system---the directory shown by the @command{guix system build} |
| 7858 | way, until it reaches the root node. | 7861 | command (@pxref{Invoking guix system}). In essence, it propagates |
| 7862 | service extensions down the service graph, updating each node parameters | ||
| 7863 | on the way, until it reaches the root node. | ||
| 7859 | 7864 | ||
| 7860 | @deffn {Scheme Procedure} fold-services @var{services} @ | 7865 | @deffn {Scheme Procedure} fold-services @var{services} @ |
| 7861 | [#:target-type @var{boot-service-type}] | 7866 | [#:target-type @var{system-service-type}] |
| 7862 | Fold @var{services} by propagating their extensions down to the root of | 7867 | Fold @var{services} by propagating their extensions down to the root of |
| 7863 | type @var{target-type}; return the root service adjusted accordingly. | 7868 | type @var{target-type}; return the root service adjusted accordingly. |
| 7864 | @end deffn | 7869 | @end deffn |
| @@ -7866,9 +7871,14 @@ type @var{target-type}; return the root service adjusted accordingly. | |||
| 7866 | Lastly, the @code{(gnu services)} module also defines several essential | 7871 | Lastly, the @code{(gnu services)} module also defines several essential |
| 7867 | service types, some of which are listed below. | 7872 | service types, some of which are listed below. |
| 7868 | 7873 | ||
| 7874 | @defvr {Scheme Variable} system-service-type | ||
| 7875 | This is the root of the service graph. It produces the system directory | ||
| 7876 | as returned by the @command{guix system build} command. | ||
| 7877 | @end defvr | ||
| 7878 | |||
| 7869 | @defvr {Scheme Variable} boot-service-type | 7879 | @defvr {Scheme Variable} boot-service-type |
| 7870 | The type of the ``boot service'', which is the root of the service | 7880 | The type of the ``boot service'', which produces the @dfn{boot script}. |
| 7871 | graph. | 7881 | The boot script is what the initial RAM disk runs when booting. |
| 7872 | @end defvr | 7882 | @end defvr |
| 7873 | 7883 | ||
| 7874 | @defvr {Scheme Variable} etc-service-type | 7884 | @defvr {Scheme Variable} etc-service-type |
diff --git a/doc/images/service-graph.dot b/doc/images/service-graph.dot index 3397b878e96..04f231bb098 100644 --- a/doc/images/service-graph.dot +++ b/doc/images/service-graph.dot | |||
| @@ -4,7 +4,8 @@ digraph "Service Type Dependencies" { | |||
| 4 | etc [shape = box, fontname = Helvetica]; | 4 | etc [shape = box, fontname = Helvetica]; |
| 5 | accounts [shape = box, fontname = Helvetica]; | 5 | accounts [shape = box, fontname = Helvetica]; |
| 6 | activation [shape = box, fontname = Helvetica]; | 6 | activation [shape = box, fontname = Helvetica]; |
| 7 | boot [shape = house, fontname = Helvetica]; | 7 | boot [shape = box, fontname = Helvetica]; |
| 8 | system [shape = house, fontname = Helvetica]; | ||
| 8 | lshd -> dmd; | 9 | lshd -> dmd; |
| 9 | lshd -> pam; | 10 | lshd -> pam; |
| 10 | udev -> dmd; | 11 | udev -> dmd; |
| @@ -32,4 +33,6 @@ digraph "Service Type Dependencies" { | |||
| 32 | guix -> dmd; | 33 | guix -> dmd; |
| 33 | guix -> activation; | 34 | guix -> activation; |
| 34 | guix -> accounts; | 35 | guix -> accounts; |
| 36 | boot -> system; | ||
| 37 | etc -> system; | ||
| 35 | } | 38 | } |
