diff options
author | Roy.Li <rongqing.li@windriver.com> | 2013-06-07 10:43:48 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-11 15:38:01 +0100 |
commit | b4ad8ff0d70d1dc952181da404a5ad6c6d4c8d74 (patch) | |
tree | 9ea2e550f98c70f4fe15dd1eb37586cec55ac80c /meta/recipes-connectivity/ppp | |
parent | e486242db83297701803866bea971a2f1a1135fe (diff) | |
download | poky-b4ad8ff0d70d1dc952181da404a5ad6c6d4c8d74.tar.gz |
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>
Diffstat (limited to 'meta/recipes-connectivity/ppp')
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp-2.4.5/copts.patch | 21 | ||||
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp-2.4.5/pap | 22 | ||||
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp-2.4.5/ppp_on_boot | 21 | ||||
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp-2.4.5/provider | 35 | ||||
-rw-r--r-- | meta/recipes-connectivity/ppp/ppp_2.4.5.bb | 16 |
5 files changed, 114 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/copts.patch b/meta/recipes-connectivity/ppp/ppp-2.4.5/copts.patch new file mode 100644 index 0000000000..53ff06e03e --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/copts.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | ppp: use build system CFLAGS when compiling | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Override the hard-coded COPTS make variables with | ||
6 | CFLAGS. Add COPTS into one Makefile that did not | ||
7 | use it. | ||
8 | |||
9 | Signed-off-by: Joe Slater <jslater@windriver.com> | ||
10 | |||
11 | --- a/pppd/plugins/radius/Makefile.linux | ||
12 | +++ b/pppd/plugins/radius/Makefile.linux | ||
13 | @@ -12,7 +12,7 @@ VERSION = $(shell awk -F '"' '/VERSION/ | ||
14 | INSTALL = install | ||
15 | |||
16 | PLUGIN=radius.so radattr.so radrealms.so | ||
17 | -CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON | ||
18 | +CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON | ||
19 | |||
20 | # Uncomment the next line to include support for Microsoft's | ||
21 | # MS-CHAP authentication protocol. | ||
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/pap b/meta/recipes-connectivity/ppp/ppp-2.4.5/pap new file mode 100644 index 0000000000..093c32607a --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/pap | |||
@@ -0,0 +1,22 @@ | |||
1 | # You can use this script unmodified to connect to sites which allow | ||
2 | # authentication via PAP, CHAP and similar protocols. | ||
3 | # This script can be shared among different pppd peer configurations. | ||
4 | # To use it, add something like this to your /etc/ppp/peers/ file: | ||
5 | # | ||
6 | # connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER" | ||
7 | # user YOUR-USERNAME-IN-PAP-SECRETS | ||
8 | # noauth | ||
9 | |||
10 | # Uncomment the following line to see the connect speed. | ||
11 | # It will be logged to stderr or to the file specified with the -r chat option. | ||
12 | #REPORT CONNECT | ||
13 | |||
14 | ABORT BUSY | ||
15 | ABORT VOICE | ||
16 | ABORT "NO CARRIER" | ||
17 | ABORT "NO DIALTONE" | ||
18 | ABORT "NO DIAL TONE" | ||
19 | "" ATZ | ||
20 | OK ATDT\T | ||
21 | CONNECT "" | ||
22 | |||
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/ppp_on_boot b/meta/recipes-connectivity/ppp/ppp-2.4.5/ppp_on_boot new file mode 100644 index 0000000000..9793761840 --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/ppp_on_boot | |||
@@ -0,0 +1,21 @@ | |||
1 | ###!/bin/sh | ||
2 | # | ||
3 | # Rename this file to ppp_on_boot and pppd will be fired up as | ||
4 | # soon as the system comes up, connecting to `provider'. | ||
5 | # | ||
6 | # If you also make this file executable, and replace the first line | ||
7 | # with just "#!/bin/sh", the commands below will be executed instead. | ||
8 | # | ||
9 | |||
10 | # The location of the ppp daemon itself (shouldn't need to be changed) | ||
11 | PPPD=/usr/sbin/pppd | ||
12 | |||
13 | # The default provider to connect to | ||
14 | $PPPD call provider | ||
15 | |||
16 | # Additional connections, which would just use settings from | ||
17 | # /etc/ppp/options.<tty> | ||
18 | #$PPPD ttyS0 | ||
19 | #$PPPD ttyS1 | ||
20 | #$PPPD ttyS2 | ||
21 | #$PPPD ttyS3 | ||
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/provider b/meta/recipes-connectivity/ppp/ppp-2.4.5/provider new file mode 100644 index 0000000000..e74d71a8eb --- /dev/null +++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/provider | |||
@@ -0,0 +1,35 @@ | |||
1 | # example configuration for a dialup connection authenticated with PAP or CHAP | ||
2 | # | ||
3 | # This is the default configuration used by pon(1) and poff(1). | ||
4 | # See the manual page pppd(8) for information on all the options. | ||
5 | |||
6 | # MUST CHANGE: replace myusername@realm with the PPP login name given to | ||
7 | # your by your provider. | ||
8 | # There should be a matching entry with the password in /etc/ppp/pap-secrets | ||
9 | # and/or /etc/ppp/chap-secrets. | ||
10 | user "myusername@realm" | ||
11 | |||
12 | # MUST CHANGE: replace ******** with the phone number of your provider. | ||
13 | # The /etc/chatscripts/pap chat script may be modified to change the | ||
14 | # modem initialization string. | ||
15 | connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********" | ||
16 | |||
17 | # Serial device to which the modem is connected. | ||
18 | /dev/modem | ||
19 | |||
20 | # Speed of the serial line. | ||
21 | 115200 | ||
22 | |||
23 | # Assumes that your IP address is allocated dynamically by the ISP. | ||
24 | noipdefault | ||
25 | # Try to get the name server addresses from the ISP. | ||
26 | usepeerdns | ||
27 | # Use this connection as the default route. | ||
28 | defaultroute | ||
29 | |||
30 | # Makes pppd "dial again" when the connection is lost. | ||
31 | persist | ||
32 | |||
33 | # Do not ask the remote to authenticate. | ||
34 | noauth | ||
35 | |||
diff --git a/meta/recipes-connectivity/ppp/ppp_2.4.5.bb b/meta/recipes-connectivity/ppp/ppp_2.4.5.bb index 6af4e984d2..39354efb17 100644 --- a/meta/recipes-connectivity/ppp/ppp_2.4.5.bb +++ b/meta/recipes-connectivity/ppp/ppp_2.4.5.bb | |||
@@ -25,7 +25,11 @@ SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \ | |||
25 | file://ip-up \ | 25 | file://ip-up \ |
26 | file://ip-down \ | 26 | file://ip-down \ |
27 | file://08setupdns \ | 27 | file://08setupdns \ |
28 | file://92removedns" | 28 | file://92removedns \ |
29 | file://copts.patch \ | ||
30 | file://pap \ | ||
31 | file://ppp_on_boot \ | ||
32 | file://provider " | ||
29 | 33 | ||
30 | SRC_URI[md5sum] = "4621bc56167b6953ec4071043fe0ec57" | 34 | SRC_URI[md5sum] = "4621bc56167b6953ec4071043fe0ec57" |
31 | SRC_URI[sha256sum] = "43317afec9299f9920b96f840414c977f0385410202d48e56d2fdb8230003505" | 35 | SRC_URI[sha256sum] = "43317afec9299f9920b96f840414c977f0385410202d48e56d2fdb8230003505" |
@@ -36,6 +40,11 @@ TARGET_CC_ARCH += " ${LDFLAGS}" | |||
36 | EXTRA_OEMAKE = "STRIPPROG=${STRIP} MANDIR=${D}${datadir}/man/man8 INCDIR=${D}${includedir} LIBDIR=${D}${libdir}/pppd/${PV} BINDIR=${D}${sbindir}" | 40 | EXTRA_OEMAKE = "STRIPPROG=${STRIP} MANDIR=${D}${datadir}/man/man8 INCDIR=${D}${includedir} LIBDIR=${D}${libdir}/pppd/${PV} BINDIR=${D}${sbindir}" |
37 | EXTRA_OECONF = "--disable-strip" | 41 | EXTRA_OECONF = "--disable-strip" |
38 | 42 | ||
43 | # Package Makefile computes CFLAGS, referencing COPTS. | ||
44 | # Typically hard-coded to '-O2 -g' in the Makefile's. | ||
45 | # | ||
46 | EXTRA_OEMAKE += ' COPTS="${CFLAGS}"' | ||
47 | |||
39 | do_install_append () { | 48 | do_install_append () { |
40 | make install-etcppp ETCDIR=${D}/${sysconfdir}/ppp | 49 | make install-etcppp ETCDIR=${D}/${sysconfdir}/ppp |
41 | mkdir -p ${D}${bindir}/ ${D}${sysconfdir}/init.d | 50 | mkdir -p ${D}${bindir}/ ${D}${sysconfdir}/init.d |
@@ -48,6 +57,11 @@ do_install_append () { | |||
48 | install -m 0755 ${WORKDIR}/ip-down ${D}${sysconfdir}/ppp/ | 57 | install -m 0755 ${WORKDIR}/ip-down ${D}${sysconfdir}/ppp/ |
49 | install -m 0755 ${WORKDIR}/08setupdns ${D}${sysconfdir}/ppp/ip-up.d/ | 58 | install -m 0755 ${WORKDIR}/08setupdns ${D}${sysconfdir}/ppp/ip-up.d/ |
50 | install -m 0755 ${WORKDIR}/92removedns ${D}${sysconfdir}/ppp/ip-down.d/ | 59 | install -m 0755 ${WORKDIR}/92removedns ${D}${sysconfdir}/ppp/ip-down.d/ |
60 | mkdir -p ${D}${sysconfdir}/chatscripts | ||
61 | mkdir -p ${D}${sysconfdir}/ppp/peers | ||
62 | install -m 0755 ${WORKDIR}/pap ${D}${sysconfdir}/chatscripts | ||
63 | install -m 0755 ${WORKDIR}/ppp_on_boot ${D}${sysconfdir}/ppp/ppp_on_boot | ||
64 | install -m 0755 ${WORKDIR}/provider ${D}${sysconfdir}/ppp/peers/provider | ||
51 | rm -rf ${D}/${mandir}/man8/man8 | 65 | rm -rf ${D}/${mandir}/man8/man8 |
52 | chmod u+s ${D}${sbindir}/pppd | 66 | chmod u+s ${D}${sbindir}/pppd |
53 | } | 67 | } |