Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
config BR2_PACKAGE_NFTABLES
bool "nftables"
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
select BR2_PACKAGE_LIBMNL
select BR2_PACKAGE_LIBNFTNL
help
nftables is the project that aims to replace the existing
{ip,ip6,arp,eb}tables framework.
Basically, this project provides a new packet filtering
framework, a new userspace utility and also a compatibility
layer for {ip,ip6}tables.
http://www.netfilter.org/projects/nftables/index.html
if BR2_PACKAGE_NFTABLES
# Legacy: this used to be handled in nftables.mk
source "package/nftables/nftables-python/Config.in"
config BR2_PACKAGE_NFTABLES_JSON
bool "json support"
select BR2_PACKAGE_JANSSON
endif
comment "nftables needs a toolchain w/ wchar, headers >= 3.12"
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12

View File

@@ -0,0 +1,76 @@
#!/bin/sh
DAEMON="nftables"
# Main ruleset file, override in /etc/default/nftables if you want a
# different location. The file should include a "flush ruleset"
# command to atomically replace any previous rules on reload (instead
# of adding to them).
NFTABLES_CONFIG="/etc/nftables.conf"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
# Run only if the ruleset file exists.
if [ ! -f "${NFTABLES_CONFIG}" ]; then
echo "${NFTABLES_CONFIG} does not exist, nothing to do."
exit 0
fi
start() {
printf "Loading nftables rules: "
/usr/sbin/nft --file "${NFTABLES_CONFIG}"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf "Clearing nftables rules: "
/usr/sbin/nft flush ruleset
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
start
}
reload() {
FLUSH='flush ruleset'
if ! grep -q -x "$FLUSH" "${NFTABLES_CONFIG}"; then
printf 'WARNING: no "%s" in %s, duplicated rules likely\n' \
"$FLUSH" "${NFTABLES_CONFIG}"
fi
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit $?

View File

@@ -0,0 +1,4 @@
config BR2_PACKAGE_NFTABLES_PYTHON
bool "python bindings"
default y # legacy
depends on BR2_PACKAGE_PYTHON3

View File

@@ -0,0 +1 @@
../nftables.hash

View File

@@ -0,0 +1,22 @@
################################################################################
#
# nftables-python
#
################################################################################
# The following assignments work only because nftables.mk is included before
# this file is.
NFTABLES_PYTHON_VERSION = $(NFTABLES_VERSION)
NFTABLES_PYTHON_SOURCE = $(NFTABLES_SOURCE)
NFTABLES_PYTHON_SITE = $(NFTABLES_SITE)
NFTABLES_PYTHON_LICENSE = $(NFTABLES_LICENSE)
NFTABLES_PYTHON_LICENSE_FILES = $(NFTABLES_LICENSE_FILES)
# We share the same source code as nftables
NFTABLES_PYTHON_DL_SUBDIR = nftables
NFTABLES_PYTHON_SUBDIR = py
NFTABLES_PYTHON_SETUP_TYPE = setuptools
$(eval $(python-package))

View File

@@ -0,0 +1,9 @@
# From https://netfilter.org/projects/nftables/downloads.html
# Checked pgp signature:
# https://netfilter.org/projects/nftables/files/nftables-1.1.4.tar.xz.sig
# with key:
# https://netfilter.org/files/coreteam-gpg-key-0xD55D978A8A1420E4.txt
# https://www.netfilter.org/projects/nftables/files/nftables-1.1.4.tar.xz.sha256sum
sha256 3444f0012af0472399eeae89a758b9c6dc5f311f6c67a48988fa1600fc4bac86 nftables-1.1.4.tar.xz
# Locally computed:
sha256 4ee1e51baf5f3166712fa0c3e01338c7257e50ddef245d28bb14ad68f6070ba5 COPYING

View File

@@ -0,0 +1,68 @@
################################################################################
#
# nftables
#
################################################################################
NFTABLES_VERSION = 1.1.4
NFTABLES_SOURCE = nftables-$(NFTABLES_VERSION).tar.xz
NFTABLES_SITE = https://www.netfilter.org/projects/nftables/files
NFTABLES_DEPENDENCIES = libmnl libnftnl host-pkgconf $(TARGET_NLS_DEPENDENCIES)
NFTABLES_LICENSE = GPL-2.0
NFTABLES_LICENSE_FILES = COPYING
NFTABLES_INSTALL_STAGING = YES
NFTABLES_SELINUX_MODULES = iptables
# Python bindings are handled by package nftables-python
NFTABLES_CONF_OPTS = \
--disable-debug \
--disable-man-doc \
--disable-pdf-doc \
--disable-python
ifeq ($(BR2_PACKAGE_GMP),y)
NFTABLES_DEPENDENCIES += gmp
NFTABLES_CONF_OPTS += --without-mini-gmp
else
NFTABLES_CONF_OPTS += --with-mini-gmp
endif
ifeq ($(BR2_PACKAGE_LIBEDIT),y)
NFTABLES_CONF_OPTS += --with-cli=editline
NFTABLES_DEPENDENCIES += libedit
NFTABLES_LIBS += -lncurses
else ifeq ($(BR2_PACKAGE_READLINE),y)
NFTABLES_CONF_OPTS += --with-cli=readline
NFTABLES_DEPENDENCIES += readline
NFTABLES_LIBS += -lncurses
else ifeq ($(BR2_PACKAGE_LINENOISE),y)
NFTABLES_CONF_OPTS += --with-cli=linenoise
NFTABLES_DEPENDENCIES += linenoise
else
NFTABLES_CONF_OPTS += --without-cli
endif
ifeq ($(BR2_PACKAGE_NFTABLES_JSON),y)
NFTABLES_DEPENDENCIES += jansson
NFTABLES_CONF_OPTS += --with-json
else
NFTABLES_CONF_OPTS += --without-json
endif
NFTABLES_CONF_ENV = LIBS="$(NFTABLES_LIBS)"
define NFTABLES_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER)
$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES)
$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_INET)
endef
define NFTABLES_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/nftables/S35nftables \
$(TARGET_DIR)/etc/init.d/S35nftables
endef
$(eval $(autotools-package))
# Legacy: we used to handle it in this .mk
include package/nftables/nftables-python/nftables-python.mk