aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2020-09-23 14:53:44 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2020-09-23 14:53:44 +0200
commit1828958db52d0019a7f3d763b07e64f78afa2cbf (patch)
tree8bdff27c5b3dc088d923e91a14a38f6a6b9fa661 /gnu/installer
parent7e463dd16b7e273011f0beafa57a89fa2d525f8b (diff)
parent23744435613aa040beacc61a0825cc72280da80a (diff)
downloadguix-1828958db52d0019a7f3d763b07e64f78afa2cbf.tar.gz
guix-1828958db52d0019a7f3d763b07e64f78afa2cbf.zip
Merge branch 'wip-lisp' into staging
Diffstat (limited to 'gnu/installer')
-rw-r--r--gnu/installer/final.scm19
1 files changed, 16 insertions, 3 deletions
diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 11143b2adb..fc0b7803fa 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -135,6 +135,20 @@ USERS."
(_ #f))))))
pids)))
+(define (call-with-mnt-container thunk)
+ "This is a variant of call-with-container. Run THUNK in a new container
+process, within a separate MNT namespace. The container is not jailed so that
+it can interact with the rest of the system."
+ (let ((pid (run-container "/" '() '(mnt) 1 thunk)))
+ ;; Catch SIGINT and kill the container process.
+ (sigaction SIGINT
+ (lambda (signum)
+ (false-if-exception
+ (kill pid SIGKILL))))
+
+ (match (waitpid pid)
+ ((_ . status) status))))
+
(define* (install-system locale #:key (users '()))
"Create /etc/shadow and /etc/passwd on the installation target for USERS.
Start COW-STORE service on target directory and launch guix install command in
@@ -181,7 +195,7 @@ or #f. Return #t on success and #f on failure."
;; To avoid this situation, mount the store overlay inside a container,
;; and run the installation from within that container.
(zero?
- (call-with-container '()
+ (call-with-mnt-container
(lambda ()
(dynamic-wind
(lambda ()
@@ -218,5 +232,4 @@ or #f. Return #t on success and #f on failure."
;; Finally umount the cow-store and exit the container.
(unmount-cow-store (%installer-target-dir) backing-directory)
- (assert-exit ret))))
- #:namespaces '(mnt)))))
+ (assert-exit ret))))))))