blob: a748b9dbbd0df6a23166096dfd962d0f59c38f3b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001include $(TOPDIR)/rules.mk
2
3PKG_NAME:=ucode-mod-bpf
4PKG_RELEASE:=1
5PKG_LICENSE:=ISC
6PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
7
8include $(INCLUDE_DIR)/package.mk
9include $(INCLUDE_DIR)/nls.mk
10
11define Package/ucode-mod-bpf
12 SECTION:=utils
13 CATEGORY:=Utilities
14 TITLE:=ucode eBPF module
15 DEPENDS:=+libucode +libbpf
16endef
17
18define Package/ucode-mod-bpf/description
19The bpf plugin provides functionality for loading and interacting with
20eBPF modules.
21
22It allows loading full modules and pinned maps/programs and supports
23interacting with maps and attaching programs as tc classifiers.
24endef
25
26define Package/ucode-mod-bpf/install
27 $(INSTALL_DIR) $(1)/usr/lib/ucode
28 $(CP) $(PKG_BUILD_DIR)/bpf.so $(1)/usr/lib/ucode/
29endef
30
31define Build/Configure
32endef
33
34define 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
38endef
39
40$(eval $(call BuildPackage,ucode-mod-bpf))