diff options
| author | Mathieu Othacehe <othacehe@gnu.org> | 2021-12-28 11:19:55 +0100 |
|---|---|---|
| committer | Mathieu Othacehe <othacehe@gnu.org> | 2022-01-14 14:29:08 +0100 |
| commit | ee897e5f51104f41b3c2a0c2cbc7eb4e6c1e4d3e (patch) | |
| tree | 838429d2c7718d77fa8a874728f8ce3fdfad9e5b /gnu/installer/newt/network.scm | |
| parent | c6910baf361a4e7c1fbc2354875c4250452e2251 (diff) | |
installer: Check if ci.guix.gnu.org can be reached.
* gnu/installer.scm (installer-program): Add gnutls extension.
* gnu/installer/newt/network.scm (wait-service-online): Check if the CI server
can be reached.
Diffstat (limited to 'gnu/installer/newt/network.scm')
| -rw-r--r-- | gnu/installer/newt/network.scm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 4af7143d636..fb221483c3e 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #:use-module (srfi srfi-34) | 30 | #:use-module (srfi srfi-34) |
| 31 | #:use-module (srfi srfi-35) | 31 | #:use-module (srfi srfi-35) |
| 32 | #:use-module (ice-9 match) | 32 | #:use-module (ice-9 match) |
| 33 | #:use-module (web client) | ||
| 34 | #:use-module (web response) | ||
| 33 | #:use-module (newt) | 35 | #:use-module (newt) |
| 34 | #:export (run-network-page)) | 36 | #:export (run-network-page)) |
| 35 | 37 | ||
| @@ -119,8 +121,23 @@ network devices were found. Do you want to continue anyway?")) | |||
| 119 | (define (wait-service-online) | 121 | (define (wait-service-online) |
| 120 | "Display a newt scale until connman detects an Internet access. Do | 122 | "Display a newt scale until connman detects an Internet access. Do |
| 121 | FULL-VALUE tentatives, spaced by 1 second." | 123 | FULL-VALUE tentatives, spaced by 1 second." |
| 124 | (define (ci-available?) | ||
| 125 | (dynamic-wind | ||
| 126 | (lambda () | ||
| 127 | (sigaction SIGALRM | ||
| 128 | (lambda _ #f)) | ||
| 129 | (alarm 3)) | ||
| 130 | (lambda () | ||
| 131 | (false-if-exception | ||
| 132 | (= (response-code | ||
| 133 | (http-request "https://ci.guix.gnu.org")) | ||
| 134 | 200))) | ||
| 135 | (lambda () | ||
| 136 | (alarm 0)))) | ||
| 137 | |||
| 122 | (define (online?) | 138 | (define (online?) |
| 123 | (or (connman-online?) | 139 | (or (and (connman-online?) |
| 140 | (ci-available?)) | ||
| 124 | (file-exists? "/tmp/installer-assume-online"))) | 141 | (file-exists? "/tmp/installer-assume-online"))) |
| 125 | 142 | ||
| 126 | (let* ((full-value 5)) | 143 | (let* ((full-value 5)) |
| @@ -137,7 +154,7 @@ FULL-VALUE tentatives, spaced by 1 second." | |||
| 137 | (unless (online?) | 154 | (unless (online?) |
| 138 | (run-error-page | 155 | (run-error-page |
| 139 | (G_ "The selected network does not provide access to the \ | 156 | (G_ "The selected network does not provide access to the \ |
| 140 | Internet, please try again.") | 157 | Internet and the Guix substitute server, please try again.") |
| 141 | (G_ "Connection error")) | 158 | (G_ "Connection error")) |
| 142 | (raise | 159 | (raise |
| 143 | (condition | 160 | (condition |
