summaryrefslogtreecommitdiff
path: root/gnu/installer
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-10-08 19:24:34 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-10-08 19:24:34 +0200
commitd1f3b333e6176a7879ab3742bbebb2a99f61a528 (patch)
tree8bd82ce68bd2534a48bf13c7256997f82dd1b3f4 /gnu/installer
parente01d384efcdaf564bbb221e43b81e087c8e2af06 (diff)
parent861907f01efb1cae7f260e8cb7b991d5034a486a (diff)
downloadguix-patches-d1f3b333e6176a7879ab3742bbebb2a99f61a528.tar
guix-patches-d1f3b333e6176a7879ab3742bbebb2a99f61a528.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/installer')
-rw-r--r--gnu/installer/newt/page.scm9
-rw-r--r--gnu/installer/newt/partition.scm15
-rw-r--r--gnu/installer/newt/user.scm7
-rw-r--r--gnu/installer/newt/wifi.scm4
-rw-r--r--gnu/installer/parted.scm48
5 files changed, 22 insertions, 61 deletions
diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm
index 728721c08f..630efde9cc 100644
--- a/gnu/installer/newt/page.scm
+++ b/gnu/installer/newt/page.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,7 +76,7 @@ this page to TITLE."
#:key
(allow-empty-input? #f)
(default-text #f)
- (input-hide-checkbox? #f)
+ (input-visibility-checkbox? #f)
(input-field-width 40)
(input-flags 0))
"Run a page to prompt user for an input. The given TEXT will be displayed
@@ -88,8 +89,8 @@ input box, such as FLAG-PASSWORD."
input-field-width
#:flags FLAG-BORDER))
(input-visible-cb
- (make-checkbox -1 -1 (G_ "Hide") #\x "x "))
- (input-flags* (if input-hide-checkbox?
+ (make-checkbox -1 -1 (G_ "Show") #\space "x "))
+ (input-flags* (if input-visibility-checkbox?
(logior FLAG-PASSWORD FLAG-SCROLL
input-flags)
input-flags))
@@ -102,7 +103,7 @@ input box, such as FLAG-PASSWORD."
(apply
horizontal-stacked-grid
GRID-ELEMENT-COMPONENT input-entry
- `(,@(if input-hide-checkbox?
+ `(,@(if input-visibility-checkbox?
(list GRID-ELEMENT-COMPONENT input-visible-cb)
'())))
GRID-ELEMENT-COMPONENT ok-button))
diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm
index cd9d46316a..74e9473171 100644
--- a/gnu/installer/newt/partition.scm
+++ b/gnu/installer/newt/partition.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -159,14 +159,14 @@ USER-PARTITIONS list. Return this list with password fields filled-in."
(format #f (G_ "Please enter the password for the \
encryption of partition ~a (label: ~a).") file-name crypt-label)
(G_ "Password required")
- #:input-hide-checkbox? #t)))
+ #:input-visibility-checkbox? #t)))
(password-confirm-page
(lambda ()
(run-input-page
(format #f (G_ "Please confirm the password for the \
encryption of partition ~a (label: ~a).") file-name crypt-label)
(G_ "Password confirmation required")
- #:input-hide-checkbox? #t))))
+ #:input-visibility-checkbox? #t))))
(if crypt-label
(let loop ()
(let ((password (password-page))
@@ -587,7 +587,6 @@ edit it."
disks))
(new-user-partitions
(remove-user-partition-by-disk user-partitions item)))
- (disk-destroy item)
`((disks . ,(cons new-disk other-disks))
(user-partitions . ,new-user-partitions)))
`((disks . ,disks)
@@ -625,7 +624,7 @@ edit it."
info-text)))
(case result
((1)
- (disk-delete-all item)
+ (disk-remove-all-partitions item)
`((disks . ,disks)
(user-partitions
. ,(remove-user-partition-by-disk user-partitions item))))
@@ -649,7 +648,7 @@ edit it."
(let ((new-user-partitions
(remove-user-partition-by-partition user-partitions
item)))
- (disk-delete-partition disk item)
+ (disk-remove-partition* disk item)
`((disks . ,disks)
(user-partitions . ,new-user-partitions))))
(else
@@ -696,9 +695,7 @@ by pressing the Exit button.~%~%")))
#f))
(check-user-partitions user-partitions))))
(if user-partitions-ok?
- (begin
- (for-each (cut disk-destroy <>) disks)
- user-partitions)
+ user-partitions
(run-disk-page disks user-partitions
#:guided? guided?)))
(let* ((result-disks (assoc-ref result 'disks))
diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm
index dab805198f..b747886c55 100644
--- a/gnu/installer/newt/user.scm
+++ b/gnu/installer/newt/user.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -55,7 +56,7 @@ REAL-NAME, and HOME-DIRECTORY as the initial values in the form."
(entry-home-directory (make-entry -1 -1 entry-width
#:initial-value home-directory))
(password-visible-cb
- (make-checkbox -1 -1 (G_ "Hide") #\x "x "))
+ (make-checkbox -1 -1 (G_ "Show") #\space "x "))
(entry-password (make-entry -1 -1 entry-width
#:flags (logior FLAG-PASSWORD
FLAG-SCROLL)))
@@ -156,7 +157,7 @@ a thunk, if the confirmation doesn't match PASSWORD, and return its result."
(run-input-page (G_ "Please confirm the password.")
(G_ "Password confirmation required")
#:allow-empty-input? #t
- #:input-hide-checkbox? #t))
+ #:input-visibility-checkbox? #t))
(if (string=? password confirmation)
password
@@ -173,7 +174,7 @@ a thunk, if the confirmation doesn't match PASSWORD, and return its result."
(run-input-page (G_ "Please choose a password for the system \
administrator (\"root\").")
(G_ "System administrator password")
- #:input-hide-checkbox? #t))
+ #:input-visibility-checkbox? #t))
(confirm-password password run-root-password-page))
diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm
index 1cb2ef2df3..3fd5756b99 100644
--- a/gnu/installer/newt/wifi.scm
+++ b/gnu/installer/newt/wifi.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
+;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -88,7 +89,8 @@ nmc_wifi_strength_bars."
(define (run-wifi-password-page)
"Run a page prompting user for a password and return it."
(run-input-page (G_ "Please enter the wifi password.")
- (G_ "Password required")))
+ (G_ "Password required")
+ #:input-visibility-checkbox? #t))
(define (run-wrong-password-page service-name)
"Run a page to inform user of a wrong password input."
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index 682e233d9f..3439f211e2 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -64,13 +64,7 @@
user-partition-parted-object
find-esp-partition
- data-partition?
- metadata-partition?
- freespace-partition?
small-freespace-partition?
- normal-partition?
- extended-partition?
- logical-partition?
esp-partition?
boot-partition?
default-esp-mount-point
@@ -172,24 +166,6 @@
"Find and return the ESP partition among PARTITIONS."
(find esp-partition? partitions))
-(define (data-partition? partition)
- "Return #t if PARTITION is a partition dedicated to data (by opposition to
-freespace, metadata and protected partition types), return #f otherwise."
- (let ((type (partition-type partition)))
- (not (any (lambda (flag)
- (member flag type))
- '(free-space metadata protected)))))
-
-(define (metadata-partition? partition)
- "Return #t if PARTITION is a metadata partition, #f otherwise."
- (let ((type (partition-type partition)))
- (member 'metadata type)))
-
-(define (freespace-partition? partition)
- "Return #t if PARTITION is a free-space partition, #f otherwise."
- (let ((type (partition-type partition)))
- (member 'free-space type)))
-
(define* (small-freespace-partition? device
partition
#:key (max-size MEBIBYTE-SIZE))
@@ -200,21 +176,6 @@ inferior to MAX-SIZE, #f otherwise."
(device-sector-size device))))
(< size max-sector-size)))
-(define (normal-partition? partition)
- "return #t if partition is a normal partition, #f otherwise."
- (let ((type (partition-type partition)))
- (member 'normal type)))
-
-(define (extended-partition? partition)
- "return #t if partition is an extended partition, #f otherwise."
- (let ((type (partition-type partition)))
- (member 'extended type)))
-
-(define (logical-partition? partition)
- "Return #t if PARTITION is a logical partition, #f otherwise."
- (let ((type (partition-type partition)))
- (member 'logical type)))
-
(define (partition-user-type partition)
"Return the type of PARTITION, to be stored in the TYPE field of
<user-partition> record. It can be 'normal, 'extended or 'logical."
@@ -813,7 +774,7 @@ cause them to cross."
(define (rmpart disk number)
"Remove the partition with the given NUMBER on DISK."
(let ((partition (disk-get-partition disk number)))
- (disk-remove-partition disk partition)))
+ (disk-remove-partition* disk partition)))
;;
@@ -928,12 +889,12 @@ exists."
(if has-extended?
;; msdos - remove everything.
- (disk-delete-all disk)
+ (disk-remove-all-partitions disk)
;; gpt - remove everything but esp if it exists.
(for-each
(lambda (partition)
(and (data-partition? partition)
- (disk-remove-partition disk partition)))
+ (disk-remove-partition* disk partition)))
non-boot-partitions))
(let* ((start-partition
@@ -1348,7 +1309,7 @@ USER-PARTITIONS, or return nothing."
(define (init-parted)
"Initialize libparted support."
- (probe-all-devices)
+ (probe-all-devices!)
(exception-set-handler (lambda (exception)
EXCEPTION-OPTION-UNHANDLED)))
@@ -1364,7 +1325,6 @@ the devices not to be used before returning."
;; https://mail.gnome.org/archives/commits-list/2013-March/msg18423.html.
(let ((device-file-names (map device-path devices)))
(for-each force-device-sync devices)
- (free-all-devices)
(for-each (lambda (file-name)
(let ((in-use? (with-delay-device-in-use? file-name)))
(and in-use?