diff options
Diffstat (limited to 'meta-networking/recipes-filter')
17 files changed, 690 insertions, 0 deletions
diff --git a/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb new file mode 100644 index 000000000..0cc139840 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "Connection tracking userspace tools for Linux" | ||
2 | LICENSE = "GPLv2+" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
4 | DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \ | ||
5 | libnetfilter-cthelper libnetfilter-queue bison-native" | ||
6 | |||
7 | |||
8 | SRC_URI = " \ | ||
9 | http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \ | ||
10 | file://conntrack-failover \ | ||
11 | file://init \ | ||
12 | " | ||
13 | SRC_URI[tar.md5sum] = "ee737c774e01349f75e935228a2d851b" | ||
14 | SRC_URI[tar.sha256sum] = "036b032a5c4d180aad686df21399d74506b9b3d3000794eb13ac313482e24896" | ||
15 | |||
16 | inherit autotools-brokensep update-rc.d pkgconfig | ||
17 | |||
18 | INITSCRIPT_NAME = "conntrackd" | ||
19 | |||
20 | do_install_append() { | ||
21 | install -d ${D}/${sysconfdir}/conntrackd | ||
22 | install -d ${D}/${sysconfdir}/init.d | ||
23 | install -m 0644 doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
24 | install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover | ||
25 | install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd | ||
26 | |||
27 | # Fix hardcoded paths in scripts | ||
28 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
29 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
30 | sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
31 | sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd | ||
32 | } | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover new file mode 100644 index 000000000..6d92e637f --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover | |||
@@ -0,0 +1,77 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org> | ||
4 | # (C) 2009 Roman I Khimov <khimov@altell.ru> | ||
5 | # | ||
6 | # This software may be used and distributed according to the terms | ||
7 | # of the GNU General Public License, incorporated herein by reference. | ||
8 | # | ||
9 | # Description: | ||
10 | # | ||
11 | # This is the script for primary-backup setups for keepalived | ||
12 | # (http://www.keepalived.org). You may adapt it to make it work with other | ||
13 | # high-availability managers. | ||
14 | # | ||
15 | # Do not forget to include the required modifications to your keepalived.conf | ||
16 | # file to invoke this script during keepalived's state transitions. | ||
17 | # | ||
18 | # Contributions to improve this script are welcome :). | ||
19 | # | ||
20 | ## Modified to work as init.d script under pacemaker control | ||
21 | |||
22 | CONNTRACKD_BIN=/usr/sbin/conntrackd | ||
23 | CONNTRACKD_LOCK=/var/lock/conntrack.lock | ||
24 | CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | # | ||
29 | # commit the external cache into the kernel table | ||
30 | # | ||
31 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c | ||
32 | if [ $? -eq 1 ] | ||
33 | then | ||
34 | logger "ERROR: failed to invoke conntrackd -c" | ||
35 | fi | ||
36 | |||
37 | # | ||
38 | # flush the internal and the external caches | ||
39 | # | ||
40 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f | ||
41 | if [ $? -eq 1 ] | ||
42 | then | ||
43 | logger "ERROR: failed to invoke conntrackd -f" | ||
44 | fi | ||
45 | |||
46 | # | ||
47 | # resynchronize my internal cache to the kernel table | ||
48 | # | ||
49 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R | ||
50 | if [ $? -eq 1 ] | ||
51 | then | ||
52 | logger "ERROR: failed to invoke conntrackd -R" | ||
53 | fi | ||
54 | |||
55 | # | ||
56 | # send a bulk update to backups | ||
57 | # | ||
58 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B | ||
59 | if [ $? -eq 1 ] | ||
60 | then | ||
61 | logger "ERROR: failed to invoke conntrackd -B" | ||
62 | fi | ||
63 | ;; | ||
64 | stop) | ||
65 | $CONNTRACKD_BIN -t | ||
66 | $CONNTRACKD_BIN -n | ||
67 | ;; | ||
68 | status) | ||
69 | ;; | ||
70 | *) | ||
71 | logger "ERROR: unknown command" | ||
72 | echo "Usage: conntrack-failover {start|stop|status}" | ||
73 | exit 1 | ||
74 | ;; | ||
75 | esac | ||
76 | |||
77 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/init b/meta-networking/recipes-filter/conntrack-tools/files/init new file mode 100644 index 000000000..bce2075a7 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/init | |||
@@ -0,0 +1,87 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # /etc/init.d/conntrackd | ||
4 | # | ||
5 | # Maximilian Wilhelm <max@rfc2324.org> | ||
6 | # -- Mon, 06 Nov 2006 18:39:07 +0100 | ||
7 | # | ||
8 | # Roman I Khimov <khimov@altell.ru> | ||
9 | # -- Tue, 27 Oct 2009 14:34:00 +0300 | ||
10 | |||
11 | ### BEGIN INIT INFO | ||
12 | # Provides: conntrackd | ||
13 | # Required-Start: $remote_fs $syslog | ||
14 | # Required-Stop: $remote_fs $syslog | ||
15 | # Default-Start: 2 3 4 5 | ||
16 | # Default-Stop: 0 1 6 | ||
17 | # Description: Starts conntrackd | ||
18 | # short-description: Starts conntrackd | ||
19 | ### END INIT INFO | ||
20 | |||
21 | export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
22 | |||
23 | NAME="conntrackd" | ||
24 | DAEMON="/usr/sbin/conntrackd" | ||
25 | CONFIG="/etc/conntrackd/conntrackd.conf" | ||
26 | PIDFILE="/var/run/${NAME}.pid" | ||
27 | |||
28 | |||
29 | # Gracefully exit if there is no daemon (debian way of life) | ||
30 | if [ ! -x "${DAEMON}" ]; then | ||
31 | exit 0 | ||
32 | fi | ||
33 | |||
34 | # Check for config file | ||
35 | if [ ! -f /etc/conntrackd/conntrackd.conf ]; then | ||
36 | echo "Error: There is no config file for $NAME" >&2 | ||
37 | exit 1; | ||
38 | fi | ||
39 | |||
40 | case "$1" in | ||
41 | start) | ||
42 | echo -n "Starting $NAME: " | ||
43 | for i in nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_proto_dccp nf_conntrack_tftp \ | ||
44 | nf_conntrack_sane nf_conntrack_pptp nf_conntrack_irc nf_conntrack_amanda nf_conntrack_h323 \ | ||
45 | nf_conntrack_proto_udplite nf_conntrack_proto_gre nf_conntrack_proto_sctp nf_conntrack_ftp \ | ||
46 | nf_conntrack_sip; do | ||
47 | modprobe $i >/dev/null 2>/dev/null & | ||
48 | done | ||
49 | start-stop-daemon --start --quiet --make-pidfile --pidfile "/var/run/${NAME}.pid" --background --exec "${DAEMON}" | ||
50 | RET=$? | ||
51 | if [ "$?" = "0" ]; then | ||
52 | sleep 2 | ||
53 | # Sync with other server | ||
54 | conntrackd -n | ||
55 | echo "done." | ||
56 | else | ||
57 | echo "FAILED!" | ||
58 | fi | ||
59 | exit $RET | ||
60 | ;; | ||
61 | stop) | ||
62 | echo -n "Stopping $NAME:" | ||
63 | start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/${NAME}.pid" && echo "done." || echo "FAILED!" | ||
64 | ;; | ||
65 | status) | ||
66 | echo -n "conntrackd " | ||
67 | start-stop-daemon -q -K -t -x $DAEMON | ||
68 | RET=$? | ||
69 | if [ "$RET" = "0" ]; then | ||
70 | PID=`cat $PIDFILE` | ||
71 | echo "($PID) is running" | ||
72 | else | ||
73 | echo "is not running" | ||
74 | exit $RET | ||
75 | fi | ||
76 | ;; | ||
77 | restart) | ||
78 | $0 stop | ||
79 | $0 start | ||
80 | ;; | ||
81 | |||
82 | *) | ||
83 | echo "Usage: /etc/init.d/conntrackd {start|stop|restart}" | ||
84 | exit 1 | ||
85 | esac | ||
86 | |||
87 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch new file mode 100644 index 000000000..c260403ea --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
2 | ## debian_defaultconfig.dpatch by <hesso@pool.math.tu-berlin.de> | ||
3 | ## | ||
4 | ## DP: Debian enhancements to the ebtables "sysconfig" default settings. | ||
5 | |||
6 | @DPATCH@ | ||
7 | |||
8 | --- ebtables-2.0.8.1.orig/ebtables-config | ||
9 | +++ ebtables-2.0.8.1/ebtables-config | ||
10 | @@ -1,17 +1,3 @@ | ||
11 | -# Save (and possibly restore) in text format. | ||
12 | -# Value: yes|no, default: yes | ||
13 | -# Save the firewall rules in text format to __SYSCONFIG__/ebtables | ||
14 | -# If EBTABLES_BINARY_FORMAT="no" then restoring the firewall rules | ||
15 | -# is done using this text format. | ||
16 | -EBTABLES_TEXT_FORMAT="yes" | ||
17 | - | ||
18 | -# Save (and restore) in binary format. | ||
19 | -# Value: yes|no, default: yes | ||
20 | -# Save (and restore) the firewall rules in binary format to (and from) | ||
21 | -# __SYSCONFIG__/ebtables.<chain>. Enabling this option will make | ||
22 | -# firewall initialisation a lot faster. | ||
23 | -EBTABLES_BINARY_FORMAT="yes" | ||
24 | - | ||
25 | # Unload modules on restart and stop | ||
26 | # Value: yes|no, default: yes | ||
27 | # This option has to be 'yes' to get to a sane state for a firewall | ||
28 | @@ -19,6 +5,12 @@ | ||
29 | # modules. | ||
30 | EBTABLES_MODULES_UNLOAD="yes" | ||
31 | |||
32 | +# Load firewall rules on system startup. | ||
33 | +# Value: yes|no, default: no | ||
34 | +# Restores the ebtables rulesets from the last saved state when the | ||
35 | +# system boots up. | ||
36 | +EBTABLES_LOAD_ON_START="no" | ||
37 | + | ||
38 | # Save current firewall rules on stop. | ||
39 | # Value: yes|no, default: no | ||
40 | # Saves all firewall rules if firewall gets stopped | ||
41 | @@ -35,3 +27,9 @@ | ||
42 | # Save rule counters when saving a kernel table to a file. If the | ||
43 | # rule counters were saved, they will be restored when restoring the table. | ||
44 | EBTABLES_SAVE_COUNTER="no" | ||
45 | + | ||
46 | +# Backup suffix for ruleset save files. | ||
47 | +# Value: <string>, default: "~" | ||
48 | +# Keep one backup level of saved rules. | ||
49 | +# Set this variable to the empty string to disable backups. | ||
50 | +EBTABLES_BACKUP_SUFFIX="~" | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common new file mode 100644 index 000000000..640025dba --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common | |||
@@ -0,0 +1,163 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -x /sbin/ebtables ] || exit 1 | ||
4 | |||
5 | EBTABLES_DUMPFILE_STEM=/etc/ebtables/dump | ||
6 | |||
7 | RETVAL=0 | ||
8 | prog="ebtables" | ||
9 | desc="Ethernet bridge filtering" | ||
10 | umask 0077 | ||
11 | |||
12 | #default configuration | ||
13 | EBTABLES_MODULES_UNLOAD="yes" | ||
14 | EBTABLES_LOAD_ON_START="no" | ||
15 | EBTABLES_SAVE_ON_STOP="no" | ||
16 | EBTABLES_SAVE_ON_RESTART="no" | ||
17 | EBTABLES_SAVE_COUNTER="no" | ||
18 | EBTABLES_BACKUP_SUFFIX="~" | ||
19 | |||
20 | config=/etc/default/$prog | ||
21 | [ -f "$config" ] && . "$config" | ||
22 | |||
23 | function get_supported_tables() { | ||
24 | EBTABLES_SUPPORTED_TABLES= | ||
25 | /sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission | ||
26 | if [ $? -eq 0 ]; then | ||
27 | echo "Error: insufficient privileges to access the ebtables rulesets." | ||
28 | exit 1 | ||
29 | fi | ||
30 | for table in filter nat broute; do | ||
31 | /sbin/ebtables -t $table -L &> /dev/null | ||
32 | if [ $? -eq 0 ]; then | ||
33 | EBTABLES_SUPPORTED_TABLES="${EBTABLES_SUPPORTED_TABLES} $table" | ||
34 | fi | ||
35 | done | ||
36 | } | ||
37 | |||
38 | function load() { | ||
39 | RETVAL=0 | ||
40 | get_supported_tables | ||
41 | echo -n "Restoring ebtables rulesets: " | ||
42 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
43 | echo -n "$table " | ||
44 | if [ -s ${EBTABLES_DUMPFILE_STEM}.$table ]; then | ||
45 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-commit | ||
46 | RET=$? | ||
47 | if [ $RET -ne 0 ]; then | ||
48 | echo -n "(failed) " | ||
49 | RETVAL=$RET | ||
50 | fi | ||
51 | else | ||
52 | echo -n "(no saved state) " | ||
53 | fi | ||
54 | done | ||
55 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
56 | echo -n "no kernel support. " | ||
57 | else | ||
58 | echo -n "done. " | ||
59 | fi | ||
60 | if [ $RETVAL -eq 0 ]; then | ||
61 | echo "ok" | ||
62 | else | ||
63 | echo "fail" | ||
64 | fi | ||
65 | } | ||
66 | |||
67 | function clear() { | ||
68 | RETVAL=0 | ||
69 | get_supported_tables | ||
70 | echo -n "Clearing ebtables rulesets: " | ||
71 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
72 | echo -n "$table " | ||
73 | /sbin/ebtables -t $table --init-table | ||
74 | done | ||
75 | |||
76 | if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then | ||
77 | for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -d' ' -f1) ebtables; do | ||
78 | rmmod $mod 2> /dev/null | ||
79 | done | ||
80 | fi | ||
81 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
82 | echo -n "no kernel support. " | ||
83 | else | ||
84 | echo -n "done. " | ||
85 | fi | ||
86 | if [ $RETVAL -eq 0 ]; then | ||
87 | echo "ok" | ||
88 | else | ||
89 | echo "fail" | ||
90 | fi | ||
91 | } | ||
92 | |||
93 | function save() { | ||
94 | RETVAL=0 | ||
95 | get_supported_tables | ||
96 | echo -n "Saving ebtables rulesets: " | ||
97 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
98 | echo -n "$table " | ||
99 | [ -n "$EBTABLES_BACKUP_SUFFIX" ] && [ -s ${EBTABLES_DUMPFILE_STEM}.$table ] && \ | ||
100 | mv ${EBTABLES_DUMPFILE_STEM}.$table ${EBTABLES_DUMPFILE_STEM}.$table$EBTABLES_BACKUP_SUFFIX | ||
101 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-save | ||
102 | RET=$? | ||
103 | if [ $RET -ne 0 ]; then | ||
104 | echo -n "(failed) " | ||
105 | RETVAL=$RET | ||
106 | else | ||
107 | if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then | ||
108 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table -Z | ||
109 | fi | ||
110 | fi | ||
111 | done | ||
112 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
113 | echo -n "no kernel support. " | ||
114 | else | ||
115 | echo -n "done. " | ||
116 | fi | ||
117 | if [ $RETVAL -eq 0 ]; then | ||
118 | echo "ok" | ||
119 | else | ||
120 | echo "fail" | ||
121 | fi | ||
122 | } | ||
123 | |||
124 | case "$1" in | ||
125 | start) | ||
126 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
127 | ;; | ||
128 | stop) | ||
129 | [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save | ||
130 | clear | ||
131 | ;; | ||
132 | restart|reload|force-reload) | ||
133 | [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save | ||
134 | clear | ||
135 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
136 | ;; | ||
137 | load) | ||
138 | load | ||
139 | ;; | ||
140 | save) | ||
141 | save | ||
142 | ;; | ||
143 | status) | ||
144 | get_supported_tables | ||
145 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
146 | echo "No kernel support for ebtables." | ||
147 | RETVAL=1 | ||
148 | else | ||
149 | echo -n "Ebtables support available, number of installed rules: " | ||
150 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
151 | COUNT=$(( $(/sbin/ebtables -t $table -L | sed -e "/^Bridge chain/! d" -e "s/^.*entries: //" -e "s/,.*$/ +/") 0 )) | ||
152 | echo -n "$table($COUNT) " | ||
153 | done | ||
154 | echo ok | ||
155 | RETVAL=0 | ||
156 | fi | ||
157 | ;; | ||
158 | *) | ||
159 | echo "Usage: $0 {start|stop|restart|reload|force-reload|load|save|status}" >&2 | ||
160 | RETVAL=1 | ||
161 | esac | ||
162 | |||
163 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init new file mode 100755 index 000000000..c9a77a29e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # init script for the Ethernet Bridge filter tables | ||
4 | # | ||
5 | # Written by Dag Wieers <dag@wieers.com> | ||
6 | # Modified by Rok Papez <rok.papez@arnes.si> | ||
7 | # Bart De Schuymer <bdschuym@pandora.be> | ||
8 | # Adapted to Debian by Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> | ||
9 | # Adapted to OpenEmbedded by Roman I Khimov <khimov@altell.ru> | ||
10 | # | ||
11 | # chkconfig: - 15 85 | ||
12 | # description: Ethernet Bridge filtering tables | ||
13 | # | ||
14 | ### BEGIN INIT INFO | ||
15 | # Provides: ebtables | ||
16 | # Required-Start: | ||
17 | # Required-Stop: | ||
18 | # Should-Start: $local_fs | ||
19 | # Should-Stop: $local_fs | ||
20 | # Default-Start: S | ||
21 | # Default-Stop: 0 6 | ||
22 | # Short-Description: ebtables ruleset management | ||
23 | # Description: Saves and restores the state of the ebtables rulesets. | ||
24 | ### END INIT INFO | ||
25 | |||
26 | /usr/sbin/ebtables.common $1 | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service new file mode 100644 index 000000000..3abd1fe3e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Ethernet Bridge Filtering Tables | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | RemainAfterExit=yes | ||
7 | ExecStart=@SBINDIR@/ebtables.common start | ||
8 | ExecStop=@SBINDIR@/ebtables.common stop | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch new file mode 100644 index 000000000..bcd9bed23 --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | diff --git a/Makefile b/Makefile | ||
2 | index c1106a4..7ea6b7a 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g') | ||
6 | scripts: ebtables-save ebtables.sysv ebtables-config | ||
7 | cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ | ||
8 | mkdir -p $(DESTDIR)$(BINDIR) | ||
9 | - install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
10 | + install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
11 | cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ | ||
12 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi | ||
13 | - if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
14 | + if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
15 | cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ | ||
16 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi | ||
17 | - if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
18 | + if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
19 | rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ | ||
20 | |||
21 | tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g') | ||
22 | $(MANDIR)/man8/ebtables.8: ebtables.8 | ||
23 | mkdir -p $(DESTDIR)$(@D) | ||
24 | sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_ | ||
25 | - install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@ | ||
26 | + install -m 0644 ebtables.8_ $(DESTDIR)$@ | ||
27 | rm -f ebtables.8_ | ||
28 | |||
29 | $(DESTDIR)$(ETHERTYPESFILE): ethertypes | ||
30 | mkdir -p $(@D) | ||
31 | - install -m 0644 -o root -g root $< $@ | ||
32 | + install -m 0644 $< $@ | ||
33 | |||
34 | .PHONY: exec | ||
35 | exec: ebtables ebtables-restore | ||
36 | mkdir -p $(DESTDIR)$(BINDIR) | ||
37 | - install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
38 | - install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
39 | + install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
40 | + install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
41 | |||
42 | .PHONY: install | ||
43 | install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch new file mode 100644 index 000000000..336119d6b --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | link ebtables with --no-as-needed and adjust the link order to fix runtime crash | ||
2 | |||
3 | Program terminated with signal 11, Segmentation fault. | ||
4 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
5 | (gdb) bt | ||
6 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
7 | #1 0x00007ffaa83824dc in do_command () from /lib64/ebtables/libebtc.so | ||
8 | #2 0x000000000040065c in ?? () | ||
9 | #3 0x00007ffaa7fed755 in __libc_start_main () from /lib64/libc.so.6 | ||
10 | #4 0x0000000000400691 in ?? () | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Index: ebtables-v2.0.10-4/Makefile | ||
14 | =================================================================== | ||
15 | --- ebtables-v2.0.10-4.orig/Makefile 2011-12-15 12:02:47.000000000 -0800 | ||
16 | +++ ebtables-v2.0.10-4/Makefile 2012-12-17 22:09:45.065973753 -0800 | ||
17 | @@ -90,7 +90,7 @@ | ||
18 | $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2) | ||
19 | |||
20 | ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so | ||
21 | - $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ | ||
22 | + $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \ | ||
23 | -Wl,-rpath,$(LIBDIR) | ||
24 | |||
25 | ebtablesu: ebtablesu.c | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb new file mode 100644 index 000000000..32cfc752b --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | |||
@@ -0,0 +1,77 @@ | |||
1 | SUMMARY = "Filtering tool for a Linux-based bridging firewall" | ||
2 | DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \ | ||
3 | advanced logging, MAC DNAT/SNAT and brouting." | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" | ||
6 | SECTION = "console/network" | ||
7 | PR = "r3" | ||
8 | |||
9 | RDEPENDS_${PN} += "perl" | ||
10 | |||
11 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ | ||
12 | " | ||
13 | |||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ | ||
15 | file://installnonroot.patch \ | ||
16 | file://01debian_defaultconfig.patch \ | ||
17 | file://ebtables.init \ | ||
18 | file://ebtables.common \ | ||
19 | file://ebtables.service \ | ||
20 | file://no-as-needed.patch \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0" | ||
24 | SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d" | ||
25 | |||
26 | S = "${WORKDIR}/ebtables-v${PV}" | ||
27 | |||
28 | inherit update-rc.d systemd | ||
29 | |||
30 | EXTRA_OEMAKE = " \ | ||
31 | BINDIR=${base_sbindir} \ | ||
32 | MANDIR=${mandir} \ | ||
33 | ETHERTYPESPATH=${sysconfdir} \ | ||
34 | INITDIR=${sysconfdir}/init.d \ | ||
35 | SYSCONFIGDIR=${sysconfdir}/default \ | ||
36 | LIBDIR=${base_libdir}/ebtables \ | ||
37 | 'CC=${CC}' \ | ||
38 | 'CFLAGS=${CFLAGS}' \ | ||
39 | 'LDFLAGS=${LDFLAGS} -Wl,--no-as-needed' \ | ||
40 | 'LD=${LD}' \ | ||
41 | " | ||
42 | |||
43 | do_install () { | ||
44 | install -d ${D}${sbindir} | ||
45 | install -m 0755 ${WORKDIR}/ebtables.common ${D}${sbindir}/ebtables.common | ||
46 | # Fix hardcoded paths in scripts | ||
47 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${sbindir}/ebtables.common | ||
48 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sbindir}/ebtables.common | ||
49 | |||
50 | install -d ${D}${sysconfdir}/init.d | ||
51 | install -d ${D}${sysconfdir}/default | ||
52 | install -d ${D}${sysconfdir}/ebtables | ||
53 | oe_runmake DESTDIR='${D}' install | ||
54 | install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables | ||
55 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables | ||
56 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables | ||
57 | |||
58 | # The script ebtables-save refernces perl in exec_prefix, so | ||
59 | # move it to sbindir to avoid QA issue | ||
60 | install -d ${D}/${sbindir} | ||
61 | mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir} | ||
62 | |||
63 | # Install systemd service files | ||
64 | install -d ${D}${systemd_unitdir}/system | ||
65 | install -m 0644 ${WORKDIR}/ebtables.service ${D}${systemd_unitdir}/system | ||
66 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/ebtables.service | ||
67 | } | ||
68 | |||
69 | CONFFILES_${PN} += "${sysconfdir}/default/ebtables" | ||
70 | |||
71 | INITSCRIPT_NAME = "ebtables" | ||
72 | INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ." | ||
73 | |||
74 | SYSTEMD_SERVICE_${PN} = "ebtables.service" | ||
75 | |||
76 | FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug" | ||
77 | FILES_${PN} += "${base_libdir}/ebtables/*.so" | ||
diff --git a/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb new file mode 100644 index 000000000..74f909660 --- /dev/null +++ b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | SUMMARY = "Minimalistic user-space Netlink utility library" | ||
2 | DESCRIPTION = "Minimalistic user-space library oriented to Netlink developers, providing \ | ||
3 | functions for common tasks in parsing, validating, and constructing both the Netlink header and TLVs." | ||
4 | HOMEPAGE = "http://www.netfilter.org/projects/libmnl/index.html" | ||
5 | LICENSE = "LGPLv2.1+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libmnl/files/libmnl-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "7d95fc3bea3365bc03c48e484224f65f" | ||
10 | SRC_URI[tar.sha256sum] = "6f14336e9acdbc62c2dc71bbb59ce162e54e9af5c80153e92476c5443fe784de" | ||
11 | |||
12 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb new file mode 100644 index 000000000..fb915abbf --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "447114b5d61bb9a9617ead3217c3d3ff" | ||
10 | SRC_URI[tar.sha256sum] = "a0bd747dd58ae1513586b43c7125b41e6325f97eb95ac63d53cf5aeb33254d12" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_conntrack-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb new file mode 100644 index 000000000..405e8bfae --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking helper library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_cthelper/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd" | ||
10 | SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_cthelper-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb new file mode 100644 index 000000000..2f2585217 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | SUMMARY = "Netfilter connection tracking timeout library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter fine-grain connection tracking timeout infrastructure" | ||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
5 | DEPENDS = "libmnl" | ||
6 | |||
7 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar" | ||
8 | SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" | ||
9 | SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" | ||
10 | |||
11 | S = "${WORKDIR}/libnetfilter_cttimeout-${PV}" | ||
12 | |||
13 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb new file mode 100644 index 000000000..81909b8be --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter logging library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter log message (NFLOG)" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_log/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_log/files/libnetfilter_log-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "2a4bb0654ae675a52d2e8d1c06090b94" | ||
10 | SRC_URI[tar.sha256sum] = "74e0fe75753dba3ac114531b5e73240452c789a3f3adccf5c51217da1d933b21" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_log-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb new file mode 100644 index 000000000..b932ff65f --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter packet queue access library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to access the Linux kernel netfilter packet queue" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_queue/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "df09befac35cb215865b39a36c96a3fa" | ||
10 | SRC_URI[tar.sha256sum] = "838490eb5dbe358f9669823704982f5313a8d397111562373200203f93ac1a32" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_queue-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb new file mode 100644 index 000000000..9cb615bb4 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Low-level library for netfilter related kernel/userspace communication" | ||
2 | DESCRIPTION = "libnfnetlink is the low-level library for netfilter related \ | ||
3 | kernel/userspace communication. It provides a generic messaging \ | ||
4 | infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, \ | ||
5 | nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or \ | ||
6 | management tools in userspace." | ||
7 | HOMEPAGE = "http://www.netfilter.org/projects/libnfnetlink/index.html" | ||
8 | SECTION = "devel/libs" | ||
9 | LICENSE = "GPLv2+" | ||
10 | |||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
13 | |||
14 | SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar" | ||
15 | SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e" | ||
16 | SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" | ||
17 | |||
18 | inherit autotools pkgconfig | ||