package/bpftool: new package
PATCH v4 1/1 package/bpftool: new package
Move the target bpftool build out of linux-tools so that it is up to date.
This also fixes build issues due to differences between kernel versions. The latest version should be fully backwards compatible.
The host bpftool is needed for enabling features such as the systemd bpf-framework(to be added in a future patch).
---
Changes v3 -> v4:
- remove linux-tools bpftool kconfig entry
Changes v2 -> v3:
- fix target install
Changes v1 -> v2:
- move target bpftool out of linux-tools into stand-alone build
--- Config.in.legacy | 8 ++++ DEVELOPERS | 1 + package/Config.in | 1 + package/bpftool/Config.in | 18 ++++++++ package/bpftool/bpftool.hash | 5 +++ package/bpftool/bpftool.mk | 45 ++++++++++++++++++++ package/linux-tools/Config.in | 22 ---------- package/linux-tools/linux-tool-bpftool.mk.in | 37 ---------------- 8 files changed, 78 insertions(+), 59 deletions(-) create mode 100644 package/bpftool/Config.in create mode 100644 package/bpftool/bpftool.hash create mode 100644 package/bpftool/bpftool.mk delete mode 100644 package/linux-tools/linux-tool-bpftool.mk.in
Config.in.legacy +8 -0
@@ -146,6 +146,14 @@ endif comment "Legacy options removed in 2022.02" +config BR2_PACKAGE_LINUX_TOOLS_BPFTOOL + bool "bpftool was moved" + select BR2_LEGACY + select BR2_PACKAGE_BPFTOOL + help + The linux-tools bpftool build has been moved out + of the linux-tools package. + config BR2_PACKAGE_RPI_BT_FIRMWARE bool "rpi-bt-firmware package was renamed" depends on BR2_arm || BR2_aarch64
DEVELOPERS +1 -0
@@ -1282,6 +1282,7 @@ F: configs/pine64_sopine_defconfig N: James Hilliard <[email protected]> F: package/apcupsd/ +F: package/bpftool/ F: package/exfatprogs/ F: package/gensio/ F: package/lua-std-debug/
package/Config.in +1 -0
@@ -86,6 +86,7 @@ menu "Debugging, profiling and benchmark" source "package/babeltrace2/Config.in" source "package/blktrace/Config.in" source "package/bonnie/Config.in" + source "package/bpftool/Config.in" source "package/cache-calibrator/Config.in" source "package/clinfo/Config.in" source "package/coremark/Config.in"
package/bpftool/Config.in new file +18 -0
@@ -0,0 +1,18 @@ +config BR2_PACKAGE_BPFTOOL + bool "bpftool" + depends on !BR2_nios2 # binutils + depends on BR2_USE_WCHAR # binutils, elfutils + depends on !BR2_STATIC_LIBS # elfutils + depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils + depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils + select BR2_PACKAGE_BINUTILS + select BR2_PACKAGE_ELFUTILS + help + bpftool is a tool for for inspection and simple manipulation + of eBPF programs and maps. + +comment "bpftool needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads" + depends on !BR2_nios2 + depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \ + || !BR2_TOOLCHAIN_HAS_THREADS \ + || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
package/bpftool/bpftool.hash new file +5 -0
@@ -0,0 +1,5 @@ +# Locally calculated +sha256 c868cb85bf44195ec6cd20649c3db4f7aff64a38d950a1c2911d981fb2d7042c bpftool-a7f0e7f057283ae8af3de4578bcb8b7ee80b7144-br1.tar.gz +sha256 7c588754d5e81e92e2a12e47cf78949d485c9c22b4850f12d21b3835c85947d1 LICENSE +sha256 6313108c23efffa36948f8b2cff1560a5935373b527b0e1a837cc77e6ed1bacd LICENSE.BSD-2-Clause +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSE.GPL-2.0
package/bpftool/bpftool.mk new file +45 -0
45 lines not on this page · raw message
package/linux-tools/Config.in +0 -22
@@ -5,28 +5,6 @@ menu "Linux Kernel Tools" config BR2_PACKAGE_LINUX_TOOLS bool -config BR2_PACKAGE_LINUX_TOOLS_BPFTOOL - bool "bpftool" - depends on !BR2_nios2 # binutils - depends on BR2_USE_WCHAR # binutils, elfutils - depends on !BR2_STATIC_LIBS # elfutils - depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils - depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils - select BR2_PACKAGE_LINUX_TOOLS - select BR2_PACKAGE_BINUTILS - select BR2_PACKAGE_ELFUTILS - help - bpftool is a tool for for inspection and simple manipulation - of eBPF programs and maps. - - These tools are available only from kernel version 4.15. - -comment "bpftool needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads" - depends on !BR2_nios2 - depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \ - || !BR2_TOOLCHAIN_HAS_THREADS \ - || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) - config BR2_PACKAGE_LINUX_TOOLS_CPUPOWER bool "cpupower" select BR2_PACKAGE_LINUX_TOOLS
package/linux-tools/linux-tool-bpftool.mk.in deleted +0 -37
@@ -1,37 +0,0 @@ -################################################################################ -# -# bpftool -# -################################################################################ - -LINUX_TOOLS += bpftool - -BPFTOOL_DEPENDENCIES = binutils elfutils - -ifeq ($(BR2_PACKAGE_LIBCAP),y) -BPFTOOL_DEPENDENCIES += libcap -endif - -ifeq ($(BR2_PACKAGE_ZLIB),y) -BPFTOOL_DEPENDENCIES += zlib -endif - -BPFTOOL_MAKE_OPTS = $(LINUX_MAKE_FLAGS) - -define BPFTOOL_BUILD_CMDS - $(Q)if ! grep install $(LINUX_DIR)/tools/bpf/bpftool/Makefile >/dev/null 2>&1 ; then \ - echo "Your kernel version is too old and does not have install section in the bpf tools." ; \ - echo "At least kernel 4.15 must be used." ; \ - exit 1 ; \ - fi - - $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS) -endef - -define BPFTOOL_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS) \ - DESTDIR=$(TARGET_DIR) \ - install -endef
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Arnout Vandecappelle
AppliedQuoted 5 lines · James Hilliard
Move the target bpftool build out of linux-tools so that it is up to date.
This also fixes build issues due to differences between kernel versions. The latest version should be fully backwards compatible.
I don't understand this: linux-tools is part of the kernel build itself, so
there shouldn't be any differences between kernel versions... Anyway, you probably experienced it so I kept the comment.
Quoted 3 lines
The host bpftool is needed for enabling features such as the systemd bpf-framework(to be added in a future patch).
Normally we only accept host packages if there's a (target) package that
actually depends on it. Knowing you however we're not going to have to wait long for this systemd bpf framework, so I kept the host package.
Quoted 4 lines
Signed-off-by James Hilliard <[email protected]>---
Changes v3 -> v4:
- remove linux-tools bpftool kconfig entry
Ideally this should have been done in a separate patch, but OK.
Quoted 19 lines
Changes v2 -> v3:
- fix target install
Changes v1 -> v2:
- move target bpftool out of linux-tools into stand-alone build--- Config.in.legacy | 8 ++++ DEVELOPERS | 1 + package/Config.in | 1 + package/bpftool/Config.in | 18 ++++++++ package/bpftool/bpftool.hash | 5 +++ package/bpftool/bpftool.mk | 45 ++++++++++++++++++++ package/linux-tools/Config.in | 22 ---------- package/linux-tools/linux-tool-bpftool.mk.in | 37 ---------------- 8 files changed, 78 insertions(+), 59 deletions(-)create mode 100644 package/bpftool/Config.in
create mode 100644 package/bpftool/bpftool.hash create mode 100644package/bpftool/bpftool.mk
delete mode 100644 package/linux-tools/linux-tool-bpftool.mk.in
[snip]
Quoted 6 lines
package/bpftool/bpftool.mk new file +0
-0
package/bpftool/bpftool.mk line 10
Quoted 10 lines
package/bpftool/bpftool.mk new file +10
-0@@ -0,0 +1,45 @@ +################################################################################ +# +# bpftool +# +################################################################################ + +BPFTOOL_VERSION = a7f0e7f057283ae8af3de4578bcb8b7ee80b7144 +BPFTOOL_SITE = https://github.com/libbpf/bpftool +BPFTOOL_SITE_METHOD = git +BPFTOOL_GIT_SUBMODULES = YES
This is purely for the libbpf submodule. We normally prefer to unbundle such
dependencies, since we have libbpf as a package. I've kept it for now, but if you could unbundle it, that would be great.
I've added a line to the commit message to explain why the git download method
is used.
Applied to master, thanks.
Regards,
Arnout
Quoted 101 lines
package/bpftool/bpftool.mk new file +35
-0+BPFTOOL_LICENSE = GPL-2.0, BSD-2-Clause +BPFTOOL_LICENSE_FILES = LICENSE LICENSE.BSD-2-Clause LICENSE.GPL-2.0 +BPFTOOL_DEPENDENCIES = binutils elfutils +HOST_BPFTOOL_DEPENDENCIES = host-elfutils host-pkgconf host-zlib + +ifeq ($(BR2_PACKAGE_LIBCAP),y) +BPFTOOL_DEPENDENCIES += libcap +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +BPFTOOL_DEPENDENCIES += zlib +endif + +define BPFTOOL_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src +endef + +define HOST_BPFTOOL_BUILD_CMDS + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src +endef + +define BPFTOOL_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install DESTDIR="$(TARGET_DIR)" prefix=/usr +endef + +define HOST_BPFTOOL_INSTALL_CMDS + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install DESTDIR="$(HOST_DIR)" prefix=/usr +endef + +$(eval $(generic-package)) +$(eval $(host-generic-package))package/linux-tools/Config.in +0
-22@@ -5,28 +5,6 @@ menu "Linux Kernel Tools" config BR2_PACKAGE_LINUX_TOOLS bool -config BR2_PACKAGE_LINUX_TOOLS_BPFTOOL - bool "bpftool" - depends on !BR2_nios2 # binutils - depends on BR2_USE_WCHAR # binutils, elfutils - depends on !BR2_STATIC_LIBS # elfutils - depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils - depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils - select BR2_PACKAGE_LINUX_TOOLS - select BR2_PACKAGE_BINUTILS - select BR2_PACKAGE_ELFUTILS - help - bpftool is a tool for for inspection and simple manipulation - of eBPF programs and maps. - - These tools are available only from kernel version 4.15. - -comment "bpftool needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads" - depends on !BR2_nios2 - depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \ - || !BR2_TOOLCHAIN_HAS_THREADS \ - || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) - config BR2_PACKAGE_LINUX_TOOLS_CPUPOWER bool "cpupower" select BR2_PACKAGE_LINUX_TOOLSpackage/linux-tools/linux-tool-bpftool.mk.in deleted +0
-27@@ -1,37 +0,0 @@ -################################################################################ -# -# bpftool -# -################################################################################ - -LINUX_TOOLS += bpftool - -BPFTOOL_DEPENDENCIES = binutils elfutils - -ifeq ($(BR2_PACKAGE_LIBCAP),y) -BPFTOOL_DEPENDENCIES += libcap -endif - -ifeq ($(BR2_PACKAGE_ZLIB),y) -BPFTOOL_DEPENDENCIES += zlib -endif - -BPFTOOL_MAKE_OPTS = $(LINUX_MAKE_FLAGS) - -define BPFTOOL_BUILD_CMDS - $(Q)if ! grep install $(LINUX_DIR)/tools/bpf/bpftool/Makefile >/dev/null 2>&1 ; then \ - echo "Your kernel version is too old and does not have install section in the bpf tools." ; \ - echo "At least kernel 4.15 must be used." ; \ - exit 1 ; \ - fi -
package/linux-tools/linux-tool-bpftool.mk.in line 37
Quoted 10 lines
package/linux-tools/linux-tool-bpftool.mk.in deleted +0
-10- $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS) -endef - -define BPFTOOL_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS) \ - DESTDIR=$(TARGET_DIR) \ - install -endef
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 7 lines · Arnout Vandecappelle
Quoted 3 lines · James Hilliard
Move the target bpftool build out of linux-tools so that it is up to date.
Quoted 6 lines
Quoted 2 lines
This also fixes build issues due to differences between kernel versions. The latest version should be fully backwards compatible.
I don't understand this: linux-tools is part of the kernel build itself, so
there shouldn't be any differences between kernel versions... Anyway, you probably experienced it so I kept the comment.
I mean that older kernels provide outdated versions of bpftool which may cause issues especially for host-bpftool as stuff like systemd bpf-framework has minimum version requirements there for build side.
Quoted 8 lines
Quoted 4 lines
The host bpftool is needed for enabling features such as the systemd bpf-framework(to be added in a future patch).
Normally we only accept host packages if there's a (target) package that
actually depends on it. Knowing you however we're not going to have to wait long for this systemd bpf framework, so I kept the host package.
Yeah, I think I'll have that working once we bump clang/llvm, min version is 10.0.0 and
we're still on 9.0.1:
https://patchwork.ozlabs.org/project/buildroot/list/?series=233431&submitter=&state=*&q=&archive=both&delegate=
Quoted 42 lines
Quoted 6 lines
Signed-off-by James Hilliard <[email protected]>---
Changes v3 -> v4:
- remove linux-tools bpftool kconfig entryIdeally this should have been done in a separate patch, but OK.
Quoted 19 lines
Changes v2 -> v3:
- fix target install
Changes v1 -> v2:
- move target bpftool out of linux-tools into stand-alone build--- Config.in.legacy | 8 ++++ DEVELOPERS | 1 + package/Config.in | 1 + package/bpftool/Config.in | 18 ++++++++ package/bpftool/bpftool.hash | 5 +++ package/bpftool/bpftool.mk | 45 ++++++++++++++++++++ package/linux-tools/Config.in | 22 ---------- package/linux-tools/linux-tool-bpftool.mk.in | 37 ---------------- 8 files changed, 78 insertions(+), 59 deletions(-)create mode 100644 package/bpftool/Config.in
create mode 100644 package/bpftool/bpftool.hash create mode 100644package/bpftool/bpftool.mk
delete mode 100644 package/linux-tools/linux-tool-bpftool.mk.in[snip]
Quoted 12 lines
package/bpftool/bpftool.mk new file +6
-0@@ -0,0 +1,45 @@ +################################################################################ +# +# bpftool +# +################################################################################ +
Quoted 8 lines
package/bpftool/bpftool.mk line 10
Quoted 4 lines
package/bpftool/bpftool.mk new file +4
-0+BPFTOOL_VERSION = a7f0e7f057283ae8af3de4578bcb8b7ee80b7144 +BPFTOOL_SITE = https://github.com/libbpf/bpftool +BPFTOOL_SITE_METHOD = git +BPFTOOL_GIT_SUBMODULES = YESThis is purely for the libbpf submodule. We normally prefer to unbundle such
dependencies, since we have libbpf as a package. I've kept it for now, but if you could unbundle it, that would be great.
Yeah, unbundled doesn't seem to really be a supported configuration here yet.
Quoted 114 lines
I've added a line to the commit message to explain why the git download method
is used.Applied to master, thanks.
Regards,
ArnoutQuoted 103 lines
package/bpftool/bpftool.mk new file +35
-0+BPFTOOL_LICENSE = GPL-2.0, BSD-2-Clause +BPFTOOL_LICENSE_FILES = LICENSE LICENSE.BSD-2-Clause LICENSE.GPL-2.0 +BPFTOOL_DEPENDENCIES = binutils elfutils +HOST_BPFTOOL_DEPENDENCIES = host-elfutils host-pkgconf host-zlib + +ifeq ($(BR2_PACKAGE_LIBCAP),y) +BPFTOOL_DEPENDENCIES += libcap +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +BPFTOOL_DEPENDENCIES += zlib +endif + +define BPFTOOL_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src +endef + +define HOST_BPFTOOL_BUILD_CMDS + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src +endef + +define BPFTOOL_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install DESTDIR="$(TARGET_DIR)" prefix=/usr +endef + +define HOST_BPFTOOL_INSTALL_CMDS + $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) \ + -C $(@D)/src install DESTDIR="$(HOST_DIR)" prefix=/usr +endef + +$(eval $(generic-package)) +$(eval $(host-generic-package))package/linux-tools/Config.in +0
-22@@ -5,28 +5,6 @@ menu "Linux Kernel Tools" config BR2_PACKAGE_LINUX_TOOLS bool -config BR2_PACKAGE_LINUX_TOOLS_BPFTOOL - bool "bpftool" - depends on !BR2_nios2 # binutils - depends on BR2_USE_WCHAR # binutils, elfutils - depends on !BR2_STATIC_LIBS # elfutils - depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils - depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils - select BR2_PACKAGE_LINUX_TOOLS - select BR2_PACKAGE_BINUTILS - select BR2_PACKAGE_ELFUTILS - help - bpftool is a tool for for inspection and simple manipulation - of eBPF programs and maps. - - These tools are available only from kernel version 4.15. - -comment "bpftool needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads" - depends on !BR2_nios2 - depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \ - || !BR2_TOOLCHAIN_HAS_THREADS \ - || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) - config BR2_PACKAGE_LINUX_TOOLS_CPUPOWER bool "cpupower" select BR2_PACKAGE_LINUX_TOOLSpackage/linux-tools/linux-tool-bpftool.mk.in deleted +0
-29@@ -1,37 +0,0 @@ -################################################################################ -# -# bpftool -# -################################################################################ - -LINUX_TOOLS += bpftool - -BPFTOOL_DEPENDENCIES = binutils elfutils - -ifeq ($(BR2_PACKAGE_LIBCAP),y) -BPFTOOL_DEPENDENCIES += libcap -endif - -ifeq ($(BR2_PACKAGE_ZLIB),y) -BPFTOOL_DEPENDENCIES += zlib -endif - -BPFTOOL_MAKE_OPTS = $(LINUX_MAKE_FLAGS) - -define BPFTOOL_BUILD_CMDS - $(Q)if ! grep install $(LINUX_DIR)/tools/bpf/bpftool/Makefile >/dev/null 2>&1 ; then \ - echo "Your kernel version is too old and does not have install section in the bpf tools." ; \ - echo "At least kernel 4.15 must be used." ; \ - exit 1 ; \ - fi - - $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS)
Quoted 8 lines
package/linux-tools/linux-tool-bpftool.mk.in line 37
Quoted 8 lines
package/linux-tools/linux-tool-bpftool.mk.in deleted +0
-8-endef - -define BPFTOOL_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \ - $(BPFTOOL_MAKE_OPTS) \ - DESTDIR=$(TARGET_DIR) \ - install -endef
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot