initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
From 73536d15c80be96049289d96fc32122467c56b1d Mon Sep 17 00:00:00 2001
|
||||
From: Matt Weber <matthew.weber@rockwellcollins.com>
|
||||
Date: Mon, 16 Dec 2019 13:27:30 -0600
|
||||
Subject: [PATCH] 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
|
||||
|
||||
Upstream:
|
||||
https://github.com/openembedded/meta-openembedded/commit/7f723007364ba79de05447671e83d4eefb3097dc
|
||||
|
||||
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
|
||||
[ryanbarnett3@gmail.com:
|
||||
- changed EBTABLES executable to /usr/sbin/ebtables-legacy
|
||||
]
|
||||
Signed-off-by: Ryan Barnett <ryanbarnett3@gmail.com>
|
||||
---
|
||||
ebtables-save.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 43 insertions(+)
|
||||
create mode 100644 ebtables-save.sh
|
||||
|
||||
diff --git a/ebtables-save.sh b/ebtables-save.sh
|
||||
new file mode 100644
|
||||
index 0000000..2d7fc4e
|
||||
--- /dev/null
|
||||
+++ b/ebtables-save.sh
|
||||
@@ -0,0 +1,43 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+EBTABLES="/usr/sbin/ebtables-legacy"
|
||||
+
|
||||
+[ -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 <<EOF
|
||||
+$table
|
||||
+EOF
|
||||
+ echo -e $rules
|
||||
+done
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
From 7297a8ef3cab3b0faf1426622ee902a2144e2e89 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Wed, 24 Mar 2021 11:27:14 +0100
|
||||
Subject: [PATCH] ebtables.h: restore KERNEL_64_USERSPACE_32 checks
|
||||
|
||||
Commit e6359eedfbf497e52d52451072aea4713ed80a88 replaced the file ebtables.h
|
||||
but removed the usage of KERNEL_64_USERSPACE_32. This breaks boards where
|
||||
such flag is relevant, with following messages:
|
||||
|
||||
[ 6364.971346] kernel msg: ebtables bug: please report to author: Standard target size too big
|
||||
|
||||
Unable to update the kernel. Two possible causes:
|
||||
1. Multiple ebtables programs were executing simultaneously. The ebtables
|
||||
userspace tool doesn't by default support multiple ebtables programs running
|
||||
concurrently. The ebtables option --concurrent or a tool like flock can be
|
||||
used to support concurrent scripts that update the ebtables kernel tables.
|
||||
2. The kernel doesn't support a certain ebtables extension, consider
|
||||
recompiling your kernel or insmod the extension.
|
||||
|
||||
Analysis shows that the structure 'ebt_replace' passed from userspace
|
||||
ebtables to the kernel, is too small, i.e 80 bytes instead of 120 in case of
|
||||
64-bit kernel.
|
||||
|
||||
Note that the ebtables build system seems to assume that 'sparc64' is the
|
||||
only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
|
||||
This situation can happen on many architectures, especially in embedded
|
||||
systems. For example, an Aarch64 processor with kernel in 64-bit but
|
||||
userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
|
||||
userland running in the 'n32' ABI.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-1-patrickdepinguin@gmail.com/
|
||||
---
|
||||
include/linux/netfilter_bridge/ebtables.h | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
|
||||
index 5be75f2..3c2b61e 100644
|
||||
--- a/include/linux/netfilter_bridge/ebtables.h
|
||||
+++ b/include/linux/netfilter_bridge/ebtables.h
|
||||
@@ -49,12 +49,21 @@ struct ebt_replace {
|
||||
/* total size of the entries */
|
||||
unsigned int entries_size;
|
||||
/* start of the chains */
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ uint64_t hook_entry[NF_BR_NUMHOOKS];
|
||||
+#else
|
||||
struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
|
||||
+#endif
|
||||
/* nr of counters userspace expects back */
|
||||
unsigned int num_counters;
|
||||
/* where the kernel will put the old counters */
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ uint64_t counters;
|
||||
+ uint64_t entries;
|
||||
+#else
|
||||
struct ebt_counter *counters;
|
||||
char *entries;
|
||||
+#endif
|
||||
};
|
||||
|
||||
struct ebt_replace_kernel {
|
||||
@@ -129,6 +138,9 @@ struct ebt_entry_match {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int match_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -142,6 +154,9 @@ struct ebt_entry_watcher {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int watcher_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -155,6 +170,9 @@ struct ebt_entry_target {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int target_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -162,6 +180,9 @@ struct ebt_entry_target {
|
||||
struct ebt_standard_target {
|
||||
struct ebt_entry_target target;
|
||||
int verdict;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
};
|
||||
|
||||
/* one entry */
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From ebf0236270b977a62c522bc32810bc9f8edc72d1 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Wed, 24 Mar 2021 13:40:14 +0100
|
||||
Subject: [PATCH] configure.ac: add option --enable-kernel-64-userland-32
|
||||
|
||||
The ebtables build system seems to assume that 'sparc64' is the
|
||||
only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
|
||||
This situation can happen on many architectures, especially in embedded
|
||||
systems. For example, an Aarch64 processor with kernel in 64-bit but
|
||||
userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
|
||||
userland running in the 'n32' ABI.
|
||||
|
||||
While it is possible to set CFLAGS in the environment when calling the
|
||||
configure script, the caller would need to know to not only specify
|
||||
KERNEL_64_USERSPACE_32 but also the EBT_MIN_ALIGN value.
|
||||
|
||||
Instead, add a configure option. All internal details can then be handled by
|
||||
the configure script.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-2-patrickdepinguin@gmail.com/
|
||||
---
|
||||
configure.ac | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c24ede3..3e89c0c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -15,10 +15,17 @@ AS_IF([test "x$LOCKFILE" = x], [LOCKFILE="/var/lib/ebtables/lock"])
|
||||
|
||||
regular_CFLAGS="-Wall -Wunused"
|
||||
regular_CPPFLAGS=""
|
||||
+
|
||||
case "$host" in
|
||||
sparc64-*)
|
||||
- regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32";;
|
||||
+ enable_kernel_64_userland_32=yes ;;
|
||||
esac
|
||||
+AC_ARG_ENABLE([kernel-64-userland-32],
|
||||
+ AC_HELP_STRING([--enable-kernel-64-userland-32], [indicate that ebtables will be built as a 32-bit application but run under a 64-bit kernel])
|
||||
+)
|
||||
+AS_IF([test "x$enable_kernel_64_userland_32" = xyes],
|
||||
+ [regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32"]
|
||||
+)
|
||||
|
||||
AC_SUBST([regular_CFLAGS])
|
||||
AC_SUBST([regular_CPPFLAGS])
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
config BR2_PACKAGE_EBTABLES
|
||||
bool "ebtables"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
help
|
||||
Ethernet bridge frame table administration
|
||||
|
||||
http://ebtables.netfilter.org/
|
||||
|
||||
if BR2_PACKAGE_EBTABLES
|
||||
|
||||
config BR2_PACKAGE_EBTABLES_UTILS_SAVE
|
||||
bool "ebtables save"
|
||||
select BR2_PACKAGE_BASH # runtime
|
||||
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash
|
||||
help
|
||||
Install the ebtables-legacy-save tool
|
||||
|
||||
config BR2_PACKAGE_EBTABLES_UTILS_RESTORE
|
||||
bool "ebtables restore"
|
||||
help
|
||||
Install the ebtables-legacy-restore tool
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,4 @@
|
||||
# ftp://ftp.netfilter.org/pub/ebtables/ebtables-2.0.11.tar.gz.sha256sum
|
||||
sha256 b71f654784a726329f88b412ef7b96b4e5d786ed2bd28193ed7b4c0d677dfd2a ebtables-2.0.11.tar.gz
|
||||
# Locally computed
|
||||
sha256 ebdb8ae564c952792017ec680e2edd30443642216eb9f8a3d8fa166c0cb628c1 COPYING
|
||||
@@ -0,0 +1,49 @@
|
||||
################################################################################
|
||||
#
|
||||
# ebtables
|
||||
#
|
||||
################################################################################
|
||||
|
||||
EBTABLES_VERSION = 2.0.11
|
||||
EBTABLES_SITE = http://ftp.netfilter.org/pub/ebtables
|
||||
EBTABLES_LICENSE = GPL-2.0+
|
||||
EBTABLES_LICENSE_FILES = COPYING
|
||||
EBTABLES_CPE_ID_VENDOR = netfilter
|
||||
EBTABLES_SELINUX_MODULES = iptables
|
||||
|
||||
# for 0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
|
||||
EBTABLES_AUTORECONF = YES
|
||||
ifeq ($(BR2_KERNEL_64_USERLAND_32),y)
|
||||
EBTABLES_CONF_OPTS += --enable-kernel-64-userland-32
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_EBTABLES_UTILS_SAVE),y)
|
||||
define EBTABLES_INSTALL_TARGET_UTILS_SAVE
|
||||
$(INSTALL) -m 0755 -D $(@D)/ebtables-save.sh $(TARGET_DIR)/usr/sbin/ebtables-legacy-save
|
||||
endef
|
||||
EBTABLES_POST_INSTALL_TARGET_HOOKS += EBTABLES_INSTALL_TARGET_UTILS_SAVE
|
||||
else
|
||||
# ebtables-legacy-save is installed by default, thus remove it from target
|
||||
define EBTABLES_REMOVE_UTILS_SAVE
|
||||
$(RM) -f $(TARGET_DIR)/usr/sbin/ebtables-legacy-save
|
||||
endef
|
||||
EBTABLES_POST_INSTALL_TARGET_HOOKS += EBTABLES_REMOVE_UTILS_SAVE
|
||||
endif
|
||||
|
||||
# ebtables-legacy-restore is installed by default, thus remove it if not
|
||||
# selected
|
||||
ifeq ($(BR2_PACKAGE_EBTABLES_UTILS_RESTORE),)
|
||||
define EBTABLES_REMOVE_UTILS_RESTORE
|
||||
$(RM) -f $(TARGET_DIR)/usr/sbin/ebtables-legacy-restore
|
||||
endef
|
||||
EBTABLES_POST_INSTALL_TARGET_HOOKS += EBTABLES_REMOVE_UTILS_RESTORE
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_IPTABLES_NFTABLES),)
|
||||
define EBTABLES_INSTALL_LEGACY_SYMLINK
|
||||
ln -sf /usr/sbin/ebtables-legacy $(TARGET_DIR)/sbin/ebtables
|
||||
endef
|
||||
EBTABLES_POST_INSTALL_TARGET_HOOKS += EBTABLES_INSTALL_LEGACY_SYMLINK
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user