2020-08-20 18:46:50 +00:00
|
|
|
#
|
2024-04-03 22:31:22 +00:00
|
|
|
# Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
|
2020-08-20 18:46:50 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2024-04-03 22:31:22 +00:00
|
|
|
PKG_NAME:=bpftool
|
|
|
|
PKG_VERSION:=7.4.0
|
2021-04-11 00:40:21 +00:00
|
|
|
PKG_RELEASE:=1
|
2020-08-20 18:46:50 +00:00
|
|
|
|
2022-03-15 13:33:59 +00:00
|
|
|
PKG_SOURCE_URL:=https://github.com/libbpf/bpftool
|
2024-04-03 22:31:22 +00:00
|
|
|
PKG_MIRROR_HASH:=18e22f72e67ff402b5ecaf314445f25c40bfe23299cb783b5834a496297c51ed
|
2022-03-15 13:33:59 +00:00
|
|
|
PKG_SOURCE_PROTO:=git
|
2024-04-03 22:31:22 +00:00
|
|
|
PKG_SOURCE_VERSION:=v7.4.0
|
2020-08-20 18:46:50 +00:00
|
|
|
|
|
|
|
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
|
|
|
|
2024-04-03 22:31:22 +00:00
|
|
|
PKG_BUILD_FLAGS:=no-mips16 gc-sections lto
|
2020-08-20 18:46:50 +00:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
PKG_INSTALL:=1
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2020-08-30 22:54:51 +00:00
|
|
|
include $(INCLUDE_DIR)/nls.mk
|
2020-08-20 18:46:50 +00:00
|
|
|
|
|
|
|
define Package/bpftool/Default
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE:=bpftool - eBPF subsystem utility
|
|
|
|
LICENSE:=GPL-2.0-only OR BSD-2-Clause
|
|
|
|
URL:=http://www.kernel.org
|
|
|
|
DEPENDS:=+libelf
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/bpftool-minimal
|
|
|
|
$(call Package/bpftool/Default)
|
|
|
|
TITLE+= (Minimal)
|
|
|
|
VARIANT:=minimal
|
|
|
|
DEFAULT_VARIANT:=1
|
|
|
|
PROVIDES:=bpftool
|
|
|
|
ALTERNATIVES:=200:/usr/sbin/bpftool:/usr/libexec/bpftool-minimal
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/bpftool-full
|
|
|
|
$(call Package/bpftool/Default)
|
|
|
|
TITLE+= (Full)
|
|
|
|
VARIANT:=full
|
|
|
|
PROVIDES:=bpftool
|
|
|
|
ALTERNATIVES:=300:/usr/sbin/bpftool:/usr/libexec/bpftool-full
|
|
|
|
DEPENDS+= +libbfd +libopcodes
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/bpftool-minimal/description
|
|
|
|
A tool for inspection and simple manipulation of eBPF programs and maps.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/bpftool-full/description
|
|
|
|
A tool for inspection and simple manipulation of eBPF programs and maps.
|
|
|
|
This full version uses libbfd and libopcodes to support disassembly of
|
|
|
|
eBPF programs and jited code.
|
|
|
|
endef
|
|
|
|
|
2022-03-15 13:33:59 +00:00
|
|
|
ifeq ($(BUILD_VARIANT),full)
|
|
|
|
full:=1
|
|
|
|
else
|
|
|
|
full:=0
|
|
|
|
endif
|
|
|
|
|
2021-04-11 00:40:21 +00:00
|
|
|
MAKE_FLAGS += \
|
2020-08-20 18:46:50 +00:00
|
|
|
OUTPUT="$(PKG_BUILD_DIR)/" \
|
|
|
|
prefix="/usr" \
|
2022-03-15 13:33:59 +00:00
|
|
|
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
|
|
|
|
check_feat=0 \
|
|
|
|
feature-clang-bpf-co-re=0 \
|
|
|
|
feature-libbfd=$(full) \
|
2023-02-25 21:21:15 +00:00
|
|
|
feature-llvm=0 \
|
2022-03-15 13:33:59 +00:00
|
|
|
feature-libcap=0 \
|
2023-02-25 21:21:15 +00:00
|
|
|
feature-disassembler-four-args=1 \
|
2023-02-26 14:47:09 +00:00
|
|
|
feature-disassembler-init-styled=1
|
2022-03-15 13:33:59 +00:00
|
|
|
|
2023-05-21 09:14:37 +00:00
|
|
|
MAKE_PATH = src
|
2020-08-20 18:46:50 +00:00
|
|
|
|
|
|
|
define Package/bpftool-$(BUILD_VARIANT)/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/libexec
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bpftool \
|
|
|
|
$(1)/usr/libexec/bpftool-$(BUILD_VARIANT)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,bpftool-full))
|
|
|
|
$(eval $(call BuildPackage,bpftool-minimal))
|