diff options
-rwxr-xr-x | meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save | 43 | ||||
-rw-r--r-- | meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | 15 |
2 files changed, 50 insertions, 8 deletions
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save new file mode 100755 index 000000000..2d7fc4ed7 --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | EBTABLES="/sbin/ebtables" | ||
4 | |||
5 | [ -x "$EBTABLES" ] || exit 1 | ||
6 | |||
7 | echo "# Generated by ebtables-save v1.0 on $(date)" | ||
8 | |||
9 | cnt="" | ||
10 | [ "x$EBTABLES_SAVE_COUNTER" = "xyes" ] && cnt="--Lc" | ||
11 | |||
12 | for table_name in $(grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//); do | ||
13 | table=$($EBTABLES -t $table_name -L $cnt) | ||
14 | [ $? -eq 0 ] || { echo "$table"; exit -1; } | ||
15 | |||
16 | chain="" | ||
17 | rules="" | ||
18 | while read line; do | ||
19 | [ -z "$line" ] && continue | ||
20 | |||
21 | case "$line" in | ||
22 | Bridge\ table:\ *) | ||
23 | echo "*${line:14}" | ||
24 | ;; | ||
25 | Bridge\ chain:\ *) | ||
26 | chain="${line:14}" | ||
27 | chain="${chain%%,*}" | ||
28 | policy="${line##*policy: }" | ||
29 | echo ":$chain $policy" | ||
30 | ;; | ||
31 | *) | ||
32 | if [ "$cnt" = "--Lc" ]; then | ||
33 | line=${line/, pcnt \=/ -c} | ||
34 | line=${line/-- bcnt \=/} | ||
35 | fi | ||
36 | rules="$rules-A $chain $line\n" | ||
37 | ;; | ||
38 | esac | ||
39 | done <<EOF | ||
40 | $table | ||
41 | EOF | ||
42 | echo -e $rules | ||
43 | done | ||
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 index 375423d5d..e724731d0 100644 --- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb +++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | |||
@@ -4,14 +4,15 @@ DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \ | |||
4 | LICENSE = "GPLv2" | 4 | LICENSE = "GPLv2" |
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" |
6 | SECTION = "net" | 6 | SECTION = "net" |
7 | PR = "r3" | 7 | PR = "r4" |
8 | 8 | ||
9 | RDEPENDS_${PN} += "perl" | 9 | RDEPENDS_${PN} += "bash" |
10 | 10 | ||
11 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ | 11 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ |
12 | " | 12 | " |
13 | 13 | ||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ | 14 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ |
15 | file://ebtables-save \ | ||
15 | file://installnonroot.patch \ | 16 | file://installnonroot.patch \ |
16 | file://01debian_defaultconfig.patch \ | 17 | file://01debian_defaultconfig.patch \ |
17 | file://ebtables.init \ | 18 | file://ebtables.init \ |
@@ -78,12 +79,10 @@ do_install () { | |||
78 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables | 79 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables |
79 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables | 80 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables |
80 | 81 | ||
81 | # The script ebtables-save refernces perl in exec_prefix, so | 82 | # Replace upstream ebtables-save perl script with Fedora bash based rewrite |
82 | # move it to sbindir to avoid QA issue | 83 | # http://pkgs.fedoraproject.org/cgit/rpms/ebtables.git/tree/ebtables-save |
83 | if ${base_sbindir} != ${sbindir} ; then | 84 | install -m 0755 ${WORKDIR}/ebtables-save ${D}${base_sbindir}/ebtables-save |
84 | install -d ${D}/${sbindir} | 85 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${base_sbindir}/ebtables-save |
85 | mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir} | ||
86 | fi | ||
87 | 86 | ||
88 | # Install systemd service files | 87 | # Install systemd service files |
89 | install -d ${D}${systemd_unitdir}/system | 88 | install -d ${D}${systemd_unitdir}/system |