aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh
diff options
context:
space:
mode:
authorEyal Reizer <eyalreizer@googlemail.com>2011-04-21 16:54:12 +0000
committerSteffen Sledz <sledz@dresearch-fe.de>2011-04-29 14:08:38 +0200
commitb9ef48a463f2d156e639b664cc0f2bf1a51a3a5b (patch)
tree17981a0e5c5f48ab8d8fab93cd41f28caf226683 /recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh
parentb3228d1dab7d0cdd080f0d1db497152d1ee9b5ad (diff)
downloadopenembedded-b9ef48a463f2d156e639b664cc0f2bf1a51a3a5b.tar.gz
wpa-supplicant: Build from git sources
* Builds a new version 0.8.x which is not released yet as a zip file. This version has new features like WIFI-direct used in new mac80211 versions * Add PV * Update defconfig Signed-off-by: Eyal Reizer <eyalr@ti.com> Acked-by: Koen Kooi <k-kooi@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh')
-rw-r--r--recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh b/recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh
new file mode 100644
index 0000000000..5c9e5d33a7
--- /dev/null
+++ b/recipes/wpa-supplicant/wpa-supplicant-git/wpa-supplicant.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+
+WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
+WPA_SUP_PNAME="wpa_supplicant"
+WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
+WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"
+
+VERBOSITY=0
+
+
+if [ -s "$IF_WPA_CONF" ]; then
+ WPA_SUP_CONF="-c $IF_WPA_CONF"
+else
+ exit 0
+fi
+
+if [ ! -x "$WPA_SUP_BIN" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
+ fi
+
+ exit 1
+fi
+
+if [ "$MODE" = "start" ] ; then
+ # driver type of interface, defaults to wext when undefined
+ if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
+ IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
+ elif [ -z "$IF_WPA_DRIVER" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
+ fi
+
+ IF_WPA_DRIVER="wext"
+ fi
+
+ # if we have passed the criteria, start wpa_supplicant
+ if [ -n "$WPA_SUP_CONF" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
+ fi
+
+ start-stop-daemon --start --quiet \
+ --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
+ -- $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
+ fi
+
+ # if the interface socket exists, then wpa_supplicant was invoked successfully
+ if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
+ fi
+
+ exit 0
+
+ fi
+
+elif [ "$MODE" = "stop" ]; then
+
+ if [ -f "$WPA_SUP_PIDFILE" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
+ fi
+
+ start-stop-daemon --stop --quiet \
+ --name $WPA_SUP_PNAME --pidfile $WPA_SUP_PIDFILE
+
+ if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+ rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
+ fi
+
+ if [ -f "$WPA_SUP_PIDFILE" ]; then
+ rm -f $WPA_SUP_PIDFILE
+ fi
+ fi
+
+fi
+
+exit 0