[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
25/80: installer: Use a cleaner way of generating the lspci information.
From: |
John Darrington |
Subject: |
25/80: installer: Use a cleaner way of generating the lspci information. |
Date: |
Tue, 3 Jan 2017 15:49:42 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 5aa3a63486ca3e80c9b0b27a63e2990a491914c9
Author: John Darrington <address@hidden>
Date: Sat Dec 24 10:57:45 2016 +0100
installer: Use a cleaner way of generating the lspci information.
* gnu/system/installer/network.scm (network-page-init): Clean up
implementation.
---
gnu/system/installer/network.scm | 40 ++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index 4e3abd6..61af33b 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -147,27 +147,25 @@
;; something more descriptive like
;; "82567LM Gigabit Network Connection"
(let* ((name (assq-ref datum 'name))
- (addr (string-tokenize name char-set:digit))
- (bus (match addr ((n . _)
- (string->number n 10))))
-
- (device (match addr ((_ . (n . _))
- (string->number n 10))))
-
- (func (match addr
- ((_ . (_ . (n . _)))
- (string->number n 10)) (_ 0))))
- (car (assoc-ref
- (cdr
- ;; It seems that lspci always prints an initial
- ;; "Device: <bus>:<device>.<func> line. We are not
- ;; interested in this, and it conflicts with the
"real"
- ;; (descriptive) Device: line which we want. Hence
- ;; the above cdr strips the first line away.
- (slurp (format #f "lspci -vm -s~x:~x.~x" bus device
func)
- (lambda (x)
- (string-split x #\tab))))
- "Device:")))))))
+ (addr (string-tokenize name char-set:digit)))
+ (match addr
+ ((bus device . func)
+ (car (assoc-ref
+ (cdr
+ ;; It seems that lspci always prints an initial
+ ;; "Device: <bus>:<device>.<func> line. We are
+ ;; not interested in this, and it conflicts with
+ ;; the "real" (descriptive) Device: line which we
+ ;; want. Hence the above cdr strips the first
line
+ ;; away.
+ (slurp (format #f "lspci -vm -s~x:~x.~x"
+ (string->number bus 10)
+ (string->number device 10)
+ (if (null? func) 0
+ (string->number func 10)))
+ (lambda (x)
+ (string-split x #\tab))))
+ "Device:")))))))))
(addstr* text-window (format #f
- 03/80: installer: Remove obsolete procedures/variables, (continued)
- 03/80: installer: Remove obsolete procedures/variables, John Darrington, 2017/01/03
- 02/80: installer: Fix broken keymap change option., John Darrington, 2017/01/03
- 07/80: installer: Use ice-9 match., John Darrington, 2017/01/03
- 06/80: installer: use ice-9 format everywhere., John Darrington, 2017/01/03
- 08/80: installer: Add IETF contraints for hostname in entry form., John Darrington, 2017/01/03
- 12/80: installer: Add gurses modules., John Darrington, 2017/01/03
- 21/80: gnu: guix: Add dependency: guile-ncurses., John Darrington, 2017/01/03
- 17/80: installer: Add new procedure to get the list of volumes., John Darrington, 2017/01/03
- 19/80: installer: Handle the 'back' action in the filesystems task., John Darrington, 2017/01/03
- 23/80: installer: Fix incorrect host in ping task., John Darrington, 2017/01/03
- 25/80: installer: Use a cleaner way of generating the lspci information.,
John Darrington <=
- 24/80: installer: Make "interfaces" return an alist., John Darrington, 2017/01/03
- 27/80: installer: Connect ethernet interfaces on selection., John Darrington, 2017/01/03
- 28/80: installer: Let the kernel know about (possibly) changed partitions., John Darrington, 2017/01/03
- 49/80: installer: Wrap installer in (catch #t ...), John Darrington, 2017/01/03
- 09/80: installer: Use a record instead of a list to contain tasks., John Darrington, 2017/01/03
- 29/80: installer: Deal with partition tables which are (partially) corrupt., John Darrington, 2017/01/03
- 37/80: installer: Improve dependencies on the final task., John Darrington, 2017/01/03
- 31/80: gnu: Add service to start the installer in installation-os., John Darrington, 2017/01/03
- 36/80: installer: Remove ad-hoc completed predicate and use standard one., John Darrington, 2017/01/03
- 35/80: installer: Make minumum-store-size variable global., John Darrington, 2017/01/03