diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2025-02-11 01:29:57 +0100 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2025-03-03 08:03:37 -0500 |
commit | dd3dca0d019d2814960510638f9f387dab8944f5 (patch) | |
tree | 85fa3cb35634c0c5deafbb53ac1883f57dc99e98 | |
parent | cc425a989b68fc9b52ab37d5178d13d21ee92f39 (diff) | |
download | meta-openembedded-dd3dca0d019d2814960510638f9f387dab8944f5.tar.gz |
ebtables: Remove the dependecy on bash
Rewrite ebtables-legacy-save to avoid using bashisms.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-networking/recipes-filter/ebtables/ebtables-2.0.11/ebtables-legacy-save | 19 | ||||
-rw-r--r-- | meta-networking/recipes-filter/ebtables/ebtables_2.0.11.bb | 2 |
2 files changed, 9 insertions, 12 deletions
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.11/ebtables-legacy-save b/meta-networking/recipes-filter/ebtables/ebtables-2.0.11/ebtables-legacy-save index 2133600f77..0b39c23deb 100644 --- a/meta-networking/recipes-filter/ebtables/ebtables-2.0.11/ebtables-legacy-save +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.11/ebtables-legacy-save | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/sh |
2 | 2 | ||
3 | EBTABLES="/usr/sbin/ebtables-legacy" | 3 | EBTABLES="/usr/sbin/ebtables-legacy" |
4 | 4 | ||
@@ -11,7 +11,7 @@ cnt="" | |||
11 | 11 | ||
12 | for table_name in $(grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//); do | 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) | 13 | table=$($EBTABLES -t $table_name -L $cnt) |
14 | [ $? -eq 0 ] || { echo "$table"; exit -1; } | 14 | [ $? -eq 0 ] || { echo "$table"; exit 1; } |
15 | 15 | ||
16 | chain="" | 16 | chain="" |
17 | rules="" | 17 | rules="" |
@@ -20,24 +20,23 @@ for table_name in $(grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/eb | |||
20 | 20 | ||
21 | case "$line" in | 21 | case "$line" in |
22 | Bridge\ table:\ *) | 22 | Bridge\ table:\ *) |
23 | echo "*${line:14}" | 23 | echo "*${line#Bridge table: }" |
24 | ;; | 24 | ;; |
25 | Bridge\ chain:\ *) | 25 | Bridge\ chain:\ *) |
26 | chain="${line:14}" | 26 | chain="${line#Bridge chain: }" |
27 | chain="${chain%%,*}" | 27 | chain="${chain%%,*}" |
28 | policy="${line##*policy: }" | 28 | policy="${line##*policy: }" |
29 | echo ":$chain $policy" | 29 | echo ":$chain $policy" |
30 | ;; | 30 | ;; |
31 | *) | 31 | *) |
32 | if [ "$cnt" = "--Lc" ]; then | 32 | [ "$cnt" != "--Lc" ] || |
33 | line=${line/, pcnt \=/ -c} | 33 | line=$(echo "$line" | sed -e 's/, pcnt =/-c/' -e 's/ -- bcnt =//') |
34 | line=${line/-- bcnt \=/} | 34 | rules="$rules-A $chain $line |
35 | fi | 35 | " |
36 | rules="$rules-A $chain $line\n" | ||
37 | ;; | 36 | ;; |
38 | esac | 37 | esac |
39 | done <<EOF | 38 | done <<EOF |
40 | $table | 39 | $table |
41 | EOF | 40 | EOF |
42 | echo -e $rules | 41 | echo "$rules" |
43 | done | 42 | done |
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.11.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.11.bb index d522b514f6..30a4c79477 100644 --- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.11.bb +++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.11.bb | |||
@@ -6,8 +6,6 @@ LICENSE = "GPL-2.0-only" | |||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" |
7 | SECTION = "net" | 7 | SECTION = "net" |
8 | 8 | ||
9 | RDEPENDS:${PN} += "bash" | ||
10 | |||
11 | RRECOMMENDS:${PN} += "kernel-module-ebtables \ | 9 | RRECOMMENDS:${PN} += "kernel-module-ebtables \ |
12 | " | 10 | " |
13 | 11 | ||