mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
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.
This commit is contained in:
parent
9529f7850e
commit
98f035482f
2 changed files with 19 additions and 5 deletions
|
@ -314,6 +314,7 @@ (define installer-builder
|
||||||
guile-json guile-git guix)
|
guile-json guile-git guix)
|
||||||
(with-imported-modules `(,@(source-module-closure
|
(with-imported-modules `(,@(source-module-closure
|
||||||
`(,@modules
|
`(,@modules
|
||||||
|
(gnu services herd)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
#:select? module-to-import?)
|
#:select? module-to-import?)
|
||||||
((guix config) => ,(make-config.scm)))
|
((guix config) => ,(make-config.scm)))
|
||||||
|
@ -363,10 +364,20 @@ (define installer-builder
|
||||||
|
|
||||||
(catch #t
|
(catch #t
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
(define results
|
||||||
(run-installer-steps
|
(run-installer-steps
|
||||||
#:rewind-strategy 'menu
|
#:rewind-strategy 'menu
|
||||||
#:menu-proc (installer-menu-page current-installer)
|
#:menu-proc (installer-menu-page current-installer)
|
||||||
#:steps steps))
|
#: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)
|
(const #f)
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(let ((error-file "/tmp/last-installer-error"))
|
(let ((error-file "/tmp/last-installer-error"))
|
||||||
|
|
|
@ -56,7 +56,10 @@ (define (run-install-success-page)
|
||||||
(G_ "Reboot")
|
(G_ "Reboot")
|
||||||
(G_ "Congratulations! Installation is now complete. \
|
(G_ "Congratulations! Installation is now complete. \
|
||||||
You may remove the device containing the installation image and \
|
You may remove the device containing the installation image and \
|
||||||
press the button to reboot.")))
|
press the button to reboot."))
|
||||||
|
|
||||||
|
;; Return success so that the installer happily reboots.
|
||||||
|
'success)
|
||||||
|
|
||||||
(define (run-install-failed-page)
|
(define (run-install-failed-page)
|
||||||
(choice-window
|
(choice-window
|
||||||
|
|
Loading…
Reference in a new issue