[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/07: installer: Add procudure for starting a wireless interface.
From: |
John Darrington |
Subject: |
07/07: installer: Add procudure for starting a wireless interface. |
Date: |
Sun, 19 Feb 2017 12:30:56 -0500 (EST) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit e7c2d417ce9fd8252018737200c4eeb0b4efe2bf
Author: John Darrington <address@hidden>
Date: Sun Feb 19 15:28:23 2017 +0100
installer: Add procudure for starting a wireless interface.
* gnu/system/installer/wireless.scm (start-interface): New procedure.
---
gnu/system/installer/wireless.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/gnu/system/installer/wireless.scm
b/gnu/system/installer/wireless.scm
index 3e34e61..42b1a8f 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -24,6 +24,7 @@
#:use-module (gnu system installer misc)
#:use-module (gnu system installer utils)
#:use-module (ice-9 format)
+ #:use-module (ice-9 rdelim)
#:use-module (ice-9 match)
#:use-module (gurses menu)
#:use-module (gurses buttons)
@@ -245,6 +246,18 @@
+(define (start-interface config-file ifce)
+ (let ((pid-file (format #f "/wpspid-~a" ifce)))
+ (catch #t
+ (lambda () (kill (string->number
+ (read-line (open pid-file O_RDONLY))) SIGINT))
+ (lambda (key . args) #t))
+ (zero? (system* "wpa_supplicant"
+ "-c" config-file
+ "-P" pid-file
+ "-i" ifce
+ "-B"))))
+
(define (wireless-connect ifce access-point passphrase)
"Connect the wireless interface IFCE to ACCESS-POINT using the key
PASSPHRASE."
@@ -274,9 +287,5 @@ network={
(with-output-to-file "/dev/null"
(lambda ()
- (and (zero? (system* "wpa_supplicant"
- "-c" filename
- "-P" (format #f "/wpspid-~a" ifce)
- "-i" ifce
- "-B"))
+ (and (start-interface filename ifce)
(dhclient ifce))))))))
- branch wip-installer updated (c2eaa77 -> e7c2d41), John Darrington, 2017/02/19
- 06/07: installer: Return to network page after passphrase entry., John Darrington, 2017/02/19
- 01/07: installer: Make the install attempts counter global., John Darrington, 2017/02/19
- 03/07: installer: Specify a pid file for wpa_supplicant., John Darrington, 2017/02/19
- 05/07: installer: Avoid flicker in network page., John Darrington, 2017/02/19
- 07/07: installer: Add procudure for starting a wireless interface.,
John Darrington <=
- 02/07: installer: Kill old dhclient instance before starting new one., John Darrington, 2017/02/19
- 04/07: installer: Create dedicated module to maintainer the page stack., John Darrington, 2017/02/19