[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
84/197: installer: Use guix build syscalls module for network interrogat
From: |
Danny Milosavljevic |
Subject: |
84/197: installer: Use guix build syscalls module for network interrogation. |
Date: |
Mon, 3 Jul 2017 20:37:04 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 4df5f24d904db41e16142ea49ad55ec63e9a067d
Author: John Darrington <address@hidden>
Date: Tue Jan 10 15:59:53 2017 +0100
installer: Use guix build syscalls module for network interrogation.
* gnu/system/installer/network.scm (interfaces): Do some of the
work with the module (guix build syscalls) rather than everything
ourself.
---
gnu/system/installer/network.scm | 38 +++++++++++++++-----------------------
1 file changed, 15 insertions(+), 23 deletions(-)
diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index bbf60d9..1667abc 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -22,6 +22,7 @@
#:use-module (gnu system installer misc)
#:use-module (gnu system installer utils)
#:use-module (gnu system installer wireless)
+ #:use-module (guix build syscalls)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (gurses menu)
@@ -39,22 +40,14 @@
network-page-key-handler))
(define (interfaces)
- "Return a alist of network interfaces. Keys include 'name, 'class and 'state"
- (slurp "ip -o link"
- (lambda (s)
- (match (string-split s #\space)
- ((_ interface-name _ _ _ _ _ _
- state _ _ _ _ _ _ _ _ _ class . _)
- (let ((clean-name (string-trim-right interface-name #\:)))
- `((name . ,clean-name)
- (state . ,state)
- (class . ,(cond
- ((equal? class "link/loopback") 'loopback)
- ((equal? class "link/ether")
- (if (zero? (system* "iw" "dev" clean-name "info"))
- 'wireless
- 'ethernet))
- (else 'other))))))))))
+ (map (lambda (ifce)
+ `((name . ,ifce)
+ (class . ,(cond
+ ((loopback-network-interface? ifce) 'loopback)
+ ((zero? (system* "iw" "dev" ifce "info"))
+ 'wireless)
+ (else 'ethernet)))))
+ (all-network-interface-names)))
(define my-buttons `((continue ,(N_ "_Continue") #t)
(test ,(N_ "_Test") #t)))
@@ -155,12 +148,12 @@
(getmaxy text-window) 0 #:panel #f))
(menu (make-menu
- (filter (lambda (i) (memq
+ (filter (lambda (i) (memq
(assq-ref i 'class)
'(ethernet wireless)))
(interfaces))
- #:disp-proc
- (lambda (datum row)
+ #:disp-proc
+ (lambda (datum row)
(match (string-split
(car (slurp
@@ -170,9 +163,9 @@
;; Convert a network device name such as "enp0s25" to
- ;; something more descriptive like
- ;; "82567LM Gigabit Network Connection"
- (let* ((name (assq-ref datum 'name))
+ ;; something more descriptive like
+ ;; "82567LM Gigabit Network Connection"
+ (let* ((name (assq-ref datum 'name))
(addr (string-tokenize name char-set:digit)))
(match addr
((bus device . func)
@@ -195,7 +188,6 @@
"Device:"))
state flags))))))))))
-
(addstr* text-window (format #f
(gettext
"To install GuixSD a connection to one of ~s must be available.
The following network devices exist on the system. Select one to configure or
\"Continue\" to proceeed.") %default-substitute-urls))
- 60/197: installer: Do not allow forms to set the cursor visibility., (continued)
- 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, 2017/07/03
- 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 <=
- 94/197: installer: Add the notion of uuids to prospective filesystems., Danny Milosavljevic, 2017/07/03
- 89/197: installer: Make the network menu more reliable., Danny Milosavljevic, 2017/07/03
- 90/197: installer: Enable direct scrolling to top or bottom of menus., Danny Milosavljevic, 2017/07/03
- 78/197: installer: Ensure that the cursor visibility is updated on each page., Danny Milosavljevic, 2017/07/03
- 107/197: installer: Do not allow the creation of invalid file-system specificaitons., Danny Milosavljevic, 2017/07/03
- 57/197: installer: Add a console-keymap service., Danny Milosavljevic, 2017/07/03
- 69/197: installer: Remove "continue" button from host name page., Danny Milosavljevic, 2017/07/03
- 58/197: installer: Add flags to indicate network interface status., Danny Milosavljevic, 2017/07/03
- 72/197: installer: Use --fallback when installing., Danny Milosavljevic, 2017/07/03
- 73/197: installer: Correct behaviour of push-cursor and pop-cursor procedures., Danny Milosavljevic, 2017/07/03