summaryrefslogtreecommitdiff
path: root/gnu/installer/newt
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/installer/newt')
-rw-r--r--gnu/installer/newt/ethernet.scm2
-rw-r--r--gnu/installer/newt/final.scm19
-rw-r--r--gnu/installer/newt/network.scm2
-rw-r--r--gnu/installer/newt/page.scm11
-rw-r--r--gnu/installer/newt/parameters.scm4
-rw-r--r--gnu/installer/newt/partition.scm20
-rw-r--r--gnu/installer/newt/services.scm3
-rw-r--r--gnu/installer/newt/welcome.scm8
-rw-r--r--gnu/installer/newt/wifi.scm3
9 files changed, 56 insertions, 16 deletions
diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm
index ba5e222a37..ecd22efbb2 100644
--- a/gnu/installer/newt/ethernet.scm
+++ b/gnu/installer/newt/ethernet.scm
@@ -77,7 +77,7 @@ connection is pending."
#:title (G_ "Ethernet connection")
#:listbox-items services
#:listbox-item->text ethernet-service->text
- #:listbox-height (min (+ (length services) 2) 10)
+ #:listbox-height (min (+ (length services) 2) 5)
#:button-text (G_ "Exit")
#:button-callback-procedure
(lambda _
diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm
index 89684c4d8a..7f6dd9f075 100644
--- a/gnu/installer/newt/final.scm
+++ b/gnu/installer/newt/final.scm
@@ -29,6 +29,7 @@
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (ice-9 match)
+ #:use-module ((ice-9 rdelim) #:select (read-line))
#:use-module (newt)
#:export (run-final-page))
@@ -39,9 +40,8 @@
file))
(define* (run-config-display-page #:key locale)
- (let ((width (%configuration-file-width))
- (height (nearest-exact-integer
- (/ (screen-rows) 2))))
+ (let ((width (max 70 (- (screen-columns) 20)))
+ (height (default-listbox-height)))
(run-file-textbox-page
#:info-text (format #f (G_ "\
We're now ready to proceed with the installation! \
@@ -107,6 +107,19 @@ a specific step, or restart the installer."))
install-ok?))
(define (run-final-page result prev-steps)
+ (define (wait-for-clients)
+ (unless (null? (current-clients))
+ (syslog "waiting with clients before starting final step~%")
+ (send-to-clients '(starting-final-step))
+ (match (select (current-clients) '() '())
+ (((port _ ...) _ _)
+ (read-line port)))))
+
+ ;; Before generating the configuration file, give clients a chance to do
+ ;; things such as changing the swap partition label.
+ (wait-for-clients)
+
+ (syslog "proceeding with final step~%")
(let* ((configuration (format-configuration prev-steps result))
(user-partitions (result-step result 'partition))
(locale (result-step result 'locale))
diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
index 461d5d99c0..4af7143d63 100644
--- a/gnu/installer/newt/network.scm
+++ b/gnu/installer/newt/network.scm
@@ -80,7 +80,7 @@ network devices were found. Do you want to continue anyway?"))
#:title (G_ "Internet access")
#:listbox-items items
#:listbox-item->text technology->text
- #:listbox-height (min (+ (length items) 2) 10)
+ #:listbox-height (min (+ (length items) 2) 5)
#:button-text (G_ "Exit")
#:button-callback-procedure
(lambda _
diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm
index 1d6b9979b4..4209674c28 100644
--- a/gnu/installer/newt/page.scm
+++ b/gnu/installer/newt/page.scm
@@ -32,7 +32,9 @@
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (newt)
- #:export (draw-info-page
+ #:export (default-listbox-height
+
+ draw-info-page
draw-connecting-page
run-input-page
run-error-page
@@ -168,6 +170,10 @@ Like 'run-form', return two values: the exit reason, and an \"argument\"."
(_
(values reason argument))))))
+(define (default-listbox-height)
+ "Return the default listbox height."
+ (max 5 (- (screen-rows) 20)))
+
(define (draw-info-page text title)
"Draw an informative page with the given TEXT as content. Set the title of
this page to TITLE."
@@ -339,7 +345,8 @@ of the page is set to TITLE."
(info-textbox-width 50)
listbox-items
listbox-item->text
- (listbox-height 20)
+ (listbox-height
+ (default-listbox-height))
(listbox-default-item #f)
(listbox-allow-multiple? #f)
(sort-listbox-items? #t)
diff --git a/gnu/installer/newt/parameters.scm b/gnu/installer/newt/parameters.scm
index 95112b5780..8fb1aa3abb 100644
--- a/gnu/installer/newt/parameters.scm
+++ b/gnu/installer/newt/parameters.scm
@@ -20,6 +20,7 @@
#:use-module (gnu installer proxy)
#:use-module (gnu installer steps)
#:use-module (gnu installer newt page)
+ #:use-module (guix build syscalls)
#:use-module (guix i18n)
#:use-module (ice-9 match)
#:use-module (newt)
@@ -40,7 +41,8 @@ empty string, proxy usage will be disabled.")
(let* ((items
(list
(cons (G_ "Change keyboard layout") keyboard-layout-selection)
- (cons (G_ "Configure HTTP proxy") run-proxy-page)))
+ (cons (G_ "Configure HTTP proxy") run-proxy-page)
+ (cons (G_ "Reboot") reboot)))
(result
(run-listbox-selection-page
#:info-text (G_ "Please choose one of the following parameters or \
diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm
index ed38287fe8..81cf68d782 100644
--- a/gnu/installer/newt/partition.scm
+++ b/gnu/installer/newt/partition.scm
@@ -25,6 +25,7 @@
#:use-module (gnu installer newt page)
#:use-module (gnu installer newt utils)
#:use-module (guix i18n)
+ #:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
@@ -56,11 +57,17 @@
#:button-callback-procedure button-exit-action)))
(car result)))
-(define (draw-formatting-page)
+(define (draw-formatting-page partitions)
"Draw a page asking for confirmation, and then indicating that partitions
are being formatted."
- (run-confirmation-page (G_ "We are about to format your hard disk. All \
-its data will be lost. Do you wish to continue?")
+ ;; TRANSLATORS: The ~{ and ~} format specifiers are used to iterate the list
+ ;; of device names of the user partitions that will be formatted.
+ (run-confirmation-page (format #f (G_ "We are about to write the configured \
+partition table to the disk and format the partitions listed below. Their \
+data will be lost. Do you wish to continue?~%~%~{ - ~a~%~}")
+ (map user-partition-file-name
+ (filter user-partition-need-formatting?
+ partitions)))
(G_ "Format disk?")
#:exit-button-procedure button-exit-action)
(draw-info-page
@@ -674,7 +681,7 @@ by pressing the Exit button.~%~%")))
(G_ "Guided partitioning")
(G_ "Manual partitioning"))
#:info-textbox-width 76 ;we need a lot of room for INFO-TEXT
- #:listbox-height 12
+ #:listbox-height (max 5 (- (screen-rows) 30))
#:listbox-items (disk-items)
#:listbox-item->text cdr
#:sort-listbox-items? #f
@@ -773,9 +780,12 @@ by pressing the Exit button.~%~%")))
(user-partitions (run-page non-install-devices))
(user-partitions-with-pass (prompt-luks-passwords
user-partitions))
- (form (draw-formatting-page)))
+ (form (draw-formatting-page user-partitions)))
;; Make sure the disks are not in use before proceeding to formatting.
(free-parted non-install-devices)
(format-user-partitions user-partitions-with-pass)
+ (syslog "formatted ~a user partitions~%"
+ (length user-partitions-with-pass))
+
(destroy-form-and-pop form)
user-partitions))
diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm
index 6d431cb4bb..ae249ba972 100644
--- a/gnu/installer/newt/services.scm
+++ b/gnu/installer/newt/services.scm
@@ -1,6 +1,6 @@
;;; 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, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -77,6 +77,7 @@ system.")
We recommend NetworkManager or Connman for a WiFi-capable laptop; the DHCP \
client may be enough for a server.")
#:info-textbox-width 70
+ #:listbox-height 7
#:listbox-items (filter (lambda (service)
(eq? 'network-management
(system-service-type service)))
diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm
index 1b4b2df816..5f461279e2 100644
--- a/gnu/installer/newt/welcome.scm
+++ b/gnu/installer/newt/welcome.scm
@@ -38,6 +38,9 @@
(define info-textbox-width (make-parameter 70))
(define options-listbox-height (make-parameter 5))
+(define (display-logo?)
+ (> (screen-rows) 35))
+
(define* (run-menu-page title info-text logo
#:key
listbox-items
@@ -55,7 +58,10 @@ we want this page to occupy all the screen space available."
items))
(let* ((logo-textbox
- (make-textbox -1 -1 (logo-width) (logo-height) 0))
+ (make-textbox -1 -1
+ (if (display-logo?) (logo-width) 0)
+ (if (display-logo?) (logo-height) 0)
+ 0))
(info-textbox
(make-reflowed-textbox -1 -1
info-text
diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm
index 3fd5756b99..f5d8f1fdbf 100644
--- a/gnu/installer/newt/wifi.scm
+++ b/gnu/installer/newt/wifi.scm
@@ -165,7 +165,8 @@ of <service-item> records present in LISTBOX."
(define service-name-max-length (make-parameter 20))
;; Height of the listbox displaying wifi services.
-(define wifi-listbox-height (make-parameter 20))
+(define wifi-listbox-height (make-parameter
+ (default-listbox-height)))
;; Information textbox width.
(define info-textbox-width (make-parameter 40))