package/netavark: new package

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Julien Olivain <ju.o@free.fr>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Yann E. MORIN
2025-03-15 20:57:07 +01:00
committed by Julien Olivain
parent 2795fecc50
commit 7289731adf
4 changed files with 108 additions and 0 deletions

View File

@@ -2560,6 +2560,7 @@ endif
source "package/ndisc6/Config.in"
source "package/net-tools/Config.in"
source "package/netatalk/Config.in"
source "package/netavark/Config.in"
source "package/netcalc/Config.in"
source "package/netcat/Config.in"
source "package/netcat-openbsd/Config.in"

View File

@@ -0,0 +1,12 @@
config BR2_PACKAGE_NETAVARK
bool "netavark"
depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
select BR2_PACKAGE_HOST_RUSTC
select BR2_PACKAGE_IPTABLES if !BR2_PACKAGE_NFTABLES # runtime
select BR2_PACKAGE_NFTABLES_JSON if BR2_PACKAGE_NFTABLES && !BR2_PACKAGE_IPTABLES
help
Netavark is a rust based network stack for containers. It
is being designed to work with Podman but is also applicable
for other OCI container management applications.
https://github.com/containers/netavark

View File

@@ -0,0 +1,3 @@
# Locally computed
sha256 09471bd116fdebfd3f7a8100b37809e3a306d0f18e5feee8445ed1e01a22e0aa netavark-v1.14.0-git4-cargo2.tar.gz
sha256 c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE

View File

@@ -0,0 +1,92 @@
################################################################################
#
# netavark
#
################################################################################
NETAVARK_VERSION = v1.14.0
NETAVARK_SITE = https://github.com/containers/netavark
NETAVARK_SITE_METHOD = git
NETAVARK_LICENSE = Apache-2.0
NETAVARK_LICENSE_FILES = LICENSE
# For protoc
NETAVARK_DEPENDENCIES = host-protobuf
NETAVARK_CARGO_ENV = PROTOC=$(HOST_DIR)/bin/protoc
# In case only nftables is enabled, use that as the firwewall backend
ifeq ($(BR2_PACKAGE_IPTABLES).$(BR2_PACKAGE_NFTABLES),.y)
define NETAVARK_CONFIG_NFTABLES
$(Q)mkdir -p $(TARGET_DIR)/etc/containers/containers.conf.d/
printf '[network]\nfirewall_driver = "nftables"\n' \
> $(TARGET_DIR)/etc/containers/containers.conf.d/50-buildroot-nftables.conf
endef
NETAVARK_POST_INSTALL_TARGET_HOOKS += NETAVARK_CONFIG_NFTABLES
# See https://github.com/containers/netavark/issues/1057#issuecomment-2286149984
define NETAVARK_LINUX_CONFIG_FIXUPS_NFTABLES
$(call KCONFIG_ENABLE_OPT,CONFIG_IPV6)
$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES)
$(call KCONFIG_ENABLE_OPT,CONFIG_NF_TABLES_INET)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_NUMGEN)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_CT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FLOW_OFFLOAD)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_CONNLIMIT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_LOG)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_LIMIT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_MASQ)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REDIR)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_NAT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_TUNNEL)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_QUEUE)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_QUOTA)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REJECT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REJECT_INET)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_COMPAT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_HASH)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FIB)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FIB_INET)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_XFRM)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_SOCKET)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_TPROXY)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_SYNPROXY)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_DUP_NETDEV)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FWD_NETDEV)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FIB_NETDEV)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REJECT_NETDEV)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REJECT_IPV4)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_DUP_IPV4)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FIB_IPV4)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_COMPAT_ARP)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_REJECT_IPV6)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_DUP_IPV6)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_FIB_IPV6)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_BRIDGE_META)
$(call KCONFIG_ENABLE_OPT,CONFIG_NFT_BRIDGE_REJECT)
endef
endif
define NETAVARK_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_ADVANCED)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XTABLES)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XT_MATCH_COMMENT)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XT_MATCH_CONNTRACK)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XT_MARK)
$(call KCONFIG_ENABLE_OPT,CONFIG_NETFILTER_XT_MATCH_IPVS)
$(call KCONFIG_ENABLE_OPT,CONFIG_NF_CONNTRACK)
$(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_IPTABLES)
$(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_FILTER)
$(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_NAT)
$(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_TARGET_MASQUERADE)
$(call KCONFIG_ENABLE_OPT,CONFIG_BRIDGE)
$(call KCONFIG_ENABLE_OPT,CONFIG_BRIDGE_NETFILTER)
$(call KCONFIG_ENABLE_OPT,CONFIG_NET_CORE)
$(call KCONFIG_ENABLE_OPT,CONFIG_VETH)
$(NETAVARK_LINUX_CONFIG_FIXUPS_NFTABLES)
endef
$(eval $(cargo-package))