summaryrefslogtreecommitdiff
path: root/dev-util/scap-driver
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-02-22 20:29:22 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-02-22 20:29:22 +0000
commit71fb24e4cc15fe73651423df81c5e6a79fa8c142 (patch)
tree962fbc79d3fbda0c4123d5119df5e728d4d7b18c /dev-util/scap-driver
parentaae71b4d8e684ca22d28ef0f1da0989e7bf6468d (diff)
gentoo auto-resync : 22:02:2023 - 20:29:22
Diffstat (limited to 'dev-util/scap-driver')
-rw-r--r--dev-util/scap-driver/Manifest2
-rw-r--r--dev-util/scap-driver/files/0.29.3-fix-kmod-build-on-6.2+.patch44
-rw-r--r--dev-util/scap-driver/scap-driver-0.29.3-r1.ebuild59
3 files changed, 105 insertions, 0 deletions
diff --git a/dev-util/scap-driver/Manifest b/dev-util/scap-driver/Manifest
index 74e58f16b770..af35cc9042f1 100644
--- a/dev-util/scap-driver/Manifest
+++ b/dev-util/scap-driver/Manifest
@@ -1,4 +1,6 @@
AUX 0.29.3-fix-kmod-build-on-5.18+.patch 2363 BLAKE2B 8e5a89b68fb67076d01a7dc295157d2f2542a2db84460a35ed3162b77ff860097f1761317b93dec6aa0d6294b4414e445fd2c94df700bb5d738210982174f595 SHA512 f7c1e57cb05de1a97a3332055f6d6f74a637f38281a4e98b202cf84c9dd02b90e0b4fee3dbc44653760231ce55ad396aec3018b3b239249b6a37b018f672fba4
+AUX 0.29.3-fix-kmod-build-on-6.2+.patch 1420 BLAKE2B 45f312bce9ce3dbaa0ddd300ccfd7dfcc3fb6d537cd0b716642d25b4c5a3747798ca23d237d67c92d32da500edb5e0458bfdff4a940d2f6fdb84144c5687028d SHA512 4b84a2559cb6a72d294b5cac6ec2d6f2de8ae90e298e27afcdff6bc046366afca6468ac923c4197623f14bbe0a4d0bd3757f34740a367e6b7c4e76472b102379
DIST falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a.tar.gz 816972 BLAKE2B b47ae6a7677935500ebdab8aea7f4c49ef50b7175ec097e7213a1f041ac2b5aa642379924927ec12c84271016e9ab9d191c0c1d4ffacd6ade58b7a03c37f9221 SHA512 65e5916e5f9507fd867a5e9ba3b2670a1b73b7672a22479d3019e948a52ad74441d7e2ce1c74ebd0fdbd1ce66808efa49f285bd5180bceae9d4e6730a60787ce
+EBUILD scap-driver-0.29.3-r1.ebuild 1871 BLAKE2B fa97c444251044913625228bd42d8ab22be21f69ddc75f4e45c15df832c1d1a6dab927f146fdb03addfa244a71ae2329d9651a2a454b79f45dd8a99eb53509da SHA512 7cc7ec73b64691fb8109b4fb406ce3ce565d9d09ead707290394599035f9d6059e5f88bce857b380c967a1edf008442541d692fd453a57880c1f61458da736d9
EBUILD scap-driver-0.29.3.ebuild 1818 BLAKE2B 739c7da7402f536aa4ee483c77de16498fef6460bdaad84f35bb7bb6f4ad06daac2e99349498f68f741c8348120ccb535bdaa7333d17ce10f3feea78d4889ddf SHA512 7c7d39dc69f2cdc28e656911513ca560722399b051adb5ef6a5626503536337ab7eeae39a2b9ababd217188324e4f270cc3ff9105ca04c63f3f9a919ebf26931
MISC metadata.xml 494 BLAKE2B d0bc754d3af2488b9dc7672fc63e962f4c885d88a819e4332bd1c25f84c967e2e1cd8489122490a864cbfd930225b3dc28c8bfad4426750c030dce6ef5a08b4e SHA512 b77b7c103cfb606333814af210a0fae1f7956ddd9d3c3a044b0bebf42553f5ffe99d04549fb9c5e40fce33e9d23761830b4944b2cd83bd8ca2193f9b7da60fc0
diff --git a/dev-util/scap-driver/files/0.29.3-fix-kmod-build-on-6.2+.patch b/dev-util/scap-driver/files/0.29.3-fix-kmod-build-on-6.2+.patch
new file mode 100644
index 000000000000..39476feef051
--- /dev/null
+++ b/dev-util/scap-driver/files/0.29.3-fix-kmod-build-on-6.2+.patch
@@ -0,0 +1,44 @@
+
+
+Bug: https://bugs.gentoo.org/895868
+Source: https://github.com/falcosecurity/libs/commit/b8ec3e8637c850066d01543616fe413e8deb9e1f
+
+From b8ec3e8637c850066d01543616fe413e8deb9e1f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
+Date: Tue, 21 Feb 2023 22:08:23 +0100
+Subject: [PATCH] fix(driver): fix build on linux-6.2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Attributes in "struct device*" are now const, so add a matching prototype
+for ppm_devnode().
+
+Fixes #918
+
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+---
+ driver/main.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/driver/main.c b/driver/main.c
+index 197933b9ce..6dc3374fc1 100644
+--- a/driver/main.c
++++ b/driver/main.c
+@@ -2662,11 +2662,15 @@ static int get_tracepoint_handles(void)
+ #endif
+
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
++static char *ppm_devnode(const struct device *dev, umode_t *mode)
++#else
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+ static char *ppm_devnode(struct device *dev, umode_t *mode)
+ #else
+ static char *ppm_devnode(struct device *dev, mode_t *mode)
+-#endif
++#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0) */
++#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(6, 2, 0) */
+ {
+ if (mode) {
+ *mode = 0400;
diff --git a/dev-util/scap-driver/scap-driver-0.29.3-r1.ebuild b/dev-util/scap-driver/scap-driver-0.29.3-r1.ebuild
new file mode 100644
index 000000000000..3006d1559d7a
--- /dev/null
+++ b/dev-util/scap-driver/scap-driver-0.29.3-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake linux-mod
+
+DESCRIPTION="Kernel module for dev-util/sysdig"
+HOMEPAGE="https://sysdig.com/"
+
+# The driver is part of falcosecurity/libs, but for versioning reasons we cannot (yet)
+# use semver-released packages; instead we pull in a commit that is used and known
+# to work with sysdig, see sysdig/cmake/modules/falcosecurity-libs.cmake for details.
+# For now the commit here and the one referenced in sysdig should be in sync.
+LIBS_COMMIT="e5c53d648f3c4694385bbe488e7d47eaa36c229a"
+SRC_URI="https://github.com/falcosecurity/libs/archive/${LIBS_COMMIT}.tar.gz -> falcosecurity-libs-${LIBS_COMMIT}.tar.gz"
+S="${WORKDIR}/libs-${LIBS_COMMIT}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+RDEPEND="!<dev-util/sysdig-${PV}[modules]"
+
+CONFIG_CHECK="HAVE_SYSCALL_TRACEPOINTS ~TRACEPOINTS"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-fix-kmod-build-on-5.18+.patch
+ "${FILESDIR}"/${PV}-fix-kmod-build-on-6.2+.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ # we will use linux-mod, so just pretend to use bundled deps
+ # in order to make it through the cmake setup.
+ -DUSE_BUNDLED_DEPS=ON
+ -DCREATE_TEST_TARGETS=OFF
+ -DDRIVER_VERSION=${LIBS_COMMIT}
+ )
+
+ cmake_src_configure
+
+ # setup linux-mod ugliness
+ MODULE_NAMES="scap(extra:${BUILD_DIR}/driver/src:)"
+ BUILD_PARAMS='KERNELDIR="${KERNEL_DIR}"'
+ # work with clang-built kernels (#816024)
+ if linux_chkconfig_present CC_IS_CLANG; then
+ BUILD_PARAMS+=' CC=${CHOST}-clang'
+ if linux_chkconfig_present LD_IS_LLD; then
+ BUILD_PARAMS+=' LD=ld.lld'
+ if linux_chkconfig_present LTO_CLANG_THIN; then
+ # kernel enables cache by default leading to sandbox violations
+ BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+ fi
+ fi
+ fi
+
+ BUILD_TARGETS="all"
+}