PPP: add default configuration file and fix hard-coded CFLAGS

1. Add three ppp configuration files, make "/etc/init.d/ppp start"
be able to work with little change. provider and pap are adopted from
Ubuntu. ppp_on_boot is adopted from http://www.wlug.org.nz.
2. Use build system CFLAGS when compiling

(From OE-Core rev: 6ab8adf980f90040d3a24dd9c0f12dc04d7aadeb)

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Roy.Li 2013-06-07 10:43:48 +08:00 committed by Richard Purdie
parent e486242db8
commit b4ad8ff0d7
5 changed files with 114 additions and 1 deletions

View File

@ -0,0 +1,21 @@
ppp: use build system CFLAGS when compiling
Upstream-Status: Pending
Override the hard-coded COPTS make variables with
CFLAGS. Add COPTS into one Makefile that did not
use it.
Signed-off-by: Joe Slater <jslater@windriver.com>
--- a/pppd/plugins/radius/Makefile.linux
+++ b/pppd/plugins/radius/Makefile.linux
@@ -12,7 +12,7 @@ VERSION = $(shell awk -F '"' '/VERSION/
INSTALL = install
PLUGIN=radius.so radattr.so radrealms.so
-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
# Uncomment the next line to include support for Microsoft's
# MS-CHAP authentication protocol.

View File

@ -0,0 +1,22 @@
# You can use this script unmodified to connect to sites which allow
# authentication via PAP, CHAP and similar protocols.
# This script can be shared among different pppd peer configurations.
# To use it, add something like this to your /etc/ppp/peers/ file:
#
# connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER"
# user YOUR-USERNAME-IN-PAP-SECRETS
# noauth
# Uncomment the following line to see the connect speed.
# It will be logged to stderr or to the file specified with the -r chat option.
#REPORT CONNECT
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
"" ATZ
OK ATDT\T
CONNECT ""

View File

@ -0,0 +1,21 @@
###!/bin/sh
#
# Rename this file to ppp_on_boot and pppd will be fired up as
# soon as the system comes up, connecting to `provider'.
#
# If you also make this file executable, and replace the first line
# with just "#!/bin/sh", the commands below will be executed instead.
#
# The location of the ppp daemon itself (shouldn't need to be changed)
PPPD=/usr/sbin/pppd
# The default provider to connect to
$PPPD call provider
# Additional connections, which would just use settings from
# /etc/ppp/options.<tty>
#$PPPD ttyS0
#$PPPD ttyS1
#$PPPD ttyS2
#$PPPD ttyS3

View File

@ -0,0 +1,35 @@
# example configuration for a dialup connection authenticated with PAP or CHAP
#
# This is the default configuration used by pon(1) and poff(1).
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"
# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
# Serial device to which the modem is connected.
/dev/modem
# Speed of the serial line.
115200
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth

View File

@ -25,7 +25,11 @@ SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \
file://ip-up \
file://ip-down \
file://08setupdns \
file://92removedns"
file://92removedns \
file://copts.patch \
file://pap \
file://ppp_on_boot \
file://provider "
SRC_URI[md5sum] = "4621bc56167b6953ec4071043fe0ec57"
SRC_URI[sha256sum] = "43317afec9299f9920b96f840414c977f0385410202d48e56d2fdb8230003505"
@ -36,6 +40,11 @@ TARGET_CC_ARCH += " ${LDFLAGS}"
EXTRA_OEMAKE = "STRIPPROG=${STRIP} MANDIR=${D}${datadir}/man/man8 INCDIR=${D}${includedir} LIBDIR=${D}${libdir}/pppd/${PV} BINDIR=${D}${sbindir}"
EXTRA_OECONF = "--disable-strip"
# Package Makefile computes CFLAGS, referencing COPTS.
# Typically hard-coded to '-O2 -g' in the Makefile's.
#
EXTRA_OEMAKE += ' COPTS="${CFLAGS}"'
do_install_append () {
make install-etcppp ETCDIR=${D}/${sysconfdir}/ppp
mkdir -p ${D}${bindir}/ ${D}${sysconfdir}/init.d
@ -48,6 +57,11 @@ do_install_append () {
install -m 0755 ${WORKDIR}/ip-down ${D}${sysconfdir}/ppp/
install -m 0755 ${WORKDIR}/08setupdns ${D}${sysconfdir}/ppp/ip-up.d/
install -m 0755 ${WORKDIR}/92removedns ${D}${sysconfdir}/ppp/ip-down.d/
mkdir -p ${D}${sysconfdir}/chatscripts
mkdir -p ${D}${sysconfdir}/ppp/peers
install -m 0755 ${WORKDIR}/pap ${D}${sysconfdir}/chatscripts
install -m 0755 ${WORKDIR}/ppp_on_boot ${D}${sysconfdir}/ppp/ppp_on_boot
install -m 0755 ${WORKDIR}/provider ${D}${sysconfdir}/ppp/peers/provider
rm -rf ${D}/${mandir}/man8/man8
chmod u+s ${D}${sbindir}/pppd
}