[oe-commits] Chia-I Wu : fastboot: wireless-tools: Make zzz-wireless. if-pre-up only for dhcp.
GIT User account
git at amethyst.openembedded.net
Tue Dec 23 13:38:28 UTC 2008
Module: openembedded.git
Branch: john_lee/fastboot-devel
Commit: 011491402b1fbcc1d5a0a8d31660c3bf9fa50ed0
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=011491402b1fbcc1d5a0a8d31660c3bf9fa50ed0
Author: Chia-I Wu <olv at openmoko.com>
Date: Thu Oct 30 16:16:33 2008 +0800
fastboot: wireless-tools: Make zzz-wireless.if-pre-up only for dhcp.
---
.../wireless-tools/openmoko/zzz-wireless.if-pre-up | 34 ++++++++++++++++++++
packages/wireless-tools/wireless-tools_29.bb | 2 +-
2 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/packages/wireless-tools/wireless-tools/openmoko/zzz-wireless.if-pre-up b/packages/wireless-tools/wireless-tools/openmoko/zzz-wireless.if-pre-up
new file mode 100644
index 0000000..85fcc87
--- /dev/null
+++ b/packages/wireless-tools/wireless-tools/openmoko/zzz-wireless.if-pre-up
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# /etc/network/if-pre-up.d/zzz-wireless
+# by Stefan Tomanek (stefan at pico.ruhr.de)
+
+
+IWCONFIG=/sbin/iwconfig
+IFCONFIG=/sbin/ifconfig
+GREP=/bin/grep
+LOGGER=/usr/bin/logger
+SLEEP=/bin/sleep
+
+# How long do we wait for association?
+RETRIES=15
+SLEEPTIME=1
+
+# Only sleep if we use DHCP (add others methods seperated by spaces)
+ONLY_FOR="dhcp"
+
+if [ -z "$IF_WIRELESS_TYPE" ] && echo "$ONLY_FOR" | grep -q "$METHOD" ; then
+ $IFCONFIG $IFACE up
+ $LOGGER Checking for WLAN association...
+ while ( [ $RETRIES -gt 0 ] && ($IWCONFIG "$IFACE" | $GREP -q "Access Point: Not-Associated") ); do
+ $LOGGER No association yet, $RETRIES retries until timeout
+ RETRIES=$(($RETRIES-1))
+ $SLEEP $SLEEPTIME
+ done
+
+ if [ $RETRIES -eq 0 ]; then
+ $LOGGER Timeout waiting for association, continuing anyway...
+ else
+ $LOGGER Found association!
+ fi
+fi
diff --git a/packages/wireless-tools/wireless-tools_29.bb b/packages/wireless-tools/wireless-tools_29.bb
index 7f08db8..e5c498b 100644
--- a/packages/wireless-tools/wireless-tools_29.bb
+++ b/packages/wireless-tools/wireless-tools_29.bb
@@ -1,3 +1,3 @@
require wireless-tools.inc
-PR = "r0"
+PR = "r1"
More information about the Openembedded-commits
mailing list