summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-05-10 22:29:10 +0200
committerLudovic Courtès <ludo@gnu.org>2019-05-15 16:36:21 +0200
commit9fcfe30d283cd7d36c6e292ea1235eb24307b003 (patch)
tree8e1199097f7f7e285d8d41f17d89c0b1cf6d175b
parent3f9bed04f031a4d4f8d3b6dc0a4de42b0c628496 (diff)
system: Add 'operating-system-with-gc-roots'.
* gnu/tests/install.scm (operating-system-with-gc-roots): Move to... * gnu/system.scm (operating-system-with-gc-roots): ... here. New procedure.
-rw-r--r--gnu/system.scm12
-rw-r--r--gnu/tests/install.scm11
2 files changed, 12 insertions, 11 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 2c4ca55ffcb..01be1243fea 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -109,6 +109,7 @@
109 operating-system-boot-script 109 operating-system-boot-script
110 110
111 system-linux-image-file-name 111 system-linux-image-file-name
112 operating-system-with-gc-roots
112 113
113 boot-parameters 114 boot-parameters
114 boot-parameters? 115 boot-parameters?
@@ -519,6 +520,17 @@ bookkeeping."
519 (append (operating-system-user-services os) 520 (append (operating-system-user-services os)
520 (operating-system-essential-services os)))) 521 (operating-system-essential-services os))))
521 522
523(define (operating-system-with-gc-roots os roots)
524 "Return a variant of OS where ROOTS are registered as GC roots."
525 (operating-system
526 (inherit os)
527
528 ;; We use this procedure for the installation OS, which already defines GC
529 ;; roots. Add ROOTS to those.
530 (services (cons (simple-service 'extra-root
531 gc-root-service-type roots)
532 (operating-system-user-services os)))))
533
522 534
523;;; 535;;;
524;;; /etc. 536;;; /etc.
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 430a1023785..7b5ee18505e 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -123,17 +123,6 @@
123 (inherit config) 123 (inherit config)
124 (guix (current-guix)))))))) 124 (guix (current-guix))))))))
125 125
126(define (operating-system-with-gc-roots os roots)
127 "Return a variant of OS where ROOTS are registered as GC roots."
128 (operating-system
129 (inherit os)
130
131 ;; We use this procedure for the installation OS, which already defines GC
132 ;; roots. Add ROOTS to those.
133 (services (cons (simple-service 'extra-root
134 gc-root-service-type roots)
135 (operating-system-user-services os)))))
136
137 126
138(define MiB (expt 2 20)) 127(define MiB (expt 2 20))
139 128