[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20/21: installer: Do not use /tmp for holding the configuration.
From: |
John Darrington |
Subject: |
20/21: installer: Do not use /tmp for holding the configuration. |
Date: |
Sat, 31 Dec 2016 14:54:18 +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))
- branch wip-installer updated (d654694 -> d5eb580), John Darrington, 2016/12/31
- 03/21: installer: Add inetutils bin directory to PATH., John Darrington, 2016/12/31
- 05/21: installer: Enable scrolling in the installation window., John Darrington, 2016/12/31
- 06/21: installer: Wrap installer in (catch #t ...), John Darrington, 2016/12/31
- 16/21: installer: Prevent the user specifying the same mount point twice., John Darrington, 2016/12/31
- 04/21: installer: Turn off kernel ring messages to console., John Darrington, 2016/12/31
- 01/21: installer: Add wireless-tools bin directory to PATH., John Darrington, 2016/12/31
- 02/21: installer: Replace an instance of cdr with match., John Darrington, 2016/12/31
- 12/21: installer: Close unused ports in pipe-cmd., John Darrington, 2016/12/31
- 08/21: installer: Use consistent window heights., John Darrington, 2016/12/31
- 20/21: installer: Do not use /tmp for holding the configuration.,
John Darrington <=
- 14/21: installer: Issue message to user on failure of filesystems task., John Darrington, 2016/12/31
- 07/21: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2016/12/31
- 13/21: installer: Replace spawned mount command with the mount syscall., John Darrington, 2016/12/31
- 11/21: installer: Improve install page., John Darrington, 2016/12/31
- 10/21: installer: Replace "%temporary-configuration-file-port" with "config-file"., John Darrington, 2016/12/31
- 19/21: installer: Use global variable instead of string literal for "/gnu"., John Darrington, 2016/12/31
- 17/21: installer: Change N_ from a procedure to a macro., John Darrington, 2016/12/31
- 18/21: installer: Change the order of the filesystem task conditions., John Darrington, 2016/12/31
- 15/21: installer: Allow users to remove mount points during configuration., John Darrington, 2016/12/31
- 21/21: installer: Add a console-keymap service., John Darrington, 2016/12/31