diff --git a/packages/linux/unpack b/packages/linux/unpack index 2af086ee19..db6925318a 100755 --- a/packages/linux/unpack +++ b/packages/linux/unpack @@ -31,6 +31,19 @@ if [ "$DEVTOOLS" = yes ]; then echo "CONFIG_FONTS=n" >> $LINUX/.config fi +if [ "$PPP_DAEMON" = yes ]; then + echo "CONFIG_PPP=m" >> $LINUX/.config + echo "CONFIG_PPP_MULTILINK=n" >> $LINUX/.config + echo "CONFIG_PPP_FILTER=n" >> $LINUX/.config + echo "CONFIG_PPP_ASYNC=m" >> $LINUX/.config + echo "CONFIG_PPP_SYNC_TTY=m" >> $LINUX/.config + echo "CONFIG_PPP_DEFLATE=n" >> $LINUX/.config + echo "CONFIG_PPP_BSDCOMP=n" >> $LINUX/.config + echo "CONFIG_PPP_MPPE=n" >> $LINUX/.config + echo "CONFIG_PPPOE=y" >> $LINUX/.config + echo "CONFIG_PPPOL2TP=n" >> $LINUX/.config +fi + # copy some extra firmware to linux tree cp -R $PKG_DIR/firmware/* $LINUX/firmware diff --git a/packages/network/install b/packages/network/install index 4828f7ca81..47719cc726 100755 --- a/packages/network/install +++ b/packages/network/install @@ -7,3 +7,5 @@ $SCRIPTS/install dropbear #$SCRIPTS/install wicd $SCRIPTS/install wireless_tools $SCRIPTS/install wpa_supplicant + +[ "$PPP_DAEMON" = yes ] && $SCRIPTS/install ppp diff --git a/packages/network/ppp/build b/packages/network/ppp/build new file mode 100755 index 0000000000..1c42b198b6 --- /dev/null +++ b/packages/network/ppp/build @@ -0,0 +1,14 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +cd $PKG_BUILD + +./configure + +sed -i "s/^FILTER=y/#FILTER=y/" pppd/Makefile + +make CC="$TARGET_CC" COPTS="$TARGET_CFLAGS" + diff --git a/packages/network/ppp/config/adsl.sample b/packages/network/ppp/config/adsl.sample new file mode 100644 index 0000000000..057795f72c --- /dev/null +++ b/packages/network/ppp/config/adsl.sample @@ -0,0 +1,21 @@ +plugin /etc/ppp/plugins/rp-pppoe.so +# Ethernet interface name +eth0 +# Your username at the ISP +#user "" + +# What should be in the second column in /etc/ppp/*-secrets +remotename "chap" +# If needed, specify the service and the access concentrator name +# rp_pppoe_service "internet" +# rp_pppoe_ac "ac1" + +# The settings below usually don't need to be changed +noauth +hide-password +updetach +debug +defaultroute +noipdefault +usepeerdns + diff --git a/packages/network/ppp/init.d/44_adsl b/packages/network/ppp/init.d/44_adsl new file mode 100755 index 0000000000..c3b6dcb561 --- /dev/null +++ b/packages/network/ppp/init.d/44_adsl @@ -0,0 +1,53 @@ +#!/bin/sh + +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +# start pppoe connection +# +# runlevels: openelec, textmode + +. /etc/profile + +progress "Starting pppoe connection" + + +ifconfig eth0 up +echo "nameserver 8.8.8.8" >> /var/cache/resolv.conf +echo "nameserver 8.8.4.4" >> /var/cache/resolv.conf + +cp /etc/ppp/chap-secrets.sample /storage/.config/ +cp /etc/ppp/pap-secrets.sample /storage/.config/ +cp /etc/ppp/peers/adsl.sample /storage/.config/ + + + + + +cp /storage/.config/chap-secrets /var/cache +cp /storage/.config/pap-secrets /var/cache +cp /storage/.config/adsl /var/cache + +modprobe ppp_generic +modprobe ppp_async +modprobe pppoe +pppd call adsl + +sleep 5 diff --git a/packages/network/ppp/install b/packages/network/ppp/install new file mode 100755 index 0000000000..def26a62eb --- /dev/null +++ b/packages/network/ppp/install @@ -0,0 +1,39 @@ +#!/bin/sh + +. config/options + +PKG_DIR=`find $PACKAGES -type d -name $1` + +mkdir -p $INSTALL/etc/ppp + cp $PKG_BUILD/etc.ppp/chap-secrets $INSTALL/etc/ppp/chap-secrets.sample + cp $PKG_BUILD/etc.ppp/pap-secrets $INSTALL/etc/ppp/pap-secrets.sample + +# /etc/ppp/chap-secrets and /etc/ppp/pap-secets must be writeable + ln -sf /var/cache/chap-secrets $INSTALL/etc/ppp/chap-secrets + ln -sf /var/cache/pap-secrets $INSTALL/etc/ppp/pap-secrets + +#/etc/ppp/peers/adsl must be writeable + ln -sf /var/cache/adsl $INSTALL/etc/ppp/peers/adsl + +mkdir -p $INSTALL/etc/ppp/peers + cp $PKG_DIR/config/adsl.sample $INSTALL/etc/ppp/peers/ + +mkdir -p $INSTALL/etc/ppp/plugins + cp $PKG_BUILD/pppd/plugins/rp-pppoe/rp-pppoe.so $INSTALL/etc/ppp/plugins + +mkdir -p $INSTALL/usr/sbin + cp $PKG_DIR/scripts/pppoe-setup $INSTALL/usr/sbin + + cp $PKG_BUILD/scripts/ppp-on $INSTALL/usr/sbin/pon + cp $PKG_BUILD/scripts/ppp-off $INSTALL/usr/sbin/poff + cp $PKG_BUILD/scripts/ppp-on-dialer $INSTALL/usr/sbin + cp $PKG_BUILD/scripts/plog $INSTALL/usr/sbin + cp $PKG_BUILD/chat/chat $INSTALL/usr/sbin + cp $PKG_BUILD/pppd/pppd $INSTALL/usr/sbin + cp $PKG_BUILD/pppd/plugins/rp-pppoe/pppoe-discovery $INSTALL/usr/sbin/ + cp $PKG_BUILD/pppdump/pppdump $INSTALL/usr/sbin + cp $PKG_BUILD/pppstats/pppstats $INSTALL/usr/sbin + +mkdir -p $INSTALL/usr/lib/pppd/2.4.5 + cp $PKG_BUILD/pppd/plugins/*.so $INSTALL/usr/lib/pppd/2.4.5 + diff --git a/packages/network/ppp/scripts/pppoe-setup b/packages/network/ppp/scripts/pppoe-setup new file mode 100755 index 0000000000..bdb588f3dd --- /dev/null +++ b/packages/network/ppp/scripts/pppoe-setup @@ -0,0 +1,52 @@ +#!/bin/sh + +echo "Adsl configure........." + +while [ true ] ; do + echo "" + echo "USER NAME" + echo "" + printf "%s" ">>> Enter your PPPoE user name (default $user): " + read Uu + + if [ "$Uu" = "" ] ; then + Uu="$user" + fi + + U=`echo $Uu | sed -e "s/&/\\\\\&/g"` + + while [ true ] ; do + echo "" + echo "PASSWORD" + echo "" + + printf "%s" ">>> Please enter your PPPoE password: " + read PWD1 + echo "" + printf "%s" ">>> Please re-enter your PPPoE password: " + read PWD2 + echo "" + + if [ "$PWD1" = "$PWD2" ] ; then + break + fi + + printf "%s" ">>> Sorry, the passwords do not match. Try again? (y/n)" + read ANS + case "$ANS" in + N|No|NO|Non|n|no|non) + echo "OK, quitting. Bye." + exit 1 + esac + done + + + +echo "\"$Uu\" * \"$PWD1\"" > /storage/.config/chap-secrets +cp /storage/.config/chap-secrets /var/cache/ + +echo "\"$Uu\" * \"$PWD1\"" > /storage/.config/pap-secrets +cp /storage/.config/pap-secrets /var/cache/ +exit 0 +done + diff --git a/packages/network/ppp/url b/packages/network/ppp/url new file mode 100644 index 0000000000..a965890a33 --- /dev/null +++ b/packages/network/ppp/url @@ -0,0 +1 @@ +http://ppp.samba.org/ftp/ppp/ppp-2.4.5.tar.gz diff --git a/projects/ION/options b/projects/ION/options index de1b27a6cc..7417da7c68 100644 --- a/projects/ION/options +++ b/projects/ION/options @@ -80,6 +80,9 @@ # build with network support (yes / no) NETWORK="yes" +# build ppp daemon (for configuring adsl etc...) (yes / no) + PPP_DAEMON="no" + # build and install with XBMC webfrontend (yes / no) WEBSERVER="yes" diff --git a/projects/generic/options b/projects/generic/options index 8776aef6be..8488ae9ec3 100644 --- a/projects/generic/options +++ b/projects/generic/options @@ -80,6 +80,9 @@ # build with network support (yes / no) NETWORK="yes" +# build ppp daemon (for configuring adsl etc...) (yes / no) + PPP_DAEMON="no" + # build and install with XBMC webfrontend (yes / no) WEBSERVER="yes" diff --git a/projects/intel/options b/projects/intel/options index 690e1c3b59..31b9262e97 100644 --- a/projects/intel/options +++ b/projects/intel/options @@ -80,6 +80,9 @@ # build with network support (yes / no) NETWORK="yes" +# build ppp daemon (for configuring adsl etc...) (yes / no) + PPP_DAEMON="no" + # build and install with XBMC webfrontend (yes / no) WEBSERVER="yes"