Skip to contentSkip to conversation

openl2tp: several fixes

PATCH New [email protected] 1 participant 3 messages Jul 28, 2017

lore
Share & tools
lore
#0 lore raw

cover openl2tp: several fixes

From: Jackie Huang <[email protected]>

---
The following changes since commit a8b54e300be027fefe8a774ca1861d0fb8e80d99:

pidgin-otr: unblacklist (2017-07-24 18:58:55 +0200)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib.git jhuang0/r_up_openl2tp_170728_0
http://git.pokylinux.org/cgit.cgi//log/?h=jhuang0/r_up_openl2tp_170728_0

Jackie Huang (2):
openl2tp: add LGPL-2.1 license
openl2tp: add init script and systemd support

 .../openl2tpd-initscript-fix-sysconfig.patch       | 35 ++++++++++++++++
 .../openl2tpd-initscript-fix-warning.patch         | 32 ++++++++++++++
 .../openl2tp/openl2tpd-initscript-fix.patch        | 49 ++++++++++++++++++++++
 .../openl2tp/openl2tp/openl2tpd.service            | 17 ++++++++
 .../recipes-protocols/openl2tp/openl2tp_1.8.bb     | 40 ++++++++++++++++--
 5 files changed, 170 insertions(+), 3 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 openl2tp: add LGPL-2.1 license

From: Jackie Huang <[email protected]>

cli and usl use license LGPL-2.1.

---
 meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb +9 -2
index e1670b3ae..9be1c7956 100644
@@ -7,8 +7,15 @@ different configuration. It is used by several ISPs to provide \
 L2TP services and by corporations to implement L2TP VPNs."
 HOMEPAGE = "http://www.openl2tp.org/"
 SECTION = "net"
-LICENSE = "GPL-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585"
+
+# cli and usl use license LGPL-2.1
+LICENSE = "GPL-2.0 & LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585 \
+                    file://LICENSE;md5=f8970abd5ea9be701a0deedf5afd77a5 \
+                    file://cli/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \
+                    file://usl/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \
+                    "
+
 DEPENDS = "popt flex readline"
 
 SRC_URI = "ftp://ftp.openl2tp.org/releases/${BP}/${BP}.tar.gz \
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 openl2tp: add init script and systemd support

In reply to [email protected]

From: Jackie Huang <[email protected]>

- Add patches to fix init script issues
- Add openl2tpd.service to add systemd support
- Add runtime dependency on ppp and ppp-l2tp

---
 .../openl2tpd-initscript-fix-sysconfig.patch       | 35 ++++++++++++++++
 .../openl2tpd-initscript-fix-warning.patch         | 32 ++++++++++++++
 .../openl2tp/openl2tpd-initscript-fix.patch        | 49 ++++++++++++++++++++++
 .../openl2tp/openl2tp/openl2tpd.service            | 17 ++++++++
 .../recipes-protocols/openl2tp/openl2tp_1.8.bb     | 29 ++++++++++++-
 5 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch
 create mode 100644 meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service
meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch new file +35 -0
new file mode 100644
index 000000000..3119425e6
@@ -0,0 +1,35 @@
+commit 6ea3125e2bec15004f312814022335d94cdf7e94
+Author: Aws Ismail <[email protected]>
+Date:   Wed Sep 19 11:34:48 2012 -0400
+
+    Fix openl2tp config script location
+    
+    Correct the location of the sysconfig
+    script. Use /etc/default/ instead of
+    /etc/sysconfig/
+    
+    Signed-off-by: Aws Ismail <[email protected]>
+
+    Upstream-Status: Inappropriate [configuration]
+
+    Signed-off-by: Jackie Huang <[email protected]>
+
+diff --git a/etc/rc.d/init.d/openl2tpd b/etc/rc.d/init.d/openl2tpd
+index 7f27bb7..4194f63 100755
+--- a/etc/rc.d/init.d/openl2tpd
++++ b/etc/rc.d/init.d/openl2tpd
+@@ -8,12 +8,12 @@
+ #              can be used to implement L2TP VPNs. As a server, it can handle
+ #              hundreds of tunnels and sessions.
+ # processname: openl2tpd
+-# config: /etc/sysconfig/openl2tpd
++# config: /etc/default/openl2tpd
+ # pidfile: /var/run/openl2tpd.pid
+ 
+ # Source function library.
+ . /etc/init.d/functions
+-. /etc/sysconfig/openl2tpd
++. /etc/default/openl2tpd
+  
+ # See how we were called.
+   
meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch new file +32 -0
new file mode 100644
index 000000000..15a8c5b08
@@ -0,0 +1,32 @@
+openl2tp: eliminate warning from modprobe
+
+modprobe will emit alarming warnings if it cannot
+find a module, but we only care that it find one
+of two possible modules when we start openl2tpd.
+
+Suppress messages from modprobe.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <[email protected]>
+
+--- a/etc/rc.d/init.d/openl2tpd
++++ b/etc/rc.d/init.d/openl2tpd
+@@ -29,7 +29,7 @@ start() {
+ 		return 1
+ 	    fi
+ 	fi
+-	modprobe -s pppol2tp || modprobe -s l2tp_ppp
++	modprobe -sq pppol2tp || modprobe -sq l2tp_ppp
+ 	RETVAL=$?
+ 	if [ $RETVAL -eq 0 ]; then
+ 	    start-stop-daemon --start --exec openl2tpd $OPENL2TPDARGS
+@@ -57,7 +57,7 @@ stop() {
+ 	    return 1;
+ 	fi
+ 	killproc openl2tpd
+-	modprobe -s -r pppol2tp || modprobe -s -r l2tp_ppp
++	modprobe -srq pppol2tp || modprobe -srq l2tp_ppp
+ 	echo
+ 	rm -f /var/run/openl2tpd.pid
+         rm -f /var/lock/subsys/openl2tpd
meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch new file +49 -0

49 lines not on this page · raw message

meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service new file +17 -0
new file mode 100644
index 000000000..7b3faf672
@@ -0,0 +1,17 @@
+[Unit]
+Description=The open L2TP implementation
+After=network.target remote-fs.target nss-lookup.target rpcbind.target
+Requires=rpcbind.service
+
+[Service]
+Type=forking
+PIDFile=@STATEDIR@/run/openl2tpd.pid
+EnvironmentFile=@SYSCONFDIR@/default/openl2tpd
+ExecStartPre=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -sq l2tp_ppp || @BASE_SBINDIR@/modprobe -sq pppol2tp"
+ExecStart=@SBINDIR@/openl2tpd $OPENL2TPDARGS
+ExecStartPost=@BASE_BINDIR@/sh -c 'if [ -n "$OPENL2TPD_CONFIG_FILE" ]; then sleep 1; @BINDIR@/l2tpconfig config restore file=$OPENL2TPD_CONFIG_FILE; fi'
+ExecStopPost=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -rsq l2tp_ppp || @BASE_SBINDIR@/modprobe -rsq pppol2tp"
+SuccessExitStatus=1
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb +28 -1
index 9be1c7956..1e5bfe264 100644
@@ -27,6 +27,10 @@ SRC_URI = "ftp://ftp.openl2tp.org/releases/${BP}/${BP}.tar.gz \
            file://0002-cli-include-fcntl.h-for-O_CREAT-define.patch \
            file://0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch \
            file://0001-l2tp_api-Included-needed-headers.patch \
+           file://openl2tpd-initscript-fix.patch \
+           file://openl2tpd-initscript-fix-sysconfig.patch \
+           file://openl2tpd-initscript-fix-warning.patch \
+           file://openl2tpd.service \
            "
 
 SRC_URI_append_libc-musl = "\
@@ -36,7 +40,10 @@ SRC_URI_append_libc-musl = "\
 SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0"
 SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f"
 
-inherit autotools-brokensep pkgconfig
+inherit autotools-brokensep pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "openl2tpd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
 
 DEPENDS_append_libc-musl = " libtirpc"
 CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
@@ -58,3 +65,23 @@ do_compile_prepend() {
         -e 's:CPPFLAGS-y:CPPFLAGS:g' \
         ${S}/Makefile
 }
+
+do_install_append () {
+    install -d ${D}${sysconfdir}/init.d
+    install -d ${D}${sysconfdir}/default
+    install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd
+    install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service
+        sed -i -e 's,@STATEDIR@,${localstatedir},g' \
+               -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+               -e 's,@SBINDIR@,${sbindir},g' \
+               -e 's,@BINDIR@,${bindir},g' \
+               -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
+               -e 's,@BASE_BINDIR@,${base_bindir},g' \
+               ${D}${systemd_system_unitdir}/openl2tpd.service
+    fi
+}
+
+RDEPENDS_${PN} = "ppp ppp-l2tp"
Signature · 1 line
2.11.0