[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
95/197: installer: Add a predicate to ensure the partitions have been fo
From: |
Danny Milosavljevic |
Subject: |
95/197: installer: Add a predicate to ensure the partitions have been formatted. |
Date: |
Mon, 3 Jul 2017 20:37:06 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit ee412f64a5f58a5c35d8ee2b0e96eba692dd4fae
Author: John Darrington <address@hidden>
Date: Sat Jan 14 21:46:29 2017 +0100
installer: Add a predicate to ensure the partitions have been formatted.
* gnu/system/installer/format.scm (device-fs-uuid,
filesystems-are-current?):
New procedures.
* gnu/system/installer/guixsd-installer.scm (main-options): Update
prerequisites
for install. Update predicate for format.
---
gnu/system/installer/format.scm | 24 +++++++++++++++++++++++-
gnu/system/installer/guixsd-installer.scm | 4 ++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/gnu/system/installer/format.scm b/gnu/system/installer/format.scm
index 2f965cc..73ab172 100644
--- a/gnu/system/installer/format.scm
+++ b/gnu/system/installer/format.scm
@@ -25,10 +25,32 @@
#:use-module (ice-9 match)
#:use-module (gurses buttons)
#:use-module (ncurses curses)
-
+ #:use-module (srfi srfi-1)
+
+ #:export (filesystems-are-current?)
#:export (make-format-page))
+(define (device-fs-uuid dev)
+ "Retrieve the UUID of the filesystem on DEV, where DEV is the name of the
+device such as /dev/sda1"
+ (car (assoc-ref
+ (slurp (string-append "blkid -o export " dev)
+ (lambda (x)
+ (string-split x #\=))) "UUID")))
+
+(define (filesystems-are-current?)
+ "Returns #t iff there is at least one mount point AND all mount-points' uuids
+match those uuids read from the respective partitions"
+ (and (not (null? mount-points))
+ (fold (lambda (mp prev)
+ (and prev
+ (match mp
+ ((dev . (? file-system-spec? fss))
+ (equal? (device-fs-uuid dev)
+ (file-system-spec-uuid fss))))))
+ #t mount-points)))
+
(define (make-format-page parent title)
(let ((page (make-page (page-surface parent)
title
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index 1be2bea..8e8c70f 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -89,7 +89,7 @@
(format . ,(make-task format-menu-title
'(filesystems)
- (lambda () #f)
+ filesystems-are-current?
(lambda (page)
(make-format-page
page
@@ -144,7 +144,7 @@
generate-menu-title))))
(install . ,(make-task installation-menu-title
- '(network generate)
+ '(network generate format)
(lambda () #f)
(lambda (page)
(make-install-page
- 82/197: installer: Rename 'file-browser.scm' to 'key-map.scm'., (continued)
- 82/197: installer: Rename 'file-browser.scm' to 'key-map.scm'., Danny Milosavljevic, 2017/07/03
- 63/197: installer: Change essid --> wireless., Danny Milosavljevic, 2017/07/03
- 70/197: installer: Rename "file-browser" -> "time-zone"., Danny Milosavljevic, 2017/07/03
- 81/197: installer: Make all windows with ports scrollable., Danny Milosavljevic, 2017/07/03
- 62/197: installer: Add page with which the wifi password can be entered., Danny Milosavljevic, 2017/07/03
- 75/197: installer: Remove pointless calls to delwin., Danny Milosavljevic, 2017/07/03
- 87/197: installer: Minor cleanup., Danny Milosavljevic, 2017/07/03
- 79/197: installer: Rename "Back" buttons to "Cancel"., Danny Milosavljevic, 2017/07/03
- 98/197: installer: Correct bug detecting a wireless interface., Danny Milosavljevic, 2017/07/03
- 91/197: installer: Add callback parameter for forms., Danny Milosavljevic, 2017/07/03
- 95/197: installer: Add a predicate to ensure the partitions have been formatted.,
Danny Milosavljevic <=
- 102/197: installer: Correct bug where the timezone page returned to the wrong page., Danny Milosavljevic, 2017/07/03
- 119/197: gurses: Allow menu update to work for panel windows., Danny Milosavljevic, 2017/07/03
- 103/197: installer: Avoid exception when the device to format cannot be found., Danny Milosavljevic, 2017/07/03
- 116/197: installer: Fix bug in config generation., Danny Milosavljevic, 2017/07/03
- 105/197: installer: Extend the 'file-system' concept to include swap spaces., Danny Milosavljevic, 2017/07/03
- 83/197: installer: "Setup" --> "Set up", Danny Milosavljevic, 2017/07/03
- 92/197: installer: Remove mkfs capability from mount points page., Danny Milosavljevic, 2017/07/03
- 118/197: installer: Distinguish between Wifi encryption methods., Danny Milosavljevic, 2017/07/03
- 127/197: gurses: Remove box from form popup window., Danny Milosavljevic, 2017/07/03
- 123/197: installer: Add a popup window for forms which have multiple choice fields., Danny Milosavljevic, 2017/07/03