[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
56/197: installer: Do not use /tmp for holding the configuration.
From: |
Danny Milosavljevic |
Subject: |
56/197: installer: Do not use /tmp for holding the configuration. |
Date: |
Mon, 3 Jul 2017 20:37:00 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 11f0827769b4bb8946294c69d352907ce724b74e
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))
- 30/197: installer: Write the configuration to a temporary file., (continued)
- 30/197: installer: Write the configuration to a temporary file., Danny Milosavljevic, 2017/07/03
- 24/197: installer: Add a new menu to configure wireless interfaces., Danny Milosavljevic, 2017/07/03
- 49/197: installer: Replace spawned mount command with the mount syscall., Danny Milosavljevic, 2017/07/03
- 44/197: installer: Use consistent window heights., Danny Milosavljevic, 2017/07/03
- 52/197: installer: Prevent the user specifying the same mount point twice., Danny Milosavljevic, 2017/07/03
- 51/197: installer: Allow users to remove mount points during configuration., Danny Milosavljevic, 2017/07/03
- 14/197: installer: Add procedures to replace car/cdr since these are frounded upon by Guile gurus., Danny Milosavljevic, 2017/07/03
- 55/197: installer: Use global variable instead of string literal for "/gnu"., Danny Milosavljevic, 2017/07/03
- 54/197: installer: Change the order of the filesystem task conditions., Danny Milosavljevic, 2017/07/03
- 60/197: installer: Do not allow forms to set the cursor visibility., Danny Milosavljevic, 2017/07/03
- 56/197: installer: Do not use /tmp for holding the configuration.,
Danny Milosavljevic <=
- 66/197: installer: Add option to final page to reboot the system., Danny Milosavljevic, 2017/07/03
- 71/197: installer: Add confidence indicator., Danny Milosavljevic, 2017/07/03
- 67/197: installer: Add predicate for the network task., Danny Milosavljevic, 2017/07/03
- 74/197: installer: Remove explicit calls to curs-set from pages., Danny Milosavljevic, 2017/07/03
- 64/197: installer: Make setting up of the network a prerequisite., Danny Milosavljevic, 2017/07/03
- 80/197: installer: Ignore case in button accelerators., Danny Milosavljevic, 2017/07/03
- 86/197: installer: slurp: Ignore blank lines in output., Danny Milosavljevic, 2017/07/03
- 76/197: installer: New procedure "page-leave"., Danny Milosavljevic, 2017/07/03
- 84/197: installer: Use guix build syscalls module for network interrogation., Danny Milosavljevic, 2017/07/03
- 94/197: installer: Add the notion of uuids to prospective filesystems., Danny Milosavljevic, 2017/07/03