r1079 - trunk

robert at linuxfromscratch.org robert at linuxfromscratch.org
Thu Aug 9 02:39:20 PDT 2007


Author: robert
Date: 2007-08-09 03:39:20 -0600 (Thu, 09 Aug 2007)
New Revision: 1079

Modified:
   trunk/wpa-service.txt
Log:
Updated wpa-service hint

Modified: trunk/wpa-service.txt
===================================================================
--- trunk/wpa-service.txt	2007-08-09 09:34:56 UTC (rev 1078)
+++ trunk/wpa-service.txt	2007-08-09 09:39:20 UTC (rev 1079)
@@ -7,20 +7,18 @@
 SYNOPSIS: Setting up a wifi interface using wpa_supplicant and LFS IP
 services
 
+PRIMARY URL:
+http://www.bliscat.org/bliscat/hints/wpa-service/wpa-service-0.24.tar.bz2
+
 DESCRIPTION:
-
+	This hint explains how to set a network service using wpa_supplicant
 ATTACHMENTS:
 
-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
+http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2
 
-
 PREREQUISITES:
 
-- A working LFS-6.1.1 system or newer with wireless capabilities  
+- A working LFS-6.2 system or newer with wireless capabilities  
 - Almost two networks services like ipv4-static/dhcpcd installed
 - wpa_supplicant (>=0.5.7) and wireless drivers
  
@@ -31,88 +29,93 @@
 
 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.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.
-also when ready install it by executing :
+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
+        make prefix=/usr &&
+        make install
 
 1) This Hints
 ~~~~~~~~~~~~~
-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.
+Well ...
+"wpa-service is a back-end lfs-like service using the front-end wpa_cli of
+(breath here) the back-end componment wpa_supplicant on lfs based systems"
+but this, nobody cares...
 
+
+
 1.1) Install Files and Directories (this is only a proposal)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Extract wpa-service-0.24.tar.bz2 and in the extracted directory and run the
+following commands:
 
-  install -d /etc/sysconfig/wpa_supplicant
-  install -d /etc/sysconfig/network.d
-  install -m644 wpa_service.conf /etc/sysconfig/wpa_supplicant
+OPION 1 : 
 
-  install -m755 wpa-rcscript /etc/rc.d/init.d/wpa
-  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc3.d/S15wpa
-  ln -nsf /etc/rc.d/init.d/wpa /etc/rc.d/rc5.d/S15wpa
-  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 -dv -m 700 /etc/sysconfig/network.d
+  install -dv /etc/sysconfig/wpa-service
+  install -dv /etc/sysconfig/network-devices/services
+  install -dv /usr/share/doc/wpa-service
 
-  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
+  touch /etc/sysconfig/network.d/netkey
+  chmod -v 600 /etc/sysconfig/wpa-service/netkey
+  install -v -m644 wpa-service-conf /etc/sysconfig/wpa-service/wpa-service.conf
+  install -v -m754 wpa-action-script /etc/sysconfig/wpa-service/wpa-actions
+  install -v -m644 wpa-service.txt /usr/share/doc/wpa-service
+  install -v -m644 wpa-service-iface /usr/share/doc/wpa-service
+  install -v -m755 wpa-service /etc/sysconfig/network-devices/services
 
+  install -m755 wpa-service-rcscript /etc/rc.d/init.d/wpa-service
+  ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc3.d/S15wpa-service
+  ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc5.d/S15wpa-service
+  ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc6.d/K85wpa-service
+  ln -nsf /etc/rc.d/init.d/wpa-service /etc/rc.d/rc0.d/K85wpa-service
+
   install -d /etc/sysconfig/network-devices/ifconfig.<IFACE>
-  install -m644
-wpa-service-iface /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service
+  install -v -m644 wpa-service-iface \
+        /etc/sysconfig/network-devices/ifconfig.<IFACE>/wpa-service
 
-  were <IFACE> is your interface
+  where <IFACE> is your interface
 
-2) Network Configuration
-~~~~~~~~~~~~~~~~~~~~~~~~
+OPTION 2: same as above but in a script
+        ./install.sh <IFACE>
 
-All configurations go in the wpa-service-iface
-which is located
-at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service
+2) Configuration
+~~~~~~~~~~~~~~~~
 
+Network configuration go in the wpa-service-iface
+which is located at /etc/sysconfig/network-device/ifconfig.<IFACE>/wpa-service
+
+WPA/WEP keys go in netkey
+which is located at /etc/sysconfig/network.d/netkey
+
  
-2.1) Network configurations with any of the three functions:
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+2.1) Network configurations (IP):
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 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
+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,
- and took place in the /etc/sysconfig/network.d directory.
- 
- the "AzErTy" SSID descriptor will
-be /etc/sysconfig/network.d/AzeRtY
+Those ssid descriptors are named with the name of the SSID they describe,
+and took place in the /etc/sysconfig/network.d directory.
 
-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
+The "AzErTy" SSID descriptor will be /etc/sysconfig/network.d/AzeRtY
 
+2.1.1) SSID descriptor syntax:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An SSID descriptor is a regular network configuration file as used in LFS BOOK.
+it means that if SSID "IPV4" use ipv4-static, the the descriptor "IPV4" will be
+
         cat > /etc/sysconfig/network.d/IPV4 << "EOF"
         ONBOOT=yes
         SERVICE=ipv4-static
@@ -128,8 +131,8 @@
         ONBOOT="yes"
         SERVICE="dhcpcd"
         DHCP_START="-o"
-        DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by
-dhcpcd 
+        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
@@ -140,9 +143,8 @@
         PRINTALL="no"
         EOF
 
-for convenience, wpa_actions fall back
-to /etc/sysconfig/network.d/AUTO
-when no SSID descriptor is available,
+for convenience, wpa_actions fall back to /etc/sysconfig/network.d/AUTO when
+no SSID descriptor is available.
 
 Then install a common/automatic network configuration:
 I use dhcpcd:   
@@ -151,8 +153,8 @@
         ONBOOT="yes"
         SERVICE="dhcpcd"
         DHCP_START="-o"
-        DHCP_STOP="-k -o" # the '-o' prevent your interface being destroyed by
-dhcpcd
+        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
@@ -163,45 +165,40 @@
         PRINTALL="no"
         EOF
 
+3) The netkey file (The network keys description) 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-(this files can be symlinked, to prevent duplication)
+This file was previously named wpa_supplicant.conf
+but because i will only use it to store WPA/WEP key, i renamed it netkey and
+moved it to /etc/sysconfig/network.d/netkey
 
-3) The wpa_supplicant.conf (The network keys description) 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
 The wpa_supplicant README and wiki explain the composition of this file.
 
 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.
+to the wpa_supplicant program and only depends 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] >> /etc/sysconfig/network.d/netkey
 
 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:
+Now edit the newly created netkey file:
 Which should contains something similar to:
 
 network={
         ssid="ssid"
         #psk="passphrase"
-
-psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
-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.
+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.
 
 4) Geting over troubles (and tunning your network)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -247,7 +244,6 @@
 
 As an example:
 
-
 root at bliscat:/home/eloi# wpa_cli -iath0 -p/var/run/wpa_supplicant
 wpa_cli v0.4.8
 Copyright (c) 2004-2005, Jouni Malinen <jkmaline at cc.hut.fi> and
@@ -278,7 +274,7 @@
 type exit to quit wpa_cli
 
 
-With this output we can now feed the wpa_supplicant.conf file:
+With this output we can now feed the netkey file:
 
 network={
         ssid="ssid"
@@ -287,8 +283,7 @@
         pairwise=CCMP
         group=CCMP
         #psk="passphrase"
-
-psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
+        psk=2b1d17284c54aeaeeaae7151290e9744af2182b0eb8af20dd4ebb415928f726
 }
 
 
@@ -304,16 +299,16 @@
 wpa_supplicant -d[driver] -iwlan[X] -c[configfile] -dd
 
 example:
-wpa_supplicant -dmadwifi -iath0 -c./wpa_supplicant.conf -dd
+wpa_supplicant -dmadwifi -iath0 -c./netkey -dd
 
 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
-chmod 700 -c /etc/sysconfig/wpa_supplicant
-cp wpa_supplicant.conf /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
-chmod 600 -c /etc/sysconfig/wpa_supplicant/wpa_supplicant.conf
+install -d /etc/sysconfig/network.d
+chmod 700 -v /etc/sysconfig/network.d
+cp netkey /etc/sysconfig/network.d
+chmod 600 -v /etc/sysconfig/network.d/netkey
 
 
 5) The End
@@ -321,7 +316,7 @@
 execute:
 
 /etc/rc.d/init.d/network stop
-/etc/rc.d./init.d/wpa restart
+/etc/rc.d./init.d/wpa-service restart
 /etc/rc.d/init.d/network start
 
 if there is no errors, and your system is connected, then you can safely
@@ -338,7 +333,7 @@
 
 CHANGELOG:
 2006 03 10 Second release, first send to lfshint
-2006 03 16 added some words to help wpa-supplicant.conf writing
+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
@@ -349,4 +344,24 @@
 2007 03 27 Typo fix, ssid descriptors moved to /etc/sysconfig/network.d
 	this modifiy wpa_actions and wpa_service.conf
 	NETWORKDIR and SERVICESDIR moved to wpa_service.conf
-
+	version increment to 0.22
+2007 03 27 added missing installation of wpa-service.conf file
+	rename wpa_service.conf to wpa-service.conf
+	this modify all scripts and the core service script
+	remove line dealing with the install of an ifplugd script
+	version increment to 0.23
+2007 06 14 wpa_supplicant.conf renamed to netkey and moved to network.d
+	netkey chmoded to 600
+	wpa-service and network.d to 700
+	wpa-rcscript: renamed to wpa-service-rcscript
+        wpa-service-rcscript: updated
+        wpa-service: removed unused wait_for_up function
+                     '&> /dev/null' replaced by '2>&1 /dev/null'
+                    WPA_CONFIG_FILE is now WPA_KEY_FILE
+                    WPA_CONFIG_DIR is now WPA_KEY_DIR
+        wpa-service-conf: updated (to follow wpa-* change)
+        wpa_action-script: renamed to wpa-action-script
+        hint updated and files are now shipped in a tarball
+        with a very basic install.sh script
+	typo fix in hint        
+        version increment to 0.24




More information about the hints mailing list