diff options
Diffstat (limited to 'meta-networking/recipes-protocols/openl2tp')
-rw-r--r-- | meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest | 12 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | 11 |
2 files changed, 12 insertions, 11 deletions
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest index 01c9c7b447..a40b6c4228 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest | |||
@@ -30,13 +30,11 @@ else | |||
30 | fi | 30 | fi |
31 | 31 | ||
32 | #read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST | 32 | #read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST |
33 | echo "Please input the network interface you use to test(such as eth0, em1 etc):" | 33 | ETH_TEST=`ip route get 8.8.8.8 | awk -- '{print $5}'` |
34 | read ETH_TEST > /dev/null | ||
35 | |||
36 | if [ x"$ETH_TEST" = x ]; then | 34 | if [ x"$ETH_TEST" = x ]; then |
37 | exit_cus "The network interface cannot be null" 1 | 35 | exit_cus "The network interface cannot be null" 1 |
38 | fi | 36 | fi |
39 | ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 | 37 | ip a | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 |
40 | 38 | ||
41 | # check openl2tp related kernel config | 39 | # check openl2tp related kernel config |
42 | zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 | 40 | zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 |
@@ -63,8 +61,7 @@ if [ x"$ETH_TEST" = x ]; then | |||
63 | fi | 61 | fi |
64 | 62 | ||
65 | sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl | 63 | sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl |
66 | test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \ | 64 | test_ip="`ip addr show $ETH_TEST | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d '/' -f1`" |
67 | sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`" | ||
68 | sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test | 65 | sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test |
69 | 66 | ||
70 | # load module l2tp_ppp | 67 | # load module l2tp_ppp |
@@ -73,7 +70,7 @@ lsmod | grep l2tp_ppp > /dev/null || exit_cus "FAIL: Load module l2tp_ppp" 2 | |||
73 | 70 | ||
74 | # start openl2tpd | 71 | # start openl2tpd |
75 | ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null | 72 | ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null |
76 | ppp_path=`rpm -ql openl2tp | grep ppp_null.so` | 73 | ppp_path=`find / -name ppp_null.so` |
77 | echo "test it here" | 74 | echo "test it here" |
78 | /usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null | 75 | /usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null |
79 | 76 | ||
@@ -95,3 +92,4 @@ else | |||
95 | fi | 92 | fi |
96 | 93 | ||
97 | restore_file | 94 | restore_file |
95 | ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null | ||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb index 183c0066df..4e5b45891d 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | |||
@@ -41,14 +41,14 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \ | |||
41 | SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" | 41 | SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" |
42 | SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" | 42 | SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" |
43 | 43 | ||
44 | inherit autotools-brokensep pkgconfig systemd ptest | 44 | inherit pkgconfig systemd ptest |
45 | 45 | ||
46 | SYSTEMD_SERVICE:${PN} = "openl2tpd.service" | 46 | SYSTEMD_SERVICE:${PN} = "openl2tpd.service" |
47 | SYSTEMD_AUTO_ENABLE = "disable" | 47 | SYSTEMD_AUTO_ENABLE = "disable" |
48 | 48 | ||
49 | DEPENDS += "libtirpc" | 49 | DEPENDS += "libtirpc" |
50 | CPPFLAGS += "-I${STAGING_INCDIR}/tirpc" | 50 | CPPFLAGS += "-I${STAGING_INCDIR}/tirpc" |
51 | CFLAGS += "-I${STAGING_INCDIR}/tirpc" | 51 | CFLAGS += "-I${STAGING_INCDIR}/tirpc -std=gnu17" |
52 | LDFLAGS += "-ltirpc" | 52 | LDFLAGS += "-ltirpc" |
53 | 53 | ||
54 | PARALLEL_MAKE = "" | 54 | PARALLEL_MAKE = "" |
@@ -67,14 +67,16 @@ do_compile:prepend() { | |||
67 | ${S}/Makefile | 67 | ${S}/Makefile |
68 | } | 68 | } |
69 | 69 | ||
70 | do_install:append () { | 70 | do_install () { |
71 | oe_runmake 'DESTDIR=${D}' install | ||
72 | |||
71 | install -d ${D}${sysconfdir}/init.d | 73 | install -d ${D}${sysconfdir}/init.d |
72 | install -d ${D}${sysconfdir}/default | 74 | install -d ${D}${sysconfdir}/default |
73 | install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd | 75 | install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd |
74 | install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd | 76 | install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd |
75 | 77 | ||
76 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 78 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
77 | install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service | 79 | install -D -m 0644 ${UNPACKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service |
78 | sed -i -e 's,@STATEDIR@,${localstatedir},g' \ | 80 | sed -i -e 's,@STATEDIR@,${localstatedir},g' \ |
79 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | 81 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
80 | -e 's,@SBINDIR@,${sbindir},g' \ | 82 | -e 's,@SBINDIR@,${sbindir},g' \ |
@@ -94,3 +96,4 @@ do_install_ptest () { | |||
94 | } | 96 | } |
95 | 97 | ||
96 | RDEPENDS:${PN} = "ppp ppp-l2tp bash" | 98 | RDEPENDS:${PN} = "ppp ppp-l2tp bash" |
99 | RDEPENDS:${PN}-ptest += "rpcbind kernel-module-l2tp-ppp procps-ps tcl" | ||