From 79d23e1e3e6a74e74fed38290425befaa6886348 Mon Sep 17 00:00:00 2001 From: Christophe Priouzeau Date: Wed, 9 Oct 2019 11:25:12 +0200 Subject: [PATCH] SYSDIG-DRIVER: Integrate kernel driver for sysdig trace and debug tools --- ...all-bpf-files-only-if-DKMS-is-enable.patch | 26 +++++++ recipes-bsp/drivers/sysdig-driver_git.bb | 69 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 recipes-bsp/drivers/sysdig-driver/0001-Install-bpf-files-only-if-DKMS-is-enable.patch create mode 100644 recipes-bsp/drivers/sysdig-driver_git.bb diff --git a/recipes-bsp/drivers/sysdig-driver/0001-Install-bpf-files-only-if-DKMS-is-enable.patch b/recipes-bsp/drivers/sysdig-driver/0001-Install-bpf-files-only-if-DKMS-is-enable.patch new file mode 100644 index 0000000..a51b309 --- /dev/null +++ b/recipes-bsp/drivers/sysdig-driver/0001-Install-bpf-files-only-if-DKMS-is-enable.patch @@ -0,0 +1,26 @@ +From 2355a925068a138b888e04410aba515219ce7b38 Mon Sep 17 00:00:00 2001 +From: Jean-Philippe ROMAIN +Date: Wed, 30 Jan 2019 17:45:00 +0100 +Subject: [PATCH] Install bpf files only if DKMS is enable + + +diff --git a/driver/bpf/CMakeLists.txt b/driver/bpf/CMakeLists.txt +index e8ae7b6..6208ecc 100644 +--- a/driver/bpf/CMakeLists.txt ++++ b/driver/bpf/CMakeLists.txt +@@ -8,6 +8,7 @@ if(BUILD_BPF) + VERBATIM) + endif() + ++if(ENABLE_DKMS) + install(FILES + bpf_helpers.h + filler_helpers.h +@@ -21,3 +22,4 @@ install(FILES + types.h + DESTINATION "src/${PACKAGE_NAME}-${PROBE_VERSION}/bpf" + COMPONENT agent) ++endif() +-- +2.7.4 + diff --git a/recipes-bsp/drivers/sysdig-driver_git.bb b/recipes-bsp/drivers/sysdig-driver_git.bb new file mode 100644 index 0000000..4d853be --- /dev/null +++ b/recipes-bsp/drivers/sysdig-driver_git.bb @@ -0,0 +1,69 @@ +SUMMARY = "A New System Troubleshooting Tool Built for the Way You Work" +DESCRIPTION = "Sysdig is open source, system-level exploration: capture \ +system state and activity from a running Linux instance, then save, \ +filter and analyze." +HOMEPAGE = "http://www.sysdig.org/" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=f8fee3d59797546cffab04f3b88b2d44" + +SRC_URI = "git://github.com/draios/sysdig.git;protocol=https" +SRCREV = "aa82b2fb329ea97a8ade31590954ddaa675e1728" + +PV = "0.24.2+git${SRCPV}" + +COMPATIBLE_MACHINE = "(stm32mpcommon)" + +S = "${WORKDIR}/git" + +# Inherit of cmake for configure step +inherit cmake pkgconfig + +DEPENDS = "luajit zlib ncurses" +DEPENDS += "jsoncpp openssl curl jq" +DEPENDS += "tbb" +DEPENDS += "libb64" +DEPENDS += "elfutils" + +OECMAKE_GENERATOR = "Unix Makefiles" + +EXTRA_OECMAKE = ' -DBUILD_DRIVER="ON" \ + -DBUILD_BPF="OFF" \ + -DENABLE_DKMS="OFF" \ + -DDIR_ETC="/etc" \ + ' + +EXTRA_OECMAKE += ' -DUSE_BUNDLED_LUAJIT="OFF" \ + -DUSE_BUNDLED_ZLIB="OFF" \ + -DUSE_BUNDLED_NCURSES="OFF" \ + -DUSE_BUNDLED_JSONCPP="OFF" \ + -DUSE_BUNDLED_OPENSSL="OFF" \ + -DUSE_BUNDLED_CURL="OFF" \ + -DUSE_BUNDLED_B64="OFF" \ + -DUSE_BUNDLED_JQ="OFF" \ + -DUSE_BUNDLED_TBB="OFF" \ + ' + +# Inherit of module class for driver building +inherit module + +DEPENDS += "virtual/kernel" + +export KERNELDIR = "${STAGING_KERNEL_BUILDDIR}" + +MAKE_TARGETS = "all" + +# Compile prepend for cmake build first +do_compile_prepend() { + cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} +} + +do_install() { + install -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/extra/ + install -m 0755 ${B}/driver/sysdig-probe.ko ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/extra/ +} + +FILES_${PN} += " ${base_libdir}/modules/${KERNEL_VERSION}/extra " + +KERNEL_MODULES_META_PACKAGE = "" + +RDEPENDS_${PN} = "bash"