r1071 - in trunk: . ATTACHMENTS/wpa-service

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Tue Mar 27 07:50:23 PDT 2007


Author: tushar
Date: 2007-03-27 08:50:23 -0600 (Tue, 27 Mar 2007)
New Revision: 1071

Added:
   trunk/ATTACHMENTS/wpa-service/wpa-service
Modified:
   trunk/ATTACHMENTS/wpa-service/wpa-service-iface
   trunk/ATTACHMENTS/wpa-service/wpa_actions-script
   trunk/ATTACHMENTS/wpa-service/wpa_service.conf
   trunk/wpa-service.txt
Log:
Updated hint: wpa-service

Added: trunk/ATTACHMENTS/wpa-service/wpa-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service	                        (rev 0)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service	2007-03-27 14:50:23 UTC (rev 1071)
@@ -0,0 +1,192 @@
+#!/bin/bash
+# Begin $network-devices/services/wpa-service
+# wpa-service 0.21
+# Based on dhcpcd script adapted for wpa networks with or without dhcp support
+# Rewritten by Eloi Primaux  - eloi AT bliscat DOT org
+# 2006-02-20 First script
+# 2006-03-31 wpa-service is functional
+# 2006-08-21 version by Maarten Lankhorst - m.b.lankhorst.(@).gmail.com
+# 2006-10-15 0.2 release by Eloi Primaux
+#	     merging Maarten work into configure_network function
+#	     can use both wpa_cli -a function and ifplugd.
+# 2007-02-14 0.21 ifplugd support removed
+#            wait_for_up removed
+#            status* and available_network* functions removed
+
+IFACE=$1
+BRING=$2
+
+. /etc/sysconfig/rc
+. $rc_functions
+. $IFCONFIG
+. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
+function get_real_pid {
+	if [ -e $1 ]; then
+	RET=`fuser $1` &> /dev/null
+	else
+	return 1
+	fi
+}
+
+function wpa_is_up {
+	get_real_pid $WPA_GLOBAL_FILE
+	if [ $? != 0 ]; then
+		return 2
+	fi
+}
+
+function wpa {
+	wpa_is_up
+	if [ $? != 0 ]; then
+		verbose '' "$WPA_DAEMON_NAME isn't running, please check why"
+		if [ $BRING != "UP" ]; then
+			return 1
+		else
+			exit 1
+		fi
+	fi
+}
+
+function is_iface_not_managed {
+	[ -n "`get_real_pid $WPA_ACCESS_DIR/$IFACE`" ] && return 2
+}
+
+function verbose {
+	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
+}
+
+function test_fail {
+	[ "$1" != 0 ] && RET="FAIL:$1"
+	verbose '' " $RET"
+	if [[ $RET = FAIL* ]]; then
+		echo_failure ; return 2
+	else
+		return $1
+	fi
+}
+
+function add_iface {
+	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR :"
+	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR` &> /dev/null
+	test_fail $?
+}
+
+function ctrl_iface {
+	verbose -n "$WPA_CLIENT_NAME -i$IFACE $@ :"
+	RET=`$WPA_CLIENT_NAME -i$IFACE $@` &> /dev/null
+	test_fail $?
+}
+
+function remove_iface {
+	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE :"
+	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE` &> /dev/null
+	test_fail $?
+}
+
+function configure_network {
+	#Read the wpa config file
+	LINENUMBER=0
+	CONFIGFILE="$WPA_CONFIG_DIR/$WPA_CONFIG_FILE"
+	LINES="$(wc -l $CONFIGFILE | sed 's/ .*//')"
+	while [ "$LINENUMBER" -lt "$LINES" ]
+	do
+		verbose '' "NETWORK=$NETWORK"
+		# Increase line number
+		let ++LINENUMBER
+		verbose '' "Parsing line ${LINENUMBER}"
+		# Fetch a line
+		preline="$(head -n $LINENUMBER $CONFIGFILE | tail -n 1)"
+		# Remove everything after a '#' (comment)
+		line="$(echo $preline | sed -e 's/#.*//')"
+
+		#echo "Parsing $LINENUMBER: '$preline' => '$line'"
+
+		if [ -z "`echo $line`" ]; then
+		# ignore now empty lines
+			continue
+		elif [ "$line" = "network={" ]; then
+		# creating a new network configuration,
+		# saving network number to NETWORK
+			ctrl_iface add_network
+			NETWORK="$RET"
+		elif [ "$line" = "}" ]; then
+		# now the network is configured, enabling it
+			ctrl_iface "enable_network $NETWORK"
+			unset NETWORK
+		elif [ -n "$( echo "$line" | grep -v "ctrl_interface")" ]; then
+			# all others lines should be network parameters...
+			# i need to replace the first '=' character by a pace
+			line="`echo "$line" | sed 's,=, ,'`"
+			verbose '' "ctrl_iface set_network $NETWORK $line"
+			RET="`$WPA_CLIENT_NAME -i $IFACE set_network $NETWORK $line`"
+			#ctrl_iface set_network $NETWORK $line
+		fi
+		if [[ $RET = FAIL* ]]; then
+			boot_mesg "Parse error on line ${LINENUMBER}"
+			remove_iface 
+			echo_failure
+			return 2
+		fi
+	done
+}
+
+function wait_for_events {
+# This is a new wpa_supplicant function: really usefull
+# but requires an additional action file to handle CONNECTED/DISCONNECTED events
+	ctrl_iface -a$WPA_ACTION_FILE &
+}
+
+
+function real_fail {
+	[ "$1" != 0 ] && RET="FAIL:$1"
+	verbose '' " $RET"
+	if [[ $RET = FAIL* ]]; then
+		exit $1
+	else
+		return $1
+	fi
+}
+
+function wait_for_up {
+	wait_for_up_loop
+	real_fail $?
+	$WPA_ACTION_FILE $IFACE CONNECTED
+}
+
+
+function iface_up {
+	wpa
+	is_iface_not_managed
+	if [ $? = 0 ]; then
+		verbose '' "Interface already managed, continuing"
+	else
+		add_iface
+		real_fail $?
+	fi
+	configure_network
+	real_fail $?
+	wait_for_events
+	}
+
+
+function iface_down {
+	wpa
+	ctrl_iface disconnect
+	test_fail $?
+		verbose '' "wpa_cli -a will exit when interface will be removed"
+		$WPA_ACTION_FILE $IFACE DISCONNECTED
+	test_fail $?
+	wpa_cli -g$WPA_GLOBAL_FILE interface_remove $IFACE
+	test_fail $?	
+}
+
+case "$2" in
+	up)
+	iface_up
+	;;
+	down)
+	iface_down
+	;;
+esac
+

Modified: trunk/ATTACHMENTS/wpa-service/wpa-service-iface
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service-iface	2007-01-29 06:06:15 UTC (rev 1070)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service-iface	2007-03-27 14:50:23 UTC (rev 1071)
@@ -1,15 +1,8 @@
 ONBOOT="yes"
-SERVICE="wpa-service2"
+SERVICE="wpa-service"
 VERBOSE="NO"
 	. /etc/sysconfig/wpa_supplicant/wpa_service.conf
 
-IP_FUNCTION="if_plugd"
 # Here you have to define which wpa driver wpa_supplicant will use for
 #this interface
         WPA_DRIVER="madwifi"
-
-# To avoid boot freezing with this service
-# one cycle each 5 seconds
-        WPA_MAX_WAIT=10
-# or fork anyway in the background:
- 	FORK_SERVICE="yes"

Modified: trunk/ATTACHMENTS/wpa-service/wpa_actions-script
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_actions-script	2007-01-29 06:06:15 UTC (rev 1070)
+++ trunk/ATTACHMENTS/wpa-service/wpa_actions-script	2007-03-27 14:50:23 UTC (rev 1071)
@@ -3,16 +3,19 @@
 IFACE=$1
 EVENT=$2
 
+. /etc/sysconfig/wpa_supplicant/wpa_service.conf
+
 NETWORKDIR=/etc/sysconfig/wpa_supplicant
 SERVICESDIR=/etc/sysconfig/network-devices/services
 
 . /etc/sysconfig/rc
 . $rc_functions
-#. $IFCONFIG
+. $IFCONFIG
 
-#. /etc/rc.d/init.d/functions
+. /etc/rc.d/init.d/functions
 . /etc/sysconfig/network-devices/ifconfig.$IFACE/wpa-service
 
+
 function verbose {
 	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
 }
@@ -27,16 +30,14 @@
 	fi
 }
 
-function ctrl_iface {
-	verbose -n "$WPA_CLIENT_NAME -i$IFACE $@ :"
-	RET=`$WPA_CLIENT_NAME -i$IFACE $@` &> /dev/null
-	test_fail $?
+function get_ssid {
+	RET=`$WPA_CLIENT_NAME -i$IFACE status | grep ^ssid= | cut -f2- -d=` &> /dev/null
 }
 
 if [ "$EVENT" == "CONNECTED" ]; then
-	ctrl_iface status
-	test_fail $?
-	SSID=`echo $RET | grep ^ssid= | cut -f2- -d=`
+	get_ssid
+	SSID=$RET
+	verbose '' "SSID is $SSID"
 	# configure network, signal DHCP client, etc.
 	# If special networks definition exist, use it
 	if [ -f "$NETWORKDIR/$SSID" ]; then
@@ -55,15 +56,17 @@
 
 if [ "$EVENT" == "DISCONNECTED" ]; then
     # remove network configuration, if needed
-	ctrl_iface status
-	test_fail $?
-	SSID=`echo $RET | grep ^ssid= | cut -f2- -d=`
+	get_ssid
+	SSID=$RET
 	# configure network, signal DHCP client, etc.
 	# If special networks definition exist, use it
 	if [ -f "$NETWORKDIR/$SSID" ]; then
 		. $NETWORKDIR/$SSID
 		$SERVICESDIR/$SERVICE $IFACE down
 	else
+		IFCONFIG="$NETWORKDIR/AUTO"
+		. $IFCONFIG
+		export IFCONFIG
 		$SERVICESDIR/$SERVICE $IFACE down
 	fi
 	exit $?

Modified: trunk/ATTACHMENTS/wpa-service/wpa_service.conf
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_service.conf	2007-01-29 06:06:15 UTC (rev 1070)
+++ trunk/ATTACHMENTS/wpa-service/wpa_service.conf	2007-03-27 14:50:23 UTC (rev 1071)
@@ -16,7 +16,6 @@
  # here is the name of your action file
  	
  	WPA_ACTION_FILE=$WPA_CONFIG_DIR/wpa_actions
- 	IFPLUGD_WRAPPER=$WPA_CONFIG_DIR/ifplugd_wrapper
  
  # This is what need wpa_supplicant
 	

Modified: trunk/wpa-service.txt
===================================================================
--- trunk/wpa-service.txt	2007-01-29 06:06:15 UTC (rev 1070)
+++ trunk/wpa-service.txt	2007-03-27 14:50:23 UTC (rev 1071)
@@ -1,28 +1,28 @@
 AUTHOR: Eloi Primaux eloi AT bliscat dot org
 
-DATE: 2006-10-13
+DATE: 2007-02-14
 
 LICENSE: GNU Free Documentation License Version 2
 
-SYNOPSIS: Setting up a wifi interface using wpa_supplicant and LFS IP services
+SYNOPSIS: Setting up a wifi interface using wpa_supplicant and LFS IP
+services
 
 DESCRIPTION:
 
 ATTACHMENTS:
 
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa_service.conf
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-rcscript
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service2
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa-service-iface
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/wpa_actions-script
-http://www.linuxfromscratch.org/hints/downloads/attachments/wpa-service/ifplugd_wrapper-script
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa_service.conf
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-rcscript
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service-iface
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa_actions-script
 
 
 PREREQUISITES:
 
-- A working LFS-6.1 system or newer with wireless capabilities  
+- A working LFS-6.1.1 system or newer with wireless capabilities  
 - Almost two networks services like ipv4-static/dhcpcd installed
-- wpa_supplicant and wireless drivers
+- wpa_supplicant (>=0.5.7) and wireless drivers
  
 HINT:
 
@@ -31,54 +31,34 @@
 
 0.a) wpa_supplicant 'The core'
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This is NOT an usual step if you omit something here you won't be able to attach
+This is NOT an usual step if you omit something here you won't be able
+to attach
 your device to any access point
 
-Please use the 0.4.8 version or newer and NOT the 0.4.7, available at:
+Please use the 0.5.7 version or newer, available at:
 link: http://hostap.epitest.fi/wpa_supplicant
 
-Again, i strongly recommend you to read its README before doing anything.
-wpa_supplicant may need the source of your drivers then edit the .config file
-as described in the README and set all constants according to your system.
+Again, i strongly recommend you to read its README before doing
+anything.
+wpa_supplicant may need the source of your drivers then edit the .config
+file
+as described in the README and set all constants according to your
+system.
 also when ready install it by executing :
 
 find ./ -name 'Makefile' -exec sed 's,/usr/local,/usr,g' {} \ &&
 make &&
 make install
 
-0.b) ifplugd a daemon which monitor your interface (optional)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This external program is not required but can drastically simplify our life
-because it won't crash wpa_supplicant
-information can be found here
-	http://0pointer.de/lennart/projects/ifplugd
-and ifplugd (0.28) can be downloaded from:
-	http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.28.tar.gz
-
-installation
-As this package is made with the GNU autotools you should run
-./configure inside the distribution directory for configuring the source tree.
-After that you should run make for compilation
-and make install (as root) for installation of ifplugd.
-
-./configure --prefix=/usr --sysconfdir=/etc
-make
-make install
-
-The installation scripts create an init script in ${sysconfdir}/init.d/ifplugd, however no /etc/rc?.d/ links are created for it.
-
-ifplugd request two links if you intend to use it out of wpa-service:
-
-ln -nsf /etc/sysconfdir/network-devices/{ifup,ifdown} /sbin
-
 1) This Hints
 ~~~~~~~~~~~~~
-wpa_supplicant is designed to be a "daemon" program that runs in the background
+wpa_supplicant is designed to be a "daemon" program that runs in the
+background
 and acts as the back-end component controlling the wireless connection.
 wpa_supplicant supports separate front-end programs and a text-based
 front-end (wpa_cli) is included with wpa_supplicant.
 
-1.1) Install Files and Directories
+1.1) Install Files and Directories (this is only a proposal)
 
   install -d /etc/sysconfig/wpa_supplicant
   install -m644 wpa_service.conf /etc/sysconfig/wpa_supplicant
@@ -89,68 +69,48 @@
   ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc6.d/K85wpa
   ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc0.d/K85wpa
 
-  install -m755 wpa_actions-script /etc/sysconfig/wpa_supplicant/wpa_actions
-  install -m755 ifplugd_wrapper-script /etc/sysconfig/wpa_supplicant/ifplugd_wrapper
-  install -m755 wpa-service2 /etc/sysconfig/network-devices/services
+  install -m755
+wpa_actions-script /etc/sysconfig/wpa_supplicant/wpa_actions
+  install -m755
+ifplugd_wrapper-script /etc/sysconfig/wpa_supplicant/ifplugd_wrapper
+  install -m755 wpa-service /etc/sysconfig/network-devices/services
 
   install -d /etc/sysconfig/network-devices/ifconfig.<IFACE>
-  install -m644 wpa-service-iface /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service
+  install -m644
+wpa-service-iface /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service
 
+  were <IFACE> is your interface
 
 2) Network Configuration
 ~~~~~~~~~~~~~~~~~~~~~~~~
-2.1) Choosing the network configuration method
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 All configurations go in the wpa-service-iface
+which is located
+at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service
 
-wpa-service 0.2 can be use to only set up one time or continuously manage your
-interface.
- This is done by three functions:
- - wait_for_up     --> a stupid loop waiting for the interface to be ready
- - wait_for_events --> wpa_supplicant internal 'action' function (wpa-cli -a)
- - if_plugd        --> an external daemon
-
-This choice is done by setting IP_FUNCTION in the wpa-service-iface file
-
-In the case of a static computer, the first function should be used
-wait_for_up:
- (+)the advantages are : less request to the wpa_supplicant daemon
-                        only one daemon is running : wpa_supplicant.
- (-)disadvantages      : if network change, you will lost connection
-
-wait_for_events:
- (+)the advantages are : dynamic network configuration
-                        only one daemon is running : wpa_supplicant.
- (-)disadvantages      : wpa_supplicant crashes under too much pings
- 			from wpa_cli , thus you will lost connection
-
-if_plugd:
- (+)the advantages are : dynamic network configuration
- 			less request to the wpa_supplicant daemon
- 			more reliable and can also be use for wired interface 
- (-)disadvantages      : require an external daemon
  
-i encourage people to use the wait_for_events function, because errors reports
-will go to wpa_supplicant developers ;)
-
-but if you want a more reliable network, use the if_plugd function.
- 
-2.2) Network configurations with any of the three functions:
+2.1) Network configurations with any of the three functions:
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-wpa-service can set up your network according to it's SSID, this means that if
-the SSID "DHCP network" manage ip via a dhcp server, wpa-service will use the
-SSID file descriptor to set up you network when connecting to the SSID network.
+wpa-service can set up your network according to it's SSID, this means
+that if
+the SSID "DHCP network" manage ip via a dhcp server, wpa-service will
+use the
+SSID file descriptor to set up you network when connecting to the SSID
+network.
 
- Those ssid descriptors are named with the name of the SSID they describe,
+ Those ssid descriptors are named with the name of the SSID they
+describe,
  and took place in the /etc/sysconfig/wpa_supplicant directory.
  
- the "AzErTy" SSID descriptor will be /etc/sysconfig/wpa_supplicant/AzeRtY
+ the "AzErTy" SSID descriptor will
+be /etc/sysconfig/wpa_supplicant/AzeRtY
 
 2.1) SSID descriptor syntax:
-An SSID descriptor is a regular network configuration file as used in LFS system
-it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" will be
+An SSID descriptor is a regular network configuration file as used in
+LFS system
+it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4"
+will be
 
 	cat > /etc/sysconfig/wpa_supplicant/IPV4 << "EOF"
 	ONBOOT=yes
@@ -161,13 +121,14 @@
 	BROADCAST=192.168.1.255
 	EOF
 
-or if the "DHCP" SSID use dhcp :
+and if the "DHCP" SSID use dhcp :
 
 	cat > /etc/sysconfig/wpa_supplicant/DHCP << "EOF"
 	ONBOOT="yes"
 	SERVICE="dhcpcd"
 	DHCP_START="-o"
-	DHCP_STOP="-k -o"
+	DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by
+dhcpcd 
 
 	# Set PRINTIP="yes" to have the script print
 	# the DHCP assigned IP address
@@ -178,7 +139,8 @@
 	PRINTALL="no"
 	EOF
 
-for convenience, wpa_actions fall back to /etc/sysconfig/wpa_supplicant/AUTO
+for convenience, wpa_actions fall back
+to /etc/sysconfig/wpa_supplicant/AUTO
 when no SSID descriptor is available,
 
 Then install a common/automatic network configuration:
@@ -188,7 +150,8 @@
 	ONBOOT="yes"
 	SERVICE="dhcpcd"
 	DHCP_START="-o"
-	DHCP_STOP="-k -o"
+	DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by
+dhcpcd
 
 	# Set PRINTIP="yes" to have the script print
 	# the DHCP assigned IP address
@@ -201,26 +164,25 @@
 
 
 
-
-
-
 3) The wpa_supplicant.conf (The network keys description) 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The wpa_supplicant README and wiki explain the composition of this file.
 
-3.a) File syntax
-~~~~~~~~~~~~~~~~
-The file syntax is the wpa_supplicant.conf file syntax, it is specific to the
-wpa_supplicant program and only depend of the programmer choice, thus instead of
-explaining you of how this file is read, i will show you a set of command to
+The file syntax is the wpa_supplicant.conf file syntax, it is specific
+to the
+wpa_supplicant program and only depend of the programmer choice, thus
+instead of
+explaining you of how this file is read, i will show you a set of
+command to
 create a config file with wpa_supplicant.
 
 in a bash shell execute:
 
-wpa_passphrase <ssid> [passphrase] > wpa_supplicant.conf
+wpa_passphrase <ssid> [passphrase] >> wpa_supplicant.conf
 
-Where <ssid> is the name of the access point and where [pasphrase] is your ...
+Where <ssid> is the name of the access point and where [pasphrase] is
+your ...
 pass-phrase.
 
 Now edit the newly created wpa_supplicant.conf file:
@@ -229,30 +191,35 @@
 network={
         ssid="ssid"
         #psk="passphrase"
-        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+
+psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
-Please quote correctly the strings containing the space characters
-
-you will directly see that you can define more than one network in this file,
+you will directly see that you can define more than one network in this
+file,
 that's why wpa_supplicant is very nice: it chooses automatically in its
-configuration file the best (aka secure and available) network to connect.
+configuration file the best (aka secure and available) network to
+connect.
 
-But at this time your network need to be tuned:
+4) Geting over troubles (and tunning your network)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-open a new console and launch in the foreground wpa_supplicant in debug mode:
+open a new console and launch in the foreground wpa_supplicant in debug
+mode:
 
 wpa_supplicant -g/var/run/wpa_supplicant-global \
                -P/var/run/wpa_supplicant.pid -ddd
 
 this will make wpa_supplicant to output anything to us.
 
-Now start the wpa_cli :
+Now start the wpa_cli in another console:
 
-wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan[X] "" [driver] \
+wpa_cli -g/var/run/wpa_supplicant-global interface_add wlan[X]
+"" [driver] \
         /var/run/wpa_supplicant
 
-Where wlan[X] is the device name of your network interface and where [driver] is
+Where wlan[X] is the device name of your network interface and where
+[driver] is
 the name of your driver
 
 examples:
@@ -261,7 +228,8 @@
 wpa_cli -g/var/run/wpa_supplicant-global interface_add eth1 "" wext \
         /var/run/wpa_supplicant
 
-if it fail, please have a look to the output of the wpa_supplicant daemon
+if it fail, please have a look to the output of the wpa_supplicant
+daemon
 
 wpa_cli -iwlan[X] -p/var/run/wpa_supplicant
 
@@ -317,7 +285,8 @@
         pairwise=CCMP
         group=CCMP
         #psk="passphrase"
-        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+
+psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
 
@@ -335,7 +304,8 @@
 example:
 wpa_supplicant -dmadwifi -iath0 -c./wpa_supplicant.conf -dd
 
-If you see something like SUCCESS it's done, kill it again and copy the config
+If you see something like SUCCESS it's done, kill it again and copy the
+config
 file to a secure directory:
 
 install -d /etc/sysconfig/wpa_supplicant
@@ -344,7 +314,7 @@
 chmod 600 -c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
 
 
-6) The End
+5) The End
 ~~~~~~~~~~
 execute:
 
@@ -352,7 +322,8 @@
 /etc/rc.d./init.d/wpa restart
 /etc/rc.d/init.d/network start
 
-if there is no errors, and your system is connected, then you can safely restart
+if there is no errors, and your system is connected, then you can safely
+restart
 your computer to see it setting up your wireless card during boot time.
 
 ACKNOWLEDGMENTS:
@@ -367,7 +338,9 @@
 2006 03 10 Second release, first send to lfshint
 2006 03 16 added some words to help wpa-supplicant.conf writing
 2006 03 18 fix wrong paths
-2006 03 31 Rewritten and try to match the LFS-standard thank's to archaic's help
+2006 03 31 Rewritten and try to match the LFS-standard thank's to
+archaic's help
 2006 04 01 fix incomplete find commands
 2006 10 15 wpa-service 0.2
-
+2006 02 14 some typo fix in scripts, removed ifplugd support, and
+wait_for_up function




More information about the hints mailing list