b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | include $(TOPDIR)/rules.mk |
| 2 | |
| 3 | PKG_NAME:=ucode-mod-bpf |
| 4 | PKG_RELEASE:=1 |
| 5 | PKG_LICENSE:=ISC |
| 6 | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> |
| 7 | |
| 8 | include $(INCLUDE_DIR)/package.mk |
| 9 | include $(INCLUDE_DIR)/nls.mk |
| 10 | |
| 11 | define Package/ucode-mod-bpf |
| 12 | SECTION:=utils |
| 13 | CATEGORY:=Utilities |
| 14 | TITLE:=ucode eBPF module |
| 15 | DEPENDS:=+libucode +libbpf |
| 16 | endef |
| 17 | |
| 18 | define Package/ucode-mod-bpf/description |
| 19 | The bpf plugin provides functionality for loading and interacting with |
| 20 | eBPF modules. |
| 21 | |
| 22 | It allows loading full modules and pinned maps/programs and supports |
| 23 | interacting with maps and attaching programs as tc classifiers. |
| 24 | endef |
| 25 | |
| 26 | define Package/ucode-mod-bpf/install |
| 27 | $(INSTALL_DIR) $(1)/usr/lib/ucode |
| 28 | $(CP) $(PKG_BUILD_DIR)/bpf.so $(1)/usr/lib/ucode/ |
| 29 | endef |
| 30 | |
| 31 | define Build/Configure |
| 32 | endef |
| 33 | |
| 34 | define Build/Compile |
| 35 | $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) $(FPIC) \ |
| 36 | -Wall -ffunction-sections -Wl,--gc-sections -shared -Wl,--no-as-needed -lbpf \ |
| 37 | -o $(PKG_BUILD_DIR)/bpf.so $(PKG_BUILD_DIR)/bpf.c |
| 38 | endef |
| 39 | |
| 40 | $(eval $(call BuildPackage,ucode-mod-bpf)) |