summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2024-04-25 12:39:29 +0300
committervkalintiris <vasilis@netdata.cloud>2024-04-25 12:39:29 +0300
commite99f29f099f556247df6141b2bbf9bbf08eeb7d5 (patch)
tree4636fd4ac07f2f59cb7ee50d0045a3fababbff04
parentf1ce4854fc0a849a5d40186b800b52d1d727a421 (diff)
Add ebpf-code-legacy package
-rwxr-xr-xbuild-debs.sh1
-rw-r--r--packaging/cmake/Modules/Packaging.cmake25
-rwxr-xr-xpackaging/cmake/control/ebpf-code-legacy/postinst11
-rwxr-xr-xpackaging/cmake/control/ebpf-code-legacy/preinst11
4 files changed, 48 insertions, 0 deletions
diff --git a/build-debs.sh b/build-debs.sh
index 4d70c0a36c..c35b26288c 100755
--- a/build-debs.sh
+++ b/build-debs.sh
@@ -26,6 +26,7 @@ packages=(
[chartsd]=netdata-plugin-chartsd_6.7.8_all.deb
[cups]=netdata-plugin-cups_6.7.8_amd64.deb
[debugfs]=netdata-plugin-debugfs_6.7.8_amd64.deb
+ [ebpf_code_legacy]=netdata-ebpf-code-legacy_6.7.8_amd64.deb
[ebpf]=netdata-plugin-ebpf_6.7.8_amd64.deb
[freeipmi]=netdata-plugin-freeipmi_6.7.8_amd64.deb
[god]=netdata-plugin-go_6.7.8_amd64.deb
diff --git a/packaging/cmake/Modules/Packaging.cmake b/packaging/cmake/Modules/Packaging.cmake
index 5c3fe0c5ac..955999e86e 100644
--- a/packaging/cmake/Modules/Packaging.cmake
+++ b/packaging/cmake/Modules/Packaging.cmake
@@ -192,6 +192,30 @@ set(CPACK_DEBIAN_PLUGIN-EBPF_PACKAGE_CONTROL_EXTRA
set(CPACK_DEBIAN_PLUGIN-EBPF_DEBUGINFO_PACKAGE On)
#
+# ebpf-code-legacy
+#
+
+set(CPACK_COMPONENT_EBPF-CODE-LEGACY_DEPENDS "netdata")
+set(CPACK_COMPONENT_EBPF-CODE-LEGACY_DESCRIPTION
+ "Compiled eBPF legacy code for the Netdata eBPF plugin
+This package provides the pre-compiled eBPF legacy code for use by
+the Netdata eBPF plugin. This code is only needed when using the eBPF
+plugin with kernel that do not include BTF support (mostly kernel
+versions lower than 5.10).")
+
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_NAME "netdata-ebpf-code-legacy")
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_SECTION "net")
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_CONFLICTS "netdata (<< ${CPACK_PACKAGE_VERSION})")
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_PREDEPENDS "adduser")
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_DEPENDS "netdata-plugin-ebpf (= ${CPACK_PACKAGE_VERSION})")
+
+set(CPACK_DEBIAN_EBPF-CODE-LEGACY_PACKAGE_CONTROL_EXTRA
+ "${CMAKE_SOURCE_DIR}/packaging/cmake/control/ebpf-code-legacy/preinst;"
+ "${CMAKE_SOURCE_DIR}/packaging/cmake/control/ebpf-code-legacy/postinst")
+
+set(CPACK_DEBIAN_PLUGIN-EBPF_DEBUGINFO_PACKAGE Off)
+
+#
# freeipmi.plugin
#
@@ -413,6 +437,7 @@ set(CPACK_DEBIAN_PLUGIN-XENSTAT_DEBUGINFO_PACKAGE On)
# CPack components
#
+list(APPEND CPACK_COMPONENTS_ALL "ebpf-code-legacy")
list(APPEND CPACK_COMPONENTS_ALL "netdata")
list(APPEND CPACK_COMPONENTS_ALL "plugin-apps")
list(APPEND CPACK_COMPONENTS_ALL "plugin-chartsd")
diff --git a/packaging/cmake/control/ebpf-code-legacy/postinst b/packaging/cmake/control/ebpf-code-legacy/postinst
new file mode 100755
index 0000000000..d6fe867234
--- /dev/null
+++ b/packaging/cmake/control/ebpf-code-legacy/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-ebpf-code-legacy.list | xargs -n 30 chown root:netdata
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/control/ebpf-code-legacy/preinst b/packaging/cmake/control/ebpf-code-legacy/preinst
new file mode 100755
index 0000000000..57615ec063
--- /dev/null
+++ b/packaging/cmake/control/ebpf-code-legacy/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac