Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src - make etc/rc.d/wpa_supplicant create directory /var/run/wpa...



details:   https://anonhg.NetBSD.org/src/rev/da98a786ea13
branches:  trunk
changeset: 326241:da98a786ea13
user:      spz <spz%NetBSD.org@localhost>
date:      Thu Jan 23 07:26:50 2014 +0000

description:
- make etc/rc.d/wpa_supplicant create directory /var/run/wpa_supplicant
  on startup
- create share/examples/wpa_supplicant/wpa_supplicant.conf and make it
  known in the relevant places. Improvements welcome, my point was
  ctrl_interface and "you seriously want this"

diffstat:

 distrib/sets/lists/base/mi                        |    4 +-
 etc/mtree/NetBSD.dist.base                        |    3 +-
 etc/rc.d/wpa_supplicant                           |   10 +-
 share/examples/Makefile                           |    4 +-
 share/examples/wpa_supplicant/Makefile            |   12 ++
 share/examples/wpa_supplicant/wpa_supplicant.conf |  107 ++++++++++++++++++++++
 6 files changed, 135 insertions(+), 5 deletions(-)

diffs (200 lines):

diff -r a08b9c4ac47d -r da98a786ea13 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Thu Jan 23 03:08:50 2014 +0000
+++ b/distrib/sets/lists/base/mi        Thu Jan 23 07:26:50 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1060 2014/01/16 14:46:36 pgoyette Exp $
+# $NetBSD: mi,v 1.1061 2014/01/23 07:26:50 spz Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -1797,6 +1797,8 @@
 ./usr/share/examples/verifiedexec_load         base-obsolete           obsolete
 ./usr/share/examples/verifiedexec_load/gen_md5 base-obsolete           obsolete
 ./usr/share/examples/verifiedexec_load/gen_sha1        base-obsolete           obsolete
+./usr/share/examples/wpa_supplicant            base-netutil-examples
+./usr/share/examples/wpa_supplicant/wpa_supplicant.conf                base-netutil-examples   share
 ./usr/share/examples/wsmoused                  base-sysutil-examples
 ./usr/share/examples/wsmoused/wsmoused.conf    base-sysutil-examples   share
 ./usr/share/games                              base-games-share
diff -r a08b9c4ac47d -r da98a786ea13 etc/mtree/NetBSD.dist.base
--- a/etc/mtree/NetBSD.dist.base        Thu Jan 23 03:08:50 2014 +0000
+++ b/etc/mtree/NetBSD.dist.base        Thu Jan 23 07:26:50 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.base,v 1.132 2014/01/05 16:38:06 joerg Exp $
+#      $NetBSD: NetBSD.dist.base,v 1.133 2014/01/23 07:26:50 spz Exp $
 #      @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -402,6 +402,7 @@
 ./usr/share/examples/supfiles
 ./usr/share/examples/syslogd
 ./usr/share/examples/tmux
+./usr/share/examples/wpa_supplicant
 ./usr/share/examples/wsmoused
 ./usr/share/games
 ./usr/share/games/atc
diff -r a08b9c4ac47d -r da98a786ea13 etc/rc.d/wpa_supplicant
--- a/etc/rc.d/wpa_supplicant   Thu Jan 23 03:08:50 2014 +0000
+++ b/etc/rc.d/wpa_supplicant   Thu Jan 23 07:26:50 2014 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: wpa_supplicant,v 1.4 2013/02/01 13:29:33 tron Exp $
+# $NetBSD: wpa_supplicant,v 1.5 2014/01/23 07:26:51 spz Exp $
 #
 
 # PROVIDE: wpa_supplicant
@@ -22,6 +22,14 @@
 command="/usr/sbin/wpa_supplicant"
 reload_cmd="/usr/sbin/wpa_cli reconfigure"
 extra_commands="reload"
+start_precmd="wpa_supplicant_precmd"
+
+wpa_supplicant_precmd()
+{
+    if [ ! -d /var/run/wpa_supplicant ]; then
+        mkdir -p -m 755 /var/run/wpa_supplicant
+    fi
+}
 
 load_rc_config $name
 run_rc_command "$1"
diff -r a08b9c4ac47d -r da98a786ea13 share/examples/Makefile
--- a/share/examples/Makefile   Thu Jan 23 03:08:50 2014 +0000
+++ b/share/examples/Makefile   Thu Jan 23 07:26:50 2014 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.21 2012/08/22 06:45:16 spz Exp $
+#      $NetBSD: Makefile,v 1.22 2014/01/23 07:26:51 spz Exp $
 
 SUBDIR= amd apm asm disktab emul fstab ftpd getdate hostapd \
-        isdn lua npf pppd racoon supfiles syslogd wsmoused
+        isdn lua npf pppd racoon supfiles syslogd wpa_supplicant wsmoused
 
 .include <bsd.subdir.mk>
diff -r a08b9c4ac47d -r da98a786ea13 share/examples/wpa_supplicant/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/wpa_supplicant/Makefile    Thu Jan 23 07:26:50 2014 +0000
@@ -0,0 +1,12 @@
+#      $NetBSD: Makefile,v 1.1 2014/01/23 07:26:51 spz Exp $
+
+NOOBJ= # defined
+
+.include <bsd.own.mk>
+
+.if ${MKSHARE} != "no"
+FILES=         wpa_supplicant.conf
+FILESDIR=      /usr/share/examples/wpa_supplicant
+.endif
+
+.include <bsd.prog.mk>
diff -r a08b9c4ac47d -r da98a786ea13 share/examples/wpa_supplicant/wpa_supplicant.conf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/wpa_supplicant/wpa_supplicant.conf Thu Jan 23 07:26:50 2014 +0000
@@ -0,0 +1,107 @@
+# example wpa_supplicant config
+#
+# please refer to the wpa_supplicant.conf man page
+
+# wpa_cli and dhcpcd won't work well if you have no ctrl_interface set
+# the value must be a directory, the sockets will be named after the interfaces
+ctrl_interface=/var/run/wpa_supplicant/
+
+# if non-root should be allowed to send wpa_supplicant commands via wpa_cli
+# name a group whose members will be Allowed(tm)
+ctrl_interface_group=wheel
+
+# WEP .. all the stopping power of a "please keep off the lawn" sign
+# least common denominator "security" so it's formally not open
+network={
+       ssid="TheLawn"
+       key_mgmt=NONE
+       wep_tx_keyidx=0
+       #wep_key0="pleasekeepoff"
+       wep_key0=706c656173656b6565706f6666
+       priority=2
+}
+
+# simple WPA-PSK, a favourite with conferences and hotel networks
+network={
+       ssid="SomeConference"
+       key_mgmt=WPA-PSK
+       psk="secretKey"
+}
+
+# using eduroam for more examples:
+
+## eduroam with PEAP/MSCHAPv2
+#network={
+#      ssid="eduroam"
+#      scan_ssid=1
+#
+#      # The 'identity' is the username used for authentication.
+#      identity="user1234@your.university.domain"
+#
+#      # add yours
+#      password="myPassword"
+#
+#      # download a fitting CA cert and put the path to it here
+#      ca_cert="/etc/openssl/certs/eduroam-CA-cert.pem"
+#
+#      # where the authentication requests should be routed to
+#      anonymous_identity="anonymous@your.university.domain"
+#
+#      key_mgmt=WPA-EAP
+#      auth_alg=OPEN
+#      eap=PEAP
+#      phase2="auth=MSCHAPv2"
+#
+#      priority=5
+#}
+#
+## eduroam with EAP-TLS
+#network={
+#      ssid="eduroam"
+#      scan_ssid=1
+#
+#      # The 'identity' is the username used for authentication.
+#      identity="user1234@your.university.domain"
+#
+#      client_cert="/home/you/eduroam/user.cert"
+#      private_key="/home/you/eduroam/user.key"
+#      private_key_passwd="s3kr3t"
+#
+#      # download a fitting CA cert and put the path to it here
+#      ca_cert="/etc/openssl/certs/eduroam-CA-cert.pem"
+#
+#      # where the authentication requests should be routed to
+#      anonymous_identity="anonymous@your.university.domain"
+#
+#      key_mgmt=WPA-EAP
+#      auth_alg=OPEN
+#      eap=TLS
+#
+#      priority=4
+#}
+#
+## eduroam with TTLS+PAP
+#network={
+#      ssid="eduroam"
+#      scan_ssid=1
+#
+#      # The 'identity' is the username used for authentication.
+#      identity="user1234@your.university.domain"
+#
+#      # add yours
+#      password="myPassword"
+#
+#      # download a fitting CA cert and put the path to it here
+#      ca_cert="/etc/openssl/certs/eduroam-CA-cert.pem"
+#
+#      # where the authentication requests should be routed to
+#      anonymous_identity="anonymous@your.university.domain"
+#
+#      key_mgmt=WPA-EAP
+#      auth_alg=OPEN
+#      eap=TTLS
+#      phase2="auth=PAP"
+#
+#      priority=3
+#}
+#



Home | Main Index | Thread Index | Old Index