[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
63/80: installer: Do not use /tmp for holding the configuration.
From: |
John Darrington |
Subject: |
63/80: installer: Do not use /tmp for holding the configuration. |
Date: |
Tue, 3 Jan 2017 15:49:45 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 88c305ba47c11c167b98010012ff059c5a65d9c8
Author: John Darrington <address@hidden>
Date: Sat Dec 31 09:52:31 2016 +0100
installer: Do not use /tmp for holding the configuration.
* gnu/system/installer/configure.scm (tempdir): New variable.
---
gnu/system/installer/configure.scm | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/gnu/system/installer/configure.scm
b/gnu/system/installer/configure.scm
index a7cf3bf..1878956 100644
--- a/gnu/system/installer/configure.scm
+++ b/gnu/system/installer/configure.scm
@@ -25,6 +25,7 @@
#:use-module (gnu system installer partition-reader)
#:use-module (gnu system installer disks)
#:use-module (ice-9 format)
+ #:use-module (ice-9 rdelim)
#:use-module (ice-9 match)
#:use-module (ice-9 pretty-print)
#:use-module (gurses buttons)
@@ -32,6 +33,7 @@
#:use-module (guix store)
#:use-module (guix utils)
+
#:export (make-configure-page))
@@ -46,6 +48,29 @@
(define my-buttons `((save ,(N_ "_Save") #t)
(back ,(N_ "_Back") #t)))
+
+;; Kludge! For testing.
+(define tempdir
+ (if
+ ;; Try to infer whether we are running the installation image or
+ ;; if we are just testing.
+ (and (file-exists? "/etc/issue")
+ (let loop ((p (open "/etc/issue" O_RDONLY)))
+ (let ((l (read-line p)))
+ (cond
+ ((eof-object? l)
+ (close p)
+ #f)
+ ((string-contains l "installation image")
+ (close p)
+ #t)
+ (else
+ (loop p))))))
+ ;; In the installer image we cannot use /tmp because the cow-store
+ ;; does not play nicely with it. Bug 25286 refers.
+ ""
+ "/tmp"))
+
(define (configure-page-key-handler page ch)
(let ((nav (page-datum page 'navigation))
@@ -81,7 +106,8 @@
((buttons-key-matches-symbol? nav ch 'save)
;; Write the configuration and set the file name
- (let ((cfg-port (mkstemp! (string-copy "/tmp/guix-config-XXXXXX"))))
+ (let ((cfg-port (mkstemp! (string-copy
+ (string-append tempdir
"/guix-config-XXXXXX")))))
(generate-guix-config cfg-port)
(set! config-file (port-filename cfg-port))
(close-port cfg-port))
- 71/80: installer: Make setting up of the network a prerequisite., (continued)
- 71/80: installer: Make setting up of the network a prerequisite., John Darrington, 2017/01/03
- 55/80: installer: Close unused ports in pipe-cmd., John Darrington, 2017/01/03
- 72/80: installer: Ensure that all mount points are absolute paths., John Darrington, 2017/01/03
- 70/80: installer: Change essid --> wireless., John Darrington, 2017/01/03
- 52/80: installer: Fix bug where window-pipe did not return the proper exit status., John Darrington, 2017/01/03
- 78/80: installer: Rename "file-browser" -> "time-zone"., John Darrington, 2017/01/03
- 75/80: installer: Add predicate for the network task., John Darrington, 2017/01/03
- 50/80: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2017/01/03
- 54/80: installer: Improve install page., John Darrington, 2017/01/03
- 62/80: installer: Use global variable instead of string literal for "/gnu"., John Darrington, 2017/01/03
- 63/80: installer: Do not use /tmp for holding the configuration.,
John Darrington <=
- 56/80: installer: Replace spawned mount command with the mount syscall., John Darrington, 2017/01/03
- 53/80: installer: Replace "%temporary-configuration-file-port" with "config-file"., John Darrington, 2017/01/03
- 51/80: installer: Use consistent window heights., John Darrington, 2017/01/03
- 15/80: installer: Add procedures to replace car/cdr since these are frounded upon by Guile gurus., John Darrington, 2017/01/03
- 65/80: installer: Add flags to indicate network interface status., John Darrington, 2017/01/03
- 66/80: installer: Format configuration to fix width of window., John Darrington, 2017/01/03
- 80/80: installer: Use --fallback when installing., John Darrington, 2017/01/03
- 69/80: installer: Add page with which the wifi password can be entered., John Darrington, 2017/01/03
- 60/80: installer: Change N_ from a procedure to a macro., John Darrington, 2017/01/03
- 67/80: installer: Do not allow forms to set the cursor visibility., John Darrington, 2017/01/03