[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/21: installer: Use a "hard" method of rebooting. Do not rely on sheph
From: |
John Darrington |
Subject: |
06/21: installer: Use a "hard" method of rebooting. Do not rely on shepherd. |
Date: |
Sun, 29 Jan 2017 07:35:01 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 5189573ab1eb7c8b53b00c2d59d60e68c6f4a6bf
Author: John Darrington <address@hidden>
Date: Tue Jan 24 08:13:39 2017 +0100
installer: Use a "hard" method of rebooting. Do not rely on shepherd.
* gnu/system/installer/install.scm (force-reboot): New procedure.
---
gnu/system/installer/install.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/gnu/system/installer/install.scm b/gnu/system/installer/install.scm
index 4753ae4..1811701 100644
--- a/gnu/system/installer/install.scm
+++ b/gnu/system/installer/install.scm
@@ -52,6 +52,28 @@
(reboot ,(M_ "_Reboot") #t)
(cancel ,(M_ "Canc_el") #t)))
+
+;; We have to use this "hard" way of rebooting, because
+;; we have instructed the user to remove the device which
+;; contains our root filesystem
+(define (force-reboot)
+ (catch
+ #t
+ (lambda ()
+ (let ((p (open "/proc/sys/kernel/sysrq" O_WRONLY)))
+ (display "1\n" p)
+ (close p))
+
+ (let ((p (open "/proc/sysrq-trigger" O_WRONLY)))
+ (display "b\n" p)
+ (close p)))
+
+ (lambda (key . args)
+ #f)
+ (lambda (key subr message args . rest)
+ #f)))
+
+
(define (install-page-key-handler page ch)
(let ((nav (page-datum page 'navigation))
(config-window (page-datum page 'config-window)))
@@ -80,7 +102,7 @@
(page-leave))
((buttons-key-matches-symbol? nav ch 'reboot)
- (system* "reboot"))
+ (force-reboot))
((buttons-key-matches-symbol? nav ch 'continue)
(let ((target "/target")
- 01/21: installer: Delete unused procedure "justify"., (continued)
- 01/21: installer: Delete unused procedure "justify"., John Darrington, 2017/01/29
- 20/21: gurses: Add new procedure "word-endings"., John Darrington, 2017/01/29
- 14/21: gurses: Add predicate to test if a complex char is blank., John Darrington, 2017/01/29
- 12/21: gurses: Avoid one usage of car and cdr., John Darrington, 2017/01/29
- 15/21: gurses: Avoid one more use of car and cdr., John Darrington, 2017/01/29
- 13/21: gurses: xchar->char: New procedure., John Darrington, 2017/01/29
- 19/21: installer: Support WEP encrypted wireless., John Darrington, 2017/01/29
- 16/21: gurses: Avoid yet another use of car and cdr., John Darrington, 2017/01/29
- 11/21: installer: Fix the key map option., John Darrington, 2017/01/29
- 18/21: gurses: In paragraph-format avoid use of car and cdr., John Darrington, 2017/01/29
- 06/21: installer: Use a "hard" method of rebooting. Do not rely on shepherd.,
John Darrington <=
- 10/21: installer: Allow file system specifications to be removed., John Darrington, 2017/01/29
- 17/21: gurses: Use match instead of car/cdr in line-split., John Darrington, 2017/01/29
- 21/21: gurses: Reimplement pad-complex-string., John Darrington, 2017/01/29