diff options
author | Jesse Gilles <jgilles@multitech.com> | 2014-11-04 11:51:34 -0600 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2014-11-04 11:51:34 -0600 |
commit | e243c30f04c18722dc65effe6d4f275a3f35de46 (patch) | |
tree | 807610ce8af0ead02681d6c3cc89d902ec941652 /recipes-core/multitech/config | |
download | meta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.tar.gz meta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.tar.bz2 meta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.zip |
initial commit of mLinux layer
Diffstat (limited to 'recipes-core/multitech/config')
-rw-r--r-- | recipes-core/multitech/config/config.init | 105 | ||||
-rw-r--r-- | recipes-core/multitech/config/network/interfaces | 29 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/chap-secrets | 3 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/options | 22 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/pap-secrets | 3 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/peers/cdma | 9 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/peers/cdma_chat | 18 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/peers/gsm | 11 | ||||
-rw-r--r-- | recipes-core/multitech/config/ppp/peers/gsm_chat | 26 |
9 files changed, 226 insertions, 0 deletions
diff --git a/recipes-core/multitech/config/config.init b/recipes-core/multitech/config/config.init new file mode 100644 index 0000000..874416c --- /dev/null +++ b/recipes-core/multitech/config/config.init @@ -0,0 +1,105 @@ +#!/bin/sh + +CONFIG_MTDC=/dev/mtd6 +CONFIG_MTDB=/dev/mtdblock6 +CONFIG_DIR=/var/config + +OEM_MTDC=/dev/mtd7 +OEM_MTDB=/dev/mtdblock7 +OEM_DIR=/var/oem + +FILES="network/interfaces \ +ppp/options \ +ppp/pap-secrets \ +ppp/chap-secrets \ +ppp/peers \ +" + +mount_config() { + echo "Mounting ${CONFIG_DIR}" + mkdir -p ${CONFIG_DIR} + mount ${CONFIG_DIR} + + # Prepare flash for JFFS2 if mount fails + if [ $? -ne 0 ]; then + echo "Creating ${CONFIG_DIR}" + flash_erase -j ${CONFIG_MTDC} 0 0 + mount ${CONFIG_DIR} + fi +} + +mount_oem() { + echo "Mounting ${OEM_DIR}" + mkdir -p ${OEM_DIR} + mount ${OEM_DIR} + + # Prepare flash for JFFS2 if mount fails + if [ $? -ne 0 ]; then + echo "Creating ${OEM_DIR}" + flash_erase -j ${OEM_MTDC} 0 0 + mount ${OEM_DIR} + fi +} + +case $1 in + start) + # mount config if not already mounted + if ! grep -q "^${CONFIG_MTDB} " /proc/mounts; then + mount_config + else + echo "$CONFIG_DIR already mounted" + fi + + # mount oem if specified in /etc/fstab and it isn't already mounted + if grep -qE "^${OEM_MTDB}\s+${OEM_DIR}\s+" /etc/fstab; then + if ! grep -q "^${OEM_MTDB} " /proc/mounts; then + mount_oem + else + echo "$OEM_DIR already mounted" + fi + fi + + # Default all config files if requested + cd ${CONFIG_DIR} + if [ -f force_defaults ]; then + echo "Extracting default config files" + tar -xvf /etc/defaults.tar.gz + + if [ -f /etc/default_pass ]; then + echo "Defaulting root password" + PASSHASH=`cat /etc/default_pass` + PASSFILE=/etc/shadow + if [ ! -e /etc/shadow ]; then + PASSFILE=/etc/passwd + fi + sed -i "s%^root:[^:]*:%root:${PASSHASH}:%" $PASSFILE + fi + + rm -f force_defaults + fi + + # Extract any missing files + TARFILES=`tar -tf /etc/defaults.tar.gz` + for file in $TARFILES; do + if [ ! -e $file ]; then + tar -xvf /etc/defaults.tar.gz $file + fi + done + + # Create links in /etc + for file in $FILES; do + if [ ! -L /etc/$file ]; then + echo "Creating link to ${CONFIG_DIR}/$file" + rm -rf /etc/$file + ln -sf ${CONFIG_DIR}/$file /etc/$file + fi + done + + ;; + + *) + echo "Usage: $0 {start}" + exit 2 + ;; + +esac diff --git a/recipes-core/multitech/config/network/interfaces b/recipes-core/multitech/config/network/interfaces new file mode 100644 index 0000000..546fd29 --- /dev/null +++ b/recipes-core/multitech/config/network/interfaces @@ -0,0 +1,29 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wired interface +auto eth0 +iface eth0 inet static +address 192.168.2.1 +netmask 255.255.255.0 + +# Bridge interface with eth0 (comment out eth0 lines above to use with bridge) +# iface eth0 inet manual +# +# auto br0 +# iface br0 inet static +# bridge_ports eth0 +# address 192.168.2.1 +# netmask 255.255.255.0 + +# Wifi client +# NOTE: udev rules will bring up wlan0 automatically if a wifi device is detected +# and the wlan0 interface is defined, therefore an "auto wlan0" line is not needed. +# If "auto wlan0" is also specified, startup conflicts may result. +#iface wlan0 inet dhcp +#wpa-conf /var/config/wpa_supplicant.conf +#wpa-driver nl80211 + diff --git a/recipes-core/multitech/config/ppp/chap-secrets b/recipes-core/multitech/config/ppp/chap-secrets new file mode 100644 index 0000000..60efe8f --- /dev/null +++ b/recipes-core/multitech/config/ppp/chap-secrets @@ -0,0 +1,3 @@ +# Secrets for authentication using CHAP +# client server secret IP addresses +* * "" * diff --git a/recipes-core/multitech/config/ppp/options b/recipes-core/multitech/config/ppp/options new file mode 100644 index 0000000..34654c1 --- /dev/null +++ b/recipes-core/multitech/config/ppp/options @@ -0,0 +1,22 @@ +# Select tty device +# +# First modem AT command port (symlink to actual device) +/dev/modem_at0 + +# Uncomment below to run in foreground +#nodetach + +# Uncomment below to emit debug +#debug + +# Uncomment to keep pppd up if the connection terminates +#persist +# Uncomment for unlimited connection attempts +#maxfail 0 + +# disable logging to /etc/ppp/connect-errors +# and only log to syslog +logfile /dev/null + +lock + diff --git a/recipes-core/multitech/config/ppp/pap-secrets b/recipes-core/multitech/config/ppp/pap-secrets new file mode 100644 index 0000000..f782b4a --- /dev/null +++ b/recipes-core/multitech/config/ppp/pap-secrets @@ -0,0 +1,3 @@ +# Secrets for authentication using PAP +# client server secret IP addresses +* * "" * diff --git a/recipes-core/multitech/config/ppp/peers/cdma b/recipes-core/multitech/config/ppp/peers/cdma new file mode 100644 index 0000000..3fc231f --- /dev/null +++ b/recipes-core/multitech/config/ppp/peers/cdma @@ -0,0 +1,9 @@ +linkname ppp0 +230400 +defaultroute +replacedefaultroute +usepeerdns +noauth +crtscts +novj +connect '/usr/sbin/chat -v -t 90 -f /etc/ppp/peers/cdma_chat' diff --git a/recipes-core/multitech/config/ppp/peers/cdma_chat b/recipes-core/multitech/config/ppp/peers/cdma_chat new file mode 100644 index 0000000..6ff750e --- /dev/null +++ b/recipes-core/multitech/config/ppp/peers/cdma_chat @@ -0,0 +1,18 @@ +SAY "CDMA chat\n" +ECHO OFF +ABORT 'NO DIAL TONE' +ABORT 'NO DIALTONE' +ABORT 'NO ANSWER' +ABORT 'NO CARRIER' +ABORT 'DELAYED' +ABORT 'VOICE' +ABORT 'BUSY' +'' 'AT' +OK 'ATZ' +OK 'AT+CSQ' +SAY "Dialing...\n" +OK 'ATD#777' +SAY "Waiting for CONNECT...\n" +TIMEOUT 120 +CONNECT '' +SAY "Connected\n" diff --git a/recipes-core/multitech/config/ppp/peers/gsm b/recipes-core/multitech/config/ppp/peers/gsm new file mode 100644 index 0000000..d23957e --- /dev/null +++ b/recipes-core/multitech/config/ppp/peers/gsm @@ -0,0 +1,11 @@ +linkname ppp0 +230400 +defaultroute +replacedefaultroute +usepeerdns +ipcp-max-failure 10 +ipcp-restart 10 +noauth +crtscts +novj +connect '/usr/sbin/chat -v -t 90 -f /etc/ppp/peers/gsm_chat' diff --git a/recipes-core/multitech/config/ppp/peers/gsm_chat b/recipes-core/multitech/config/ppp/peers/gsm_chat new file mode 100644 index 0000000..5e18e05 --- /dev/null +++ b/recipes-core/multitech/config/ppp/peers/gsm_chat @@ -0,0 +1,26 @@ +SAY "GSM chat\n" +ECHO OFF +ABORT 'NO DIAL TONE' +ABORT 'NO DIALTONE' +ABORT 'NO ANSWER' +ABORT 'NO CARRIER' +ABORT 'DELAYED' +ABORT 'VOICE' +ABORT 'BUSY' +'' 'AT' +OK 'ATZ' +OK 'AT+CSQ' +# ---------------------------------- +# Set the APN for your provider here +# ---------------------------------- +#OK 'AT+CGDCONT=1,"IP","proxy"' +#OK 'AT+CGDCONT=1,"IP","ISP.CINGULAR"' +#OK 'AT+CGDCONT=1,"IP","internet2.voicestream.com"' +OK 'AT+CGDCONT=1,"IP","internet"' +SAY "Dialing...\n" +#OK 'ATD*99#' +OK 'ATD*99***1#' +SAY "Waiting for CONNECT...\n" +TIMEOUT 120 +CONNECT '' +SAY "Connected\n" |