dannym pushed a commit to branch wip-installer-2
in repository guix.
commit dc97547f119993bb7e66bd84d284f853c92d946b
Author: John Darrington <[email protected]>
Date: Sun Jan 29 08:49:34 2017 +0100
installer: Avoid wpa_supplicant's output causing screen damage.
* gnu/system/installer/wireless.scm (wireless-connect): Wrap wpa_supplicant
in call-with-output-file
---
gnu/system/installer/wireless.scm | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/gnu/system/installer/wireless.scm
b/gnu/system/installer/wireless.scm
index a10d2b9..23f4653 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -253,27 +253,28 @@
(let ((essid (assq-ref access-point 'essid))
(encr (assq-ref access-point 'encryption)))
- (call-with-temporary-output-file
- (lambda (filename port)
-
- (format port
- (if (eq? encr 'wep) "
+ (call-with-temporary-output-file
+ (lambda (filename port)
+ (format port
+ (if (eq? encr 'wep) "
network={
\tssid=\"~a\"
\tkey_mgmt=NONE
\twep_key0=\"~a\"
}
"
-"
+ "
network={
\tssid=\"~a\"
\tkey_mgmt=WPA-PSK
\tpsk=\"~a\"
}
")
- essid
- passphrase)
- (force-output port)
-
- (and (zero? (system* "wpa_supplicant" "-c" filename "-i" ifce "-B"))
- (zero? (system* "dhclient" ifce)))))))
+ essid
+ passphrase)
+ (force-output port)
+
+ (with-output-to-file "/dev/null"
+ (lambda ()
+ (and (zero? (system* "wpa_supplicant" "-c" filename "-i" ifce "-B"))
+ (zero? (system* "dhclient" ifce)))))))))