Skip to contentSkip to conversation

Bump sysdig to 0.29.1

PATCH In review Francis Laniel 2 participants 8 messages Apr 14, 2022 – Apr 15, 2022 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover Bump sysdig to 0.29.1

Hi.

In this contribution, I bumped sysdig version to 0.29.1.
Indeed, following this discussion [1], Arnout Vandecappelle noted sysdig 0.27.1 cannot be cross-compiled to, e.g., aarch64 because it uses the open() syscall.

To fix this, I bumped sysdig to 0.29.1.
Sadly, some components of sysdig, like libsinsp, libscap and the kernel modules, were moved to falcosecurity/libs.
So, I added the falcosecurity-libs package.
Nonetheless, I am currently having a problem with this package, hence why I marked this contribution as RFC.
Indeed, falcosecurity-libs is built a first time, then another one when sysdig will be built because I set a cmake options to indicate falcosecurity-libs source directory.
Sadly, I do not really see how to fix this issue...
Maybe by making falcosecurity-libs package a generic-package?

I was nonetheless able to build and run sysdig with start-qemu.sh:
Welcome to Buildroot
buildroot login: root

# insmod /lib/modules/5.15.18/extra/falco.ko
falco: loading out-of-tree module taints kernel.
falco: driver loading, scap 0.1.1dev
# sysdig | head
falco: adding new consumer 00000000b5aaf410
falco: initializing ring buffer for CPU 0
falco: CPU buffer initialized, size=8388608
falco: starting capture
2 17:18:14.088681520 0 sysdig (330) > switch next=11 pgft_maj=203 pgft_min=1165 vm_size=46264 vm_rss=18072 vm_swap=
...
24 17:18:14.095103470 0 sysdig (330) > switch next=0 pgft_maj=204 pgft_min=1165 vm_size=46264 vm_rss=18072 vm_swap=
falco: deallocating consumer 00000000b5aaf410
falco: no more consumers, stopping capture

So, if you see a particular way to fix the problem I described above or any problem with this contribution, feel free to share it!

Francis Laniel (3):
nlohmann-json: add new package.
falcosecurity-libs: add new package
package/sysdig: bump to 0.29.1

 DEVELOPERS                                    |  2 +
 package/Config.in                             |  2 +
 ...cmake-Permit-setting-GRPC_CPP_PLUGIN.patch | 34 ++++++++
 package/falcosecurity-libs/Config.in          | 38 +++++++++
 .../falcosecurity-libs.hash                   |  5 ++
 .../falcosecurity-libs/falcosecurity-libs.mk  | 62 ++++++++++++++
 package/nlohmann-json/Config.in               |  7 ++
 package/nlohmann-json/nlohmann-json.hash      |  3 +
 package/nlohmann-json/nlohmann-json.mk        | 14 ++++
 ...BUNDLED_DEPS-before-getting-nlohmann.patch | 50 +++++++++++
 ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 -------------------
 ...gainst-libabseil-cpp-which-grpc-uses.patch | 47 -----------
 package/sysdig/Config.in                      | 31 ++-----
 package/sysdig/sysdig.hash                    |  1 +
 package/sysdig/sysdig.mk                      | 39 ++-------
 15 files changed, 233 insertions(+), 184 deletions(-)
 create mode 100644 package/falcosecurity-libs/0001-cmake-Permit-setting-GRPC_CPP_PLUGIN.patch
 create mode 100644 package/falcosecurity-libs/Config.in
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs.hash
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs.mk
 create mode 100644 package/nlohmann-json/Config.in
 create mode 100644 package/nlohmann-json/nlohmann-json.hash
 create mode 100644 package/nlohmann-json/nlohmann-json.mk
 create mode 100644 package/sysdig/0001-cmake-Check-USE_BUNDLED_DEPS-before-getting-nlohmann.patch
 delete mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch
 delete mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch

Best regards and thank you in advance.
---
[1] https://marc.info/?l=buildroot&m=164951521629400

Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/3 nlohmann-json: add new package.

---
 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/nlohmann-json/Config.in          |  7 +++++++
 package/nlohmann-json/nlohmann-json.hash |  3 +++
 package/nlohmann-json/nlohmann-json.mk   | 14 ++++++++++++++
 5 files changed, 26 insertions(+)
 create mode 100644 package/nlohmann-json/Config.in
 create mode 100644 package/nlohmann-json/nlohmann-json.hash
 create mode 100644 package/nlohmann-json/nlohmann-json.mk
DEVELOPERS +1 -0
index ca9decb58f..b997b859ed 100644
@@ -969,6 +969,7 @@ F:	package/ipmitool/
 F:	package/odhcploc/
 
 N:	Francis Laniel <[email protected]>
+F:	package/nlohmann-json
 F:	package/pahole/
 F:	package/sysdig/
 F:	package/tbb/
package/Config.in +1 -0
index 24f7af5ea8..46df1b3540 100644
@@ -1700,6 +1700,7 @@ menu "JSON/XML"
 	source "package/libxslt/Config.in"
 	source "package/libyaml/Config.in"
 	source "package/mxml/Config.in"
+	source "package/nlohmann-json/Config.in"
 	source "package/pugixml/Config.in"
 	source "package/rapidjson/Config.in"
 	source "package/rapidxml/Config.in"
package/nlohmann-json/Config.in new file +7 -0
new file mode 100644
index 0000000000..1e63fbc029
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_NLOHMANN_JSON
+	bool "nlohmann-json"
+	help
+	  nlohmann/json is a header C++ library that allows manipulating JSON
+	  with an intuitive syntax.
+
+	  https://github.com/nlohmann/json
package/nlohmann-json/nlohmann-json.hash new file +3 -0
new file mode 100644
index 0000000000..d69c4daf72
@@ -0,0 +1,3 @@
+# sha256 locally computed
+sha256  2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801  nlohmann-json-v3.3.0.tar.gz
+sha256  7b875bb7a4e28abb7956ea821b4b7d88ff6a2a4fabf261c3993730a365ec56dd  LICENSE.MIT
package/nlohmann-json/nlohmann-json.mk new file +14 -0
new file mode 100644
index 0000000000..0810fe7b61
@@ -0,0 +1,14 @@
+################################################################################
+#
+# nlohmann
+#
+################################################################################
+
+NLOHMANN_JSON_VERSION = v3.3.0
+NLOHMANN_JSON_SITE = $(call github,nlohmann,json,$(NLOHMANN_JSON_VERSION))
+NLOHMANN_JSON_LICENSE = MIT
+NLOHMANN_JSON_LICENSE_FILES = LICENSE.MIT
+NLOHMANN_JSON_CPE_ID_VENDOR = json++
+NLOHMANN_JSON_INSTALL_STAGING = YES
+
+$(eval $(cmake-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [Buildroot] [PATCH 1/3] nlohmann-json: add new package.

Quoted 1 line · Le jeudi 14 avril 2022, 18:46:23 BST Graeme Smecher a écrit :

Hi Francis,

Hi.

Quoted 1 line

Is this different from packages/json-for-modern-cpp?

Not at all!
Thank you for pointing it! I should have search more carefully. I will rework my first patch to bump the existing one!

Quoted 1 line

best,

Best regards.

Quoted 84 lines

Graeme

Quoted 81 lines · Francis Laniel

---

  DEVELOPERS                               |  1 +
  package/Config.in                        |  1 +
  package/nlohmann-json/Config.in          |  7 +++++++
  package/nlohmann-json/nlohmann-json.hash |  3 +++
  package/nlohmann-json/nlohmann-json.mk   | 14 ++++++++++++++
  5 files changed, 26 insertions(+)

create mode 100644 package/nlohmann-json/Config.in create mode 100644 package/nlohmann-json/nlohmann-json.hash create mode 100644 package/nlohmann-json/nlohmann-json.mk

DEVELOPERS +1 -0
index ca9decb58f..b997b859ed 100644
@@ -969,6 +969,7 @@ F:	package/ipmitool/
 
  F:	package/odhcploc/
 
  N:	Francis Laniel <[email protected]>
 
+F:	package/nlohmann-json
 

F: package/pahole/
F: package/sysdig/
F: package/tbb/

package/Config.in +1 -0
index 24f7af5ea8..46df1b3540 100644
@@ -1700,6 +1700,7 @@ menu "JSON/XML"
 
  	source "package/libxslt/Config.in"
  	source "package/libyaml/Config.in"
  	source "package/mxml/Config.in"
 
+	source "package/nlohmann-json/Config.in"
 

source "package/pugixml/Config.in"
source "package/rapidjson/Config.in"
source "package/rapidxml/Config.in"

(quoted diff) +0 -0

b/package/nlohmann-json/Config.in new file mode 100644 index 0000000000..1e63fbc029

package/nlohmann-json/Config.in new file +7 -0
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_NLOHMANN_JSON
+	bool "nlohmann-json"
+	help
+	  nlohmann/json is a header C++ library that allows manipulating JSON
+	  with an intuitive syntax.
+
+	  https://github.com/nlohmann/json
(quoted diff) +0 -0

b/package/nlohmann-json/nlohmann-json.hash new file mode 100644 index 0000000000..d69c4daf72

package/nlohmann-json/nlohmann-json.hash new file +2 -0
@@ -0,0 +1,3 @@
+# sha256 locally computed
+sha256  2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801 

nlohmann-json-v3.3.0.tar.gz +sha256 7b875bb7a4e28abb7956ea821b4b7d88ff6a2a4fabf261c3993730a365ec56dd LICENSE.MIT diff --git a/package/nlohmann-json/nlohmann-json.mk b/package/nlohmann-json/nlohmann-json.mk new file mode 100644 index 0000000000..0810fe7b61

package/nlohmann-json/nlohmann-json.mk new file +1 -0
@@ -0,0 +1,14 @@
+#########################################################################

####### +#

package/nlohmann-json/nlohmann-json.mk new file +3 -0
+# nlohmann
+#
+#########################################################################

####### +
+NLOHMANN_JSON_VERSION = v3.3.0

Quoted 8 lines

package/nlohmann-json/nlohmann-json.mk line 14

Quoted 8 lines

+NLOHMANN_JSON_SITE = $(call
github,nlohmann,json,$(NLOHMANN_JSON_VERSION))

package/nlohmann-json/nlohmann-json.mk new file +6 -0
+NLOHMANN_JSON_LICENSE = MIT
+NLOHMANN_JSON_LICENSE_FILES = LICENSE.MIT
+NLOHMANN_JSON_CPE_ID_VENDOR = json++
+NLOHMANN_JSON_INSTALL_STAGING = YES
+
+$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

PATCH 2/3 falcosecurity-libs: add new package

In reply to Francis Laniel
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...cmake-Permit-setting-GRPC_CPP_PLUGIN.patch | 34 ++++++++++
 package/falcosecurity-libs/Config.in          | 38 ++++++++++++
 .../falcosecurity-libs.hash                   |  5 ++
 .../falcosecurity-libs/falcosecurity-libs.mk  | 62 +++++++++++++++++++
 6 files changed, 141 insertions(+)
 create mode 100644 package/falcosecurity-libs/0001-cmake-Permit-setting-GRPC_CPP_PLUGIN.patch
 create mode 100644 package/falcosecurity-libs/Config.in
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs.hash
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs.mk
DEVELOPERS +1 -0
index b997b859ed..8ca9416b7b 100644
@@ -969,6 +969,7 @@ F:	package/ipmitool/
 F:	package/odhcploc/
 
 N:	Francis Laniel <[email protected]>
+F:	package/falcosecurity-libs
 F:	package/nlohmann-json
 F:	package/pahole/
 F:	package/sysdig/
package/Config.in +1 -0
index 46df1b3540..4f2330e4fd 100644
@@ -1936,6 +1936,7 @@ menu "Other"
 	source "package/eigen/Config.in"
 	source "package/elfutils/Config.in"
 	source "package/ell/Config.in"
+	source "package/falcosecurity-libs/Config.in"
 	source "package/fftw/Config.in"
 	source "package/flann/Config.in"
 	source "package/flatbuffers/Config.in"
package/falcosecurity-libs/0001-cmake-Permit-setting-GRPC_CPP_PLUGIN.patch new file +34 -0
new file mode 100644
index 0000000000..6141d8ef72
@@ -0,0 +1,34 @@
+From 2e8a50cd4975df3ab60ee07c9675831cd5ad397f Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Tue, 12 Apr 2022 19:54:11 +0100
+Subject: [PATCH] cmake: Permit setting GRPC_CPP_PLUGIN.
+
+This patch enables users to set GRPC_CPP_PLUGIN while calling cmake with:
+cmake -DGRPC_CPP_PLUGIN=/path
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ cmake/modules/grpc.cmake | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/cmake/modules/grpc.cmake b/cmake/modules/grpc.cmake
+index e5fd16b8..9d8f5934 100644
+--- a/cmake/modules/grpc.cmake
++++ b/cmake/modules/grpc.cmake
+@@ -12,9 +12,11 @@ elseif(NOT USE_BUNDLED_GRPC)
+ 		set(GRPCPP_LIB gRPC::grpc++)
+ 
+ 		# gRPC C++ plugin
+-		get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
+ 		if(NOT GRPC_CPP_PLUGIN)
+-			message(FATAL_ERROR "System grpc_cpp_plugin not found")
++			get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
++			if(NOT GRPC_CPP_PLUGIN)
++				message(FATAL_ERROR "System grpc_cpp_plugin not found")
++			endif()
+ 		endif()
+ 
+ 		# gRPC include dir + properly handle grpc{++,pp}
+-- 
+2.25.1
+
package/falcosecurity-libs/Config.in new file +38 -0
new file mode 100644
index 0000000000..9dd9221caa
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_FALCOSECURITY_LIBS
+	bool "sysdig"
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_INSTALL_LIBSTDCPP # jsoncpp, protobuf, tbb
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
+	depends on BR2_TOOLCHAIN_HAS_THREADS # jq, protobuf, tbb
+	depends on !BR2_STATIC_LIBS # protobuf, tbb
+	depends on BR2_TOOLCHAIN_USES_GLIBC # tbb
+	depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
+	select BR2_PACKAGE_C_ARES
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_GRPC
+	select BR2_PACKAGE_GTEST
+	select BR2_PACKAGE_HOST_GRPC
+	select BR2_PACKAGE_HOST_PROTOBUF
+	select BR2_PACKAGE_JQ
+	select BR2_PACKAGE_JSONCPP
+	select BR2_PACKAGE_LIBB64
+	select BR2_PACKAGE_LIBCURL
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PROTOBUF
+	select BR2_PACKAGE_TBB
+	select BR2_PACKAGE_VALIJSON
+	select BR2_PACKAGE_ZLIB
+	help
+	  falcosecurity/libs provides libsinsp, libscap, the kernel module driver
+	  and the eBPF driver sources.
+
+	  https://github.com/falcosecurity/libs
+
+comment "falcosecurity-libs needs a glibc toolchain w/ C++, threads, gcc >= 4.8, dynamic library, a Linux kernel, and luajit or lua 5.1 to be built"
+	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+	depends on !BR2_LINUX_KERNEL || !BR2_INSTALL_LIBSTDCPP \
+		|| !BR2_TOOLCHAIN_HAS_THREADS \
+		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || BR2_STATIC_LIBS \
+		|| !BR2_TOOLCHAIN_USES_GLIBC \
+	    || !BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
package/falcosecurity-libs/falcosecurity-libs.hash new file +5 -0
new file mode 100644
index 0000000000..7608c67590
@@ -0,0 +1,5 @@
+# sha256 locally computed
+sha256  80903bc57b7f9c5f24298ecf1531cf66ef571681b4bd1e05f6e4db704ffb380b  falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a.tar.gz
+sha256  a88fbf820b38b1c7fabc6efe291b8259e02ae21326f56fe31c6c9adf374b2702  COPYING
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  driver/GPL2.txt
+sha256  e3f6a43d097ed68176e9738de925d98b938e1bccf6d6bd1bcd79395eca8f76ed  driver/MIT.txt
package/falcosecurity-libs/falcosecurity-libs.mk new file +62 -0

62 lines not on this page · raw message

Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH 3/3 package/sysdig: bump to 0.29.1

In reply to Francis Laniel

sysdig 0.27.1 cannot be cross-compiled to, e.g., aarch64 because it uses open() syscall [1].
This patch bumps its version to enable cross-compilation.

[1] https://marc.info/?l=buildroot&m=164951521629400

---
 ...BUNDLED_DEPS-before-getting-nlohmann.patch | 50 +++++++++++
 ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 -------------------
 ...gainst-libabseil-cpp-which-grpc-uses.patch | 47 -----------
 package/sysdig/Config.in                      | 31 ++-----
 package/sysdig/sysdig.hash                    |  1 +
 package/sysdig/sysdig.mk                      | 39 ++-------
 6 files changed, 66 insertions(+), 184 deletions(-)
 create mode 100644 package/sysdig/0001-cmake-Check-USE_BUNDLED_DEPS-before-getting-nlohmann.patch
 delete mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch
 delete mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch
package/sysdig/0001-cmake-Check-USE_BUNDLED_DEPS-before-getting-nlohmann.patch new file +50 -0
new file mode 100644
index 0000000000..53c88678ad
@@ -0,0 +1,50 @@
+From 7af62336bce5b92aee6e3b16e53fd09b14e45adb Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 13 Apr 2022 18:01:11 +0100
+Subject: [PATCH] cmake: Check USE_BUNDLED_DEPS before getting nlohmann-json.
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ cmake/modules/nlohmann-json.cmake | 29 +++++++++++++++++++----------
+ 1 file changed, 19 insertions(+), 10 deletions(-)
+
+diff --git a/cmake/modules/nlohmann-json.cmake b/cmake/modules/nlohmann-json.cmake
+index bb1279d7..feb0f071 100644
+--- a/cmake/modules/nlohmann-json.cmake
++++ b/cmake/modules/nlohmann-json.cmake
+@@ -16,13 +16,22 @@
+ # limitations under the License.
+ #
+ 
+-set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
+-message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
+-set(NJSON_INCLUDE_DIR "${NJSON_SRC}/single_include")
+-ExternalProject_Add(
+-  njson
+-  URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
+-  URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
+-  CONFIGURE_COMMAND ""
+-  BUILD_COMMAND ""
+-  INSTALL_COMMAND "")
++if(NOT USE_BUNDLED_DEPS)
++  find_path(NJSON_INCLUDE_DIR NAMES nlohmann/json.hpp)
++  if(NJSON_INCLUDE_DIR)
++    message(STATUS "Found njson: include: ${NJSON_INCLUDE_DIR}")
++  else()
++    message(FATAL_ERROR "Couldn't find system njson")
++  endif()
++else()
++  set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
++  message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
++  set(NJSON_INCLUDE_DIR "${NJSON_SRC}/single_include")
++  ExternalProject_Add(
++    njson
++    URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
++    URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
++    CONFIGURE_COMMAND ""
++    BUILD_COMMAND ""
++    INSTALL_COMMAND "")
++endif()
+-- 
+2.25.1
+
package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch deleted +0 -82

82 lines not on this page · raw message

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch deleted +0 -47

47 lines not on this page · raw message

package/sysdig/Config.in +6 -25
index 3a4c033b2b..8f520b5e77 100644
@@ -1,26 +1,11 @@
 config BR2_PACKAGE_SYSDIG
 	bool "sysdig"
-	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS # protobuf
 	depends on BR2_LINUX_KERNEL
-	depends on BR2_INSTALL_LIBSTDCPP # jsoncpp, protobuf, tbb
-	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # protobuf
-	depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils, jq, protobuf, tbb
-	depends on !BR2_STATIC_LIBS # elfutils, protobuf, tbb
-	depends on BR2_USE_WCHAR # elfutils
-	depends on BR2_TOOLCHAIN_USES_GLIBC # elfutils, tbb
-	depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
-	select BR2_PACKAGE_C_ARES
-	select BR2_PACKAGE_ELFUTILS
-	select BR2_PACKAGE_GRPC
-	select BR2_PACKAGE_JQ
-	select BR2_PACKAGE_JSONCPP
-	select BR2_PACKAGE_LIBB64
-	select BR2_PACKAGE_LIBCURL
+	depends on BR2_INSTALL_LIBSTDCPP # yaml-cpp
+	select BR2_PACKAGE_FALCOSECURITY_LIBS
 	select BR2_PACKAGE_NCURSES
-	select BR2_PACKAGE_OPENSSL
-	select BR2_PACKAGE_PROTOBUF
-	select BR2_PACKAGE_TBB
-	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_NLOHMANN_JSON
+	select BR2_PACKAGE_YAML_CPP
 	help
 	  Sysdig is open source, system-level exploration:
 	  capture system state and activity from a running Linux
@@ -30,10 +15,6 @@ config BR2_PACKAGE_SYSDIG
 
 	  https://github.com/draios/sysdig/wiki
 
-comment "sysdig needs a glibc toolchain w/ C++, threads, gcc >= 4.8, dynamic library, a Linux kernel, and luajit or lua 5.1 to be built"
-	depends on BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS
+comment "sysdig needs a toolchain w/ C++, a Linux kernel and luajit or lua 5.1 to be built"
 	depends on !BR2_LINUX_KERNEL || !BR2_INSTALL_LIBSTDCPP \
-		|| !BR2_TOOLCHAIN_HAS_THREADS \
-		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || BR2_STATIC_LIBS \
-		|| !BR2_TOOLCHAIN_USES_GLIBC \
-	    || !BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
+		|| !BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
package/sysdig/sysdig.hash +1 -0
index 4ec46abfc3..f567ed97ac 100644
@@ -1,4 +1,5 @@
 # sha256 locally computed
+sha256  3721c97f0da43c1a68d2962d30363525d8532ab5f2534dfefc86d175e17e423e  sysdig-0.29.1.tar.gz
 sha256  b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda  sysdig-0.27.1.tar.gz
 sha256  a88fbf820b38b1c7fabc6efe291b8259e02ae21326f56fe31c6c9adf374b2702  COPYING
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  driver/GPL2.txt
package/sysdig/sysdig.mk +9 -30
index 9a9aaa35c3..d1a37162a7 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-SYSDIG_VERSION = 0.27.1
+SYSDIG_VERSION = 0.29.1
 SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
 SYSDIG_LICENSE = Apache-2.0 (userspace), MIT or GPL-2.0 (driver)
 SYSDIG_LICENSE_FILES = COPYING driver/MIT.txt driver/GPL2.txt
@@ -16,39 +16,18 @@ SYSDIG_CONF_OPTS = \
 SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
 
 SYSDIG_DEPENDENCIES = \
-	c-ares \
-	elfutils \
-	grpc \
-	jq \
-	jsoncpp \
-	libb64 \
-	libcurl \
-	luainterpreter \
+	falcosecurity-libs \
 	ncurses \
-	openssl \
-	protobuf \
-	tbb \
-	zlib
+	nlohmann-json \
+	yaml-cpp
 
-# sysdig creates the module Makefile from a template, which contains a
-# single place-holder, KBUILD_FLAGS, wich is only replaced with two
-# things:
-#   - debug flags, which we don't care about here,
-#   - 'sysdig-feature' flags, which are never set, so always empty
-# So, just replace the place-holder with the only meaningful value: nothing.
-define SYSDIG_MODULE_GEN_MAKEFILE
-	$(INSTALL) -m 0644 $(@D)/driver/Makefile.in $(@D)/driver/Makefile
-	$(SED) 's/@KBUILD_FLAGS@//;' $(@D)/driver/Makefile
-	$(SED) 's/@PROBE_NAME@/sysdig-probe/;' $(@D)/driver/Makefile
-endef
-SYSDIG_POST_PATCH_HOOKS += SYSDIG_MODULE_GEN_MAKEFILE
-
-# Don't build the driver as part of the 'standard' procedure, we'll
-# build it on our own with the kernel-module infra.
-SYSDIG_CONF_OPTS += -DBUILD_DRIVER=OFF
+# sysdig needs falcosecurity-libs sources, so we set the souce directory here.
+# It will sadly compile again falcosecurity-libs, so we also need to set again
+# grpc_cpp_plugin.
+SYSDIG_CONF_OPTS += -DFALCOSECURITY_LIBS_SOURCE_DIR=$(BUILD_DIR)/falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a -DGRPC_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin \
+	-DVALIJSON_INCLUDE=$(BUILD_DIR)/valijson-0.6/include/valijson
 
 SYSDIG_MODULE_SUBDIRS = driver
 SYSDIG_MODULE_MAKE_OPTS = KERNELDIR=$(LINUX_DIR)
 
-$(eval $(kernel-module))
 $(eval $(cmake-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

Re: [Buildroot] [PATCH 3/3] package/sysdig: bump to 0.29.1

Quoted 15 lines · Francis Laniel

sysdig 0.27.1 cannot be cross-compiled to, e.g., aarch64 because it uses open() syscall [1].
This patch bumps its version to enable cross-compilation.

[1] https://marc.info/?l=buildroot&m=164951521629400

---
  ...BUNDLED_DEPS-before-getting-nlohmann.patch | 50 +++++++++++
  ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 -------------------
  ...gainst-libabseil-cpp-which-grpc-uses.patch | 47 -----------
  package/sysdig/Config.in                      | 31 ++-----
  package/sysdig/sysdig.hash                    |  1 +
  package/sysdig/sysdig.mk                      | 39 ++-------
  6 files changed, 66 insertions(+), 184 deletions(-)
Quoted 3 lines

create mode 100644 package/sysdig/0001-cmake-Check-USE_BUNDLED_DEPS-before-getting-nlohmann.patch delete mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch delete mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch

It's convenient for reviewers if in the commit message you explain why the
patches can be removed. In this case, it's clearly because the patched bits moved to falcosecurity-libs, but then explain why they are not needed there.

[snip]

package/sysdig/sysdig.hash line 3

Quoted 8 lines
package/sysdig/sysdig.hash +1 -0
index 4ec46abfc3..f567ed97ac 100644
@@ -1,4 +1,5 @@
  # sha256 locally computed
+sha256  3721c97f0da43c1a68d2962d30363525d8532ab5f2534dfefc86d175e17e423e  sysdig-0.29.1.tar.gz
  sha256  b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda  sysdig-0.27.1.tar.gz

Remember to replace the old hash, not just add a new one.

package/sysdig/sysdig.hash line 5

Quoted 2 lines
package/sysdig/sysdig.hash +0 -0
  sha256  a88fbf820b38b1c7fabc6efe291b8259e02ae21326f56fe31c6c9adf374b2702  COPYING
  sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  driver/GPL2.txt

This file no longer exists. make legal-info to verify this.

Quoted 44 lines
package/sysdig/sysdig.mk +4 -23
index 9a9aaa35c3..d1a37162a7 100644
@@ -4,7 +4,7 @@
  #
  ################################################################################
 
-SYSDIG_VERSION = 0.27.1
+SYSDIG_VERSION = 0.29.1
  SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
  SYSDIG_LICENSE = Apache-2.0 (userspace), MIT or GPL-2.0 (driver)
  SYSDIG_LICENSE_FILES = COPYING driver/MIT.txt driver/GPL2.txt
@@ -16,39 +16,18 @@ SYSDIG_CONF_OPTS = \
  SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
 
  SYSDIG_DEPENDENCIES = \
-	c-ares \
-	elfutils \
-	grpc \
-	jq \
-	jsoncpp \
-	libb64 \
-	libcurl \
-	luainterpreter \
+	falcosecurity-libs \
  	ncurses \
-	openssl \
-	protobuf \
-	tbb \
-	zlib
+	nlohmann-json \
+	yaml-cpp
 
-# sysdig creates the module Makefile from a template, which contains a
-# single place-holder, KBUILD_FLAGS, wich is only replaced with two
-# things:
-#   - debug flags, which we don't care about here,
-#   - 'sysdig-feature' flags, which are never set, so always empty
-# So, just replace the place-holder with the only meaningful value: nothing.
-define SYSDIG_MODULE_GEN_MAKEFILE
-	$(INSTALL) -m 0644 $(@D)/driver/Makefile.in $(@D)/driver/Makefile
-	$(SED) 's/@KBUILD_FLAGS@//;' $(@D)/driver/Makefile
-	$(SED) 's/@PROBE_NAME@/sysdig-probe/;' $(@D)/driver/Makefile

package/sysdig/sysdig.mk SYSDIG_CONF_OPTS = \ · line 27

Quoted 10 lines
package/sysdig/sysdig.mk +4 -6
-endef
-SYSDIG_POST_PATCH_HOOKS += SYSDIG_MODULE_GEN_MAKEFILE
-
-# Don't build the driver as part of the 'standard' procedure, we'll
-# build it on our own with the kernel-module infra.
-SYSDIG_CONF_OPTS += -DBUILD_DRIVER=OFF
+# sysdig needs falcosecurity-libs sources, so we set the souce directory here.
+# It will sadly compile again falcosecurity-libs, so we also need to set again
+# grpc_cpp_plugin.
+SYSDIG_CONF_OPTS += -DFALCOSECURITY_LIBS_SOURCE_DIR=$(BUILD_DIR)/falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a -DGRPC_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin \

This is not nice (as you wrote in the cover letter). If there's really no way
to tell sysdig to use the libs installed in STAGING_DIR, then the solution is to remove falconsecurity-libs and instead download it as part of the sysdig package. There are (fortunately) not many examples of that in Buildroot, but there's something a bit similar in android-tools.

# Take this version from cmake/modules/falcosecurity-libs.cmake
SYSDIG_FALCOSECURITY_LIBS_VERSION = e5c53d648f3c4694385bbe488e7d47eaa36c229a
SYSDIG_EXTRA_DOWNLOADS = $(call github,falcosecurity,libs,$(SYSDIG_FALCOSECURITY_LIBS_VERSION))/falcosecurity-libs-$(SYSDIG_FALCOSECURITY_LIBS_VERSION).tar.gz define SYSDIG_EXTRACT_FALCOSECURITY_LIBS

        $(call suitable-extractor,$(notdir $(SYSDIG_EXTRA_DOWNLOADS))) \
                $(SYSDIG_DL_DIR)/$(notdir $(SYSDIG_EXTRA_DOWNLOADS)) | \
                $(TAR) -C $(@D)/falcosecurity-libs --strip-components=1 \
			$(TAR_OPTIONS) -

endef
SYSDIG_POST_EXTRACT_HOOKS += SYSDIG_EXTRACT_FALCOSECURITY_LIBS

(you'll need to adapt the above to make sure it's extracted in the right place.)

Since the driver etc. are then part of the sysdig package again, not as much
will change. Just some directory names.

BTW, please also mention in the commit message that the issue with the driver
is fixed in recent falcosecurity/libs

Regards,
Arnout

package/sysdig/sysdig.mk SYSDIG_CONF_OPTS = \ · line 33

Quoted 7 lines
package/sysdig/sysdig.mk +1 -1
+	-DVALIJSON_INCLUDE=$(BUILD_DIR)/valijson-0.6/include/valijson
 
  SYSDIG_MODULE_SUBDIRS = driver
  SYSDIG_MODULE_MAKE_OPTS = KERNELDIR=$(LINUX_DIR)
 
-$(eval $(kernel-module))
  $(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw

Re: [Buildroot] [PATCH 3/3] package/sysdig: bump to 0.29.1

Quoted 3 lines · Arnout Vandecappelle

On 14/04/2022 19:43, Francis Laniel wrote:

[snip]

Quoted 8 lines

package/sysdig/sysdig.mk SYSDIG_CONF_OPTS = \

Quoted 6 lines
package/sysdig/sysdig.mk +4 -2
+# sysdig needs falcosecurity-libs sources, so we set the souce directory here.
+# It will sadly compile again falcosecurity-libs, so we also need to set again
+# grpc_cpp_plugin.
+SYSDIG_CONF_OPTS += 
-DFALCOSECURITY_LIBS_SOURCE_DIR=$(BUILD_DIR)/falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a 
-DGRPC_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin \

 This is not nice (as you wrote in the cover letter). If there's really no way to tell sysdig to use the libs installed in STAGING_DIR, then the solution is to remove falconsecurity-libs and instead download it as part of the sysdig package. There are (fortunately) not many examples of that in Buildroot, but there's something a bit similar in android-tools.

 Just to be clear: the *preferred* solution is to patch cmake/modules/falcosecurity-libs.cmake so it supports a system-installed falcosecurity-libs. (And then send that patch upstream to sysdig, of course).

 Regards,
 Arnout

Quoted 15 lines

# Take this version from cmake/modules/falcosecurity-libs.cmake
SYSDIG_FALCOSECURITY_LIBS_VERSION = e5c53d648f3c4694385bbe488e7d47eaa36c229a
SYSDIG_EXTRA_DOWNLOADS = $(call github,falcosecurity,libs,$(SYSDIG_FALCOSECURITY_LIBS_VERSION))/falcosecurity-libs-$(SYSDIG_FALCOSECURITY_LIBS_VERSION).tar.gz define SYSDIG_EXTRACT_FALCOSECURITY_LIBS
        $(call suitable-extractor,$(notdir $(SYSDIG_EXTRA_DOWNLOADS))) \
                $(SYSDIG_DL_DIR)/$(notdir $(SYSDIG_EXTRA_DOWNLOADS)) | \
                $(TAR) -C $(@D)/falcosecurity-libs --strip-components=1 \
            $(TAR_OPTIONS) -
endef
SYSDIG_POST_EXTRACT_HOOKS += SYSDIG_EXTRACT_FALCOSECURITY_LIBS

(you'll need to adapt the above to make sure it's extracted in the right place.)

Quoted 12 lines

 Since the driver etc. are then part of the sysdig package again, not as much will change. Just some directory names.

 BTW, please also mention in the commit message that the issue with the driver is fixed in recent falcosecurity/libs

 Regards,
 Arnout

Quoted 5 lines

+ -DVALIJSON_INCLUDE=$(BUILD_DIR)/valijson-0.6/include/valijson SYSDIG_MODULE_SUBDIRS = driver SYSDIG_MODULE_MAKE_OPTS = KERNELDIR=$(LINUX_DIR) -$(eval $(kernel-module))
  $(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#8 lore raw

Re: [Buildroot] [PATCH 3/3] package/sysdig: bump to 0.29.1

Hi.

Quoted 18 lines · Le jeudi 14 avril 2022, 20:05:06 BST Arnout Vandecappelle a écrit :
Quoted 1 line · Arnout Vandecappelle

On 14/04/2022 19:43, Francis Laniel wrote:

[snip]

Quoted 5 lines
Quoted 5 lines

+# sysdig needs falcosecurity-libs sources, so we set the souce directory here. +# It will sadly compile again falcosecurity-libs, so we also need to set again +# grpc_cpp_plugin.

(quoted diff) +1 -1
+SYSDIG_CONF_OPTS +=
-DFALCOSECURITY_LIBS_SOURCE_DIR=$(BUILD_DIR)/falcosecurity-libs-e5c53d648
Quoted 8 lines
Quoted 2 lines

f3c4694385bbe488e7d47eaa36c229a -DGRPC_CPP_PLUGIN=$(HOST_DIR)/bin/grpc_cpp_plugin \

This is not nice (as you wrote in the cover letter). If there's really no
way to tell sysdig to use the libs installed in STAGING_DIR, then the solution is to remove falconsecurity-libs and instead download it as part of the sysdig package. There are (fortunately) not many examples of that in Buildroot, but there's something a bit similar in android-tools.

Quoted 4 lines

Just to be clear: the *preferred* solution is to patch
cmake/modules/falcosecurity-libs.cmake so it supports a system-installed falcosecurity-libs. (And then send that patch upstream to sysdig, of course).

Thank for your reviews and sorry for some misake I made (I was not aware of make legal-info, I will take the habit to run it now).

I will try to find the best solution.
Another one I thought about was to set falcosecurity-libs as a generic- package, so the .mk will just the source and the compilation can happen in sysdig.mk.
What it is your opinion about this proposal?

Quoted 35 lines

Regards,
Arnout

Quoted 31 lines

# Take this version from cmake/modules/falcosecurity-libs.cmake SYSDIG_FALCOSECURITY_LIBS_VERSION = e5c53d648f3c4694385bbe488e7d47eaa36c229a SYSDIG_EXTRA_DOWNLOADS = $(call github,falcosecurity,libs,$(SYSDIG_FALCOSECURITY_LIBS_VERSION))/falcosecur ity-libs-$(SYSDIG_FALCOSECURITY_LIBS_VERSION).tar.gz define SYSDIG_EXTRACT_FALCOSECURITY_LIBS

        $(call suitable-extractor,$(notdir $(SYSDIG_EXTRA_DOWNLOADS))) \
                $(SYSDIG_DL_DIR)/$(notdir $(SYSDIG_EXTRA_DOWNLOADS)) | \
                $(TAR) -C $(@D)/falcosecurity-libs --strip-components=1 \
            $(TAR_OPTIONS) -

endef
SYSDIG_POST_EXTRACT_HOOKS += SYSDIG_EXTRACT_FALCOSECURITY_LIBS

(you'll need to adapt the above to make sure it's extracted in the right place.)

Since the driver etc. are then part of the sysdig package again, not as
much will change. Just some directory names.

BTW, please also mention in the commit message that the issue with the
driver is fixed in recent falcosecurity/libs

Regards,
Arnout

Quoted 5 lines

+ -DVALIJSON_INCLUDE=$(BUILD_DIR)/valijson-0.6/include/valijson SYSDIG_MODULE_SUBDIRS = driver SYSDIG_MODULE_MAKE_OPTS = KERNELDIR=$(LINUX_DIR) -$(eval $(kernel-module))
$(eval $(cmake-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot