Return-Path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by mail.openembedded.org (Postfix) with ESMTP id ED17E77DCC for ; Tue, 11 Jul 2017 17:09:18 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id z6so646784pfk.3 for ; Tue, 11 Jul 2017 10:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5Ob4uy7ZThFKZcLX4gVWD7JJ1fKfh5cH18ao3MxcUXw=; b=hmaBXPz5sLh9FqbNvVpbsuc9MHVmzNdF1SMTgw5TYuz4oh7lsa7s37qJtIco3r+C9k 11FKISXRC5uN1SMB1y1jNIVd37lMnwOBfyXpGrdMWa7/3EageOuE/31ydhieh/I2ztXe hbFuET94BECJ9FYdPoC1pBYD4VJVjWtnBDDE4EctuMQCsAbMBjcMrBx0xCf5x/VqxBif yqB3nK/rE+WVgbfHIfLOGb0510Hp3+vVmlVSjETUTnSzENc32nh531X/7bvBp9t28JEm 3kwZFBR4y3n144iq8KBhGkf/ieOdeeyv3bn2fbylVqmUOhKEymngPocXK5aRomYPEDdK DZuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5Ob4uy7ZThFKZcLX4gVWD7JJ1fKfh5cH18ao3MxcUXw=; b=P5NjQ89cU6DJIrNLpcZ1DpskPAClPPprukHiKBZtdzEuE4Nn/+J+UF80xX9fp2lHcA IBn/5cBwDehqJd5lP5FQQz4IX5nKmoQcW8QAO4SNzRkrRYMENCnZVIOaxM6cvv95OehQ ktmQVzsgV/cz9RAJZl6ZD0l6np6c8al5FxpEq+6Cp9xQ8NRFw6MpU5rIVmnoc5nmuwdf +0KKDa38hiEmlw4l/S19kIIDIInQvI4vxfvoLFV4M9qCA17gQvAP7cIiJo3Ch+2XKWwk laU/tLYeHyU6Hlc3GhhUrVyOXEP34WaphKOdGC/VVT2Vj7Qt+3W4zHXMYstYftFrSqNp BdCA== X-Gm-Message-State: AIVw110vsX+GIQrTBhgZksrRxN6IZpkR0d3VV8Om066+0aFWtIF85aGn Pkgg8Wo5riqSNVKB X-Received: by 10.84.131.78 with SMTP id 72mr954629pld.43.1499792959000; Tue, 11 Jul 2017 10:09:19 -0700 (PDT) Received: from e6520.cablelabs.com ([4.16.80.121]) by smtp.gmail.com with ESMTPSA id z86sm996309pfl.40.2017.07.11.10.09.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 10:09:17 -0700 (PDT) From: Andre McCurdy To: openembedded-devel@lists.openembedded.org Date: Tue, 11 Jul 2017 10:09:11 -0700 Message-Id: <1499792951-12837-1-git-send-email-armccurdy@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [meta-networking][PATCH] ebtables: replace ebtables-save perl script with bash rewrite X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2017 17:09:19 -0000 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 --- .../ebtables/ebtables-2.0.10-4/ebtables-save | 43 ++++++++++++++++++++++ .../recipes-filter/ebtables/ebtables_2.0.10-4.bb | 15 ++++---- 2 files changed, 50 insertions(+), 8 deletions(-) create mode 100755 meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save 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 0000000..2d7fc4e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save @@ -0,0 +1,43 @@ +#!/bin/bash + +EBTABLES="/sbin/ebtables" + +[ -x "$EBTABLES" ] || exit 1 + +echo "# Generated by ebtables-save v1.0 on $(date)" + +cnt="" +[ "x$EBTABLES_SAVE_COUNTER" = "xyes" ] && cnt="--Lc" + +for table_name in $(grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//); do + table=$($EBTABLES -t $table_name -L $cnt) + [ $? -eq 0 ] || { echo "$table"; exit -1; } + + chain="" + rules="" + while read line; do + [ -z "$line" ] && continue + + case "$line" in + Bridge\ table:\ *) + echo "*${line:14}" + ;; + Bridge\ chain:\ *) + chain="${line:14}" + chain="${chain%%,*}" + policy="${line##*policy: }" + echo ":$chain $policy" + ;; + *) + if [ "$cnt" = "--Lc" ]; then + line=${line/, pcnt \=/ -c} + line=${line/-- bcnt \=/} + fi + rules="$rules-A $chain $line\n" + ;; + esac + done <