[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/22: installer: Use a cleaner way of generating the lspci information.
From: |
John Darrington |
Subject: |
04/22: installer: Use a cleaner way of generating the lspci information. |
Date: |
Tue, 27 Dec 2016 06:02:08 +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
- branch wip-installer updated (704f546 -> d654694), John Darrington, 2016/12/27
- 01/22: installer: Return slurped lines in their correct order., John Darrington, 2016/12/27
- 15/22: installer: Remove ad-hoc completed predicate and use standard one., John Darrington, 2016/12/27
- 02/22: installer: Fix incorrect host in ping task., John Darrington, 2016/12/27
- 06/22: installer: Connect ethernet interfaces on selection., John Darrington, 2016/12/27
- 14/22: installer: Make minumum-store-size variable global., John Darrington, 2016/12/27
- 04/22: installer: Use a cleaner way of generating the lspci information.,
John Darrington <=
- 16/22: installer: Improve dependencies on the final task., John Darrington, 2016/12/27
- 22/22: gnu: Add guix to the path environment for the guix-installer service., John Darrington, 2016/12/27
- 09/22: installer: Add a variable to represent the minimum recommended store size., John Darrington, 2016/12/27
- 17/22: installer: Replace some instances of "car"., John Darrington, 2016/12/27
- 20/22: install: Define new procedure pipe-cmd and use it to implement window-pipe., John Darrington, 2016/12/27
- 03/22: installer: Make "interfaces" return an alist., John Darrington, 2016/12/27
- 13/22: installer: Add path to mount/umount commands in installer service., John Darrington, 2016/12/27
- 10/22: gnu: Add service to start the installer in installation-os., John Darrington, 2016/12/27
- 11/22: installer: Add a task to actually call guix system init., John Darrington, 2016/12/27
- 18/22: installer: New predicate valid-hostname?, John Darrington, 2016/12/27