[oe-commits] Stefan Schmidt : buglabs-ppp-scripts: Some scripts to enable BUG for different broadband providers

git version control git at git.openembedded.org
Thu Feb 3 22:36:25 UTC 2011


Module: openembedded.git
Branch: ulf/linux-2.6.30-2011-01-16
Commit: 95cad220d72437dfc5390525d6910cc9222706b2
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=95cad220d72437dfc5390525d6910cc9222706b2

Author: Stefan Schmidt <stefan at buglabs.net>
Date:   Thu Dec  9 16:09:08 2010 +0100

buglabs-ppp-scripts: Some scripts to enable BUG for different broadband providers

---

 recipes/buglabs/buglabs-ppp-scripts/att            |   33 ++++++++++++++++
 recipes/buglabs/buglabs-ppp-scripts/att_chat       |   40 ++++++++++++++++++++
 recipes/buglabs/buglabs-ppp-scripts/cdma           |   13 ++++++
 recipes/buglabs/buglabs-ppp-scripts/cdma_chat      |   25 ++++++++++++
 recipes/buglabs/buglabs-ppp-scripts/ip-down.local  |   18 +++++++++
 recipes/buglabs/buglabs-ppp-scripts/ip-up.local    |   26 +++++++++++++
 recipes/buglabs/buglabs-ppp-scripts/tmobile        |   22 +++++++++++
 recipes/buglabs/buglabs-ppp-scripts/tmobile_chat   |   14 +++++++
 .../buglabs/buglabs-ppp-scripts/tmobile_disconnect |    3 +
 recipes/buglabs/buglabs-ppp-scripts_0.2.bb         |   29 ++++++++++++++
 10 files changed, 223 insertions(+), 0 deletions(-)

diff --git a/recipes/buglabs/buglabs-ppp-scripts/att b/recipes/buglabs/buglabs-ppp-scripts/att
new file mode 100755
index 0000000..f940a28
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/att
@@ -0,0 +1,33 @@
+-detach
+lcp-echo-failure 0
+/dev/ttyUSB3
+115200
+debug
+defaultroute
+usepeerdns
+
+#ipcp-no-address
+#ipcp-no-addresses
+ipcp-max-failure 4
+ipcp-accept-local
+ipcp-accept-remote
+#added by John
+lcp-echo-interval 20
+lcp-echo-failure 4
+#persist
+#holdoff 15
+logfile /var/volatile/log/pppd.log
+defaultroute
+replacedefaultroute
+# AUTHENTICATION
+# If noauth works, use that, otherwise you have to pass
+# the user name and password. This is an example of a
+# standard Cingular user/pw combo
+
+noauth
+#user ISPDA at CINGULARGPRS.COM
+#password CINGULAR1
+
+crtscts
+lock
+connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/att_chat'
diff --git a/recipes/buglabs/buglabs-ppp-scripts/att_chat b/recipes/buglabs/buglabs-ppp-scripts/att_chat
new file mode 100755
index 0000000..2c671ae
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/att_chat
@@ -0,0 +1,40 @@
+# Connection script for Sierra Wireless GSM/UMTS modems
+# Note: This demo script is setup to work on the Cingular EDGE network
+#
+SAY 'Starting Sierra Wireless GSM connect script...\n'
+SAY '\n'
+
+#######################################
+SAY 'Setting the abort string\n'
+SAY '\n'
+# Abort String ------------------------------
+ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
+
+#######################################
+SAY 'Initializing modem\n'
+# Modem Initialization 
+'' AT
+OK ATZ
+
+#######################################
+SAY '\n'
+SAY     'Setting APN\n'
+# Access Point Name (APN) 
+# Incorrect APN or CGDCONT can often cause errors in connection.
+# Below are a bunch of different popular APNs
+
+#REG:\s1 AT+cgdcont=1,"IP","proxy"
+#OK     'AT+CGDCONT=0,"IP","proxy"'
+#OK     'AT+CGDCONT=1,"IP","proxy"'
+#OK     'AT+CGDCONT=2,"IP","proxy"'
+#OK     'AT+CGDCONT=0,"IP","ISP.CINGULAR"'
+OK     'AT+CGDCONT=1,"IP","WAP.CINGULAR"'
+#OK     'AT+CGDCONT=2,"IP","ISP.CINGULAR"'
+
+#######################################
+SAY '\n'
+SAY     'Dialing...\n'
+# Dial the ISP, this is the common Cingular dial string
+
+OK ATD*99#
+CONNECT ''
diff --git a/recipes/buglabs/buglabs-ppp-scripts/cdma b/recipes/buglabs/buglabs-ppp-scripts/cdma
new file mode 100755
index 0000000..ec31f2b
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/cdma
@@ -0,0 +1,13 @@
+-detach
+lcp-echo-failure 0
+noauth
+/dev/ttyUSB0
+115200
+debug
+defaultroute
+ipcp-accept-local
+ipcp-accept-remote
+usepeerdns
+crtscts
+lock
+connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/cdma_chat'
diff --git a/recipes/buglabs/buglabs-ppp-scripts/cdma_chat b/recipes/buglabs/buglabs-ppp-scripts/cdma_chat
new file mode 100755
index 0000000..5445454
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/cdma_chat
@@ -0,0 +1,25 @@
+# Connection script for Sierra Wireless CDMA/EVDO modems
+# Note: This demo script is setup to work on Verizon and Sprint
+#       Networks.
+#
+SAY 'Starting Sierra Wireless CDMA connect script...\n'
+SAY '\n'
+
+#######################################
+SAY 'Setting the abort string\n'
+SAY '\n'
+# Abort String ------------------------------
+ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
+
+#######################################
+SAY 'Initializing modem\n'
+# Modem Initialization 
+'' AT
+OK ATZ
+
+#######################################
+SAY '\n'
+SAY     'Dialing...\n'
+OK ATDT#777
+CONNECT ''
+
diff --git a/recipes/buglabs/buglabs-ppp-scripts/ip-down.local b/recipes/buglabs/buglabs-ppp-scripts/ip-down.local
new file mode 100755
index 0000000..568c1b6
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/ip-down.local
@@ -0,0 +1,18 @@
+#!/bin/bash
+# latest-kernel-support: 2.6.18
+# Author: Kevin Lloyd <linux at sierrawireless.com>
+# Date: 10/20/2006
+
+if [ $# -eq 0 ]; then
+  exit 1
+fi
+
+if [ $1 = ppp0 ]; then
+  mv -f /etc/resolv.conf /etc/resolv.conf.ppp0
+  if [ -e /etc/resolv.conf.orig ]; then
+    cp /etc/resolv.conf.orig /etc/resolv.conf
+  else
+    grep -v ppp0 /etc/resolv.conf.ppp0 > /etc/resolv.conf
+  fi
+  chmod a+r /etc/resolv.conf
+fi
diff --git a/recipes/buglabs/buglabs-ppp-scripts/ip-up.local b/recipes/buglabs/buglabs-ppp-scripts/ip-up.local
new file mode 100755
index 0000000..7cf2345
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/ip-up.local
@@ -0,0 +1,26 @@
+#!/bin/bash
+# latest-kernel-support: 2.6.18
+# Author: Kevin Lloyd <linux at sierrawireless.com>
+# Date: 10/20/2006
+
+if [ $# -eq 0 ]; then
+  exit 1
+fi
+
+if [ $1 = ppp0 ]; then
+  if [ -e /var/run/ppp/resolv.conf ]; then
+    grep -v ppp0 /etc/resolv.conf > /etc/resolv.conf.orig
+
+    echo \#These entries are from the ppp0 connection > /etc/resolv.conf
+    sed -e 's/$/ #ppp0 entry/g' /var/run/ppp/resolv.conf >> /etc/resolv.conf
+    cat /etc/resolv.conf.orig >> /etc/resolv.conf
+    chmod a+r /etc/resolv.conf
+  elif [ -e /etc/ppp/resolv.conf ]; then
+    grep -v ppp0 /etc/resolv.conf > /etc/resolv.conf.orig
+
+    echo \#These entries are from the ppp0 connection > /etc/resolv.conf
+    sed -e 's/$/ #ppp0 entry/g' /etc/ppp/resolv.conf >> /etc/resolv.conf
+    cat /etc/resolv.conf.orig >> /etc/resolv.conf
+    chmod a+r /etc/resolv.conf
+  fi
+fi
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile b/recipes/buglabs/buglabs-ppp-scripts/tmobile
new file mode 100644
index 0000000..e547f79
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/tmobile
@@ -0,0 +1,22 @@
+# File: /etc/ppp/peers/tmobile
+#
+/dev/ttyUSB3
+115200
+crtscts
+lock
+hide-password
+defaultroute # set the default route
+usepeerdns
+holdoff 3
+ipcp-accept-local
+lcp-echo-failure 12
+lcp-echo-interval 3
+noauth
+noipdefault
+novj
+novjccomp
+replacedefaultroute
+debug
+
+connect "/usr/sbin/chat -v -f /etc/ppp/peers/tmobile_chat"
+disconnect "/usr/sbin/chat -v -f /etc/ppp/peers/tmobile_disconnect
\ No newline at end of file
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile_chat b/recipes/buglabs/buglabs-ppp-scripts/tmobile_chat
new file mode 100644
index 0000000..d9e2ec8
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/tmobile_chat
@@ -0,0 +1,14 @@
+TIMEOUT 10
+ABORT 'BUSY'
+ABORT 'NO ANSWER'
+ABORT 'ERROR'
+SAY 'Starting GPRS connect script\n'
+
+""'ATZ'
+SAY 'Setting APN\n'
+OK 'AT+CGDCONT=1,"IP","internet2.voicestream.com"'
+
+ABORT 'NO CARRIER'
+SAY 'Dialing...\n'
+OK 'ATD*99***1#'
+CONNECT 
diff --git a/recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect b/recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect
new file mode 100644
index 0000000..f1302e2
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts/tmobile_disconnect
@@ -0,0 +1,3 @@
+"" "\K"
+"" "+++ATH0"
+SAY "GPRS disconnected."
\ No newline at end of file
diff --git a/recipes/buglabs/buglabs-ppp-scripts_0.2.bb b/recipes/buglabs/buglabs-ppp-scripts_0.2.bb
new file mode 100644
index 0000000..5dad570
--- /dev/null
+++ b/recipes/buglabs/buglabs-ppp-scripts_0.2.bb
@@ -0,0 +1,29 @@
+DESCRIPTION = "PPP Scripts for BUG"
+LICENSE = "GPL"
+RDEPENDS_${PN} = "udev"
+PR = "r0"
+
+SRC_URI = "file://att \
+	file://att_chat \
+	file://ip-down.local \
+	file://ip-up.local \
+	file://cdma \
+	file://cdma_chat \
+	file://tmobile \
+	file://tmobile_chat \
+	file://tmobile_disconnect \
+	"
+
+S = ${WORKDIR}
+
+PACKAGE_ARCH = "all"
+
+do_install() {
+    install -d ${D}/etc
+    install -d ${D}/etc/ppp
+    install -d ${D}/etc/ppp/peers
+    install -m 0644 att* ${D}/etc/ppp/peers
+    install -m 0644 ip* ${D}/etc/ppp
+    install -m 0644 tmobile* ${D}/etc/ppp/peers
+    install -m 0644 cdma* ${D}/etc/ppp/peers/
+}





More information about the Openembedded-commits mailing list