summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2017-07-11 10:09:11 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-09-08 16:38:14 -0400
commit7f723007364ba79de05447671e83d4eefb3097dc (patch)
treea0e07c5d92c01c83fb0efe6c3cfb2b1c55c2ec8b /meta-networking
parent18b8535e1a4ce6c89c10b204205411195e419571 (diff)
downloadmeta-openembedded-7f723007364ba79de05447671e83d4eefb3097dc.tar.gz
ebtables: replace ebtables-save perl script with bash rewrite
Fedora provides a bash replacement for the default ebtables-save perl script. Using it allows the ebtables run-time dependency on perl to be replaced with a runtime dependency on bash - which is lower overhead and more likely to be present on typical embedded systems already. https://bugzilla.redhat.com/show_bug.cgi?id=746040 http://pkgs.fedoraproject.org/cgit/rpms/ebtables.git/tree/ebtables-save Since ebtables-save no longer contains a references to /usr, the previous QA issue workaround of moving it from ${base_sbindir} to ${sbindir} is no longer required. http://git.openembedded.org/meta-openembedded/commit/?id=a7c6fcebee7d9f86c356ea92de445d89e714ff62 Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
-rwxr-xr-xmeta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save43
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb15
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
3EBTABLES="/sbin/ebtables"
4
5[ -x "$EBTABLES" ] || exit 1
6
7echo "# Generated by ebtables-save v1.0 on $(date)"
8
9cnt=""
10[ "x$EBTABLES_SAVE_COUNTER" = "xyes" ] && cnt="--Lc"
11
12for 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
41EOF
42 echo -e $rules
43done
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, \
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" 5LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e"
6SECTION = "net" 6SECTION = "net"
7PR = "r3" 7PR = "r4"
8 8
9RDEPENDS_${PN} += "perl" 9RDEPENDS_${PN} += "bash"
10 10
11RRECOMMENDS_${PN} += "kernel-module-ebtables \ 11RRECOMMENDS_${PN} += "kernel-module-ebtables \
12 " 12 "
13 13
14SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ 14SRC_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