aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-26 14:08:39 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-26 14:19:36 +0200
commit98f035482fcb32683429a474f4071bd530c3c1b8 (patch)
tree78bcfd0710a9ddb70baf2734c3f26e206f474c68 /gnu/installer.scm
parent9529f7850e3ae91cce70620e684fc6d0dc25e815 (diff)
downloadpatches-98f035482fcb32683429a474f4071bd530c3c1b8.tar
patches-98f035482fcb32683429a474f4071bd530c3c1b8.tar.gz
installer: Actually reboot when the user presses "Reboot."
* gnu/installer/newt/final.scm (run-install-success-page): Return 'success. * gnu/installer.scm (installer-program): Check the result of the 'final step and reboot upon success.
Diffstat (limited to 'gnu/installer.scm')
-rw-r--r--gnu/installer.scm19
1 files changed, 15 insertions, 4 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm
index dfb0c9d0db..fe2841397e 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -314,6 +314,7 @@ selected keymap."
guile-json guile-git guix)
(with-imported-modules `(,@(source-module-closure
`(,@modules
+ (gnu services herd)
(guix build utils))
#:select? module-to-import?)
((guix config) => ,(make-config.scm)))
@@ -363,10 +364,20 @@ selected keymap."
(catch #t
(lambda ()
- (run-installer-steps
- #:rewind-strategy 'menu
- #:menu-proc (installer-menu-page current-installer)
- #:steps steps))
+ (define results
+ (run-installer-steps
+ #:rewind-strategy 'menu
+ #:menu-proc (installer-menu-page current-installer)
+ #:steps steps))
+
+ (match (result-step results 'final)
+ ('success
+ ;; We did it! Let's reboot!
+ (sync)
+ (stop-service 'root))
+ (_ ;installation failed
+ ;; TODO: Honor the result of 'run-install-failed-page'.
+ #f)))
(const #f)
(lambda (key . args)
(let ((error-file "/tmp/last-installer-error"))