summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Hoffstätte <holger@applied-asynchrony.com>2023-02-22 13:44:17 +0100
committerSam James <sam@gentoo.org>2023-02-22 16:14:47 +0000
commit20da12d7933ae81dd5eba4bb9e0eb7ffa808203b (patch)
tree8df6746dbbfadc1d4c2085bacf5e9d1e23ed2333 /dev-util/scap-driver
parentmedia-libs/lib3mf: fix bug #895180 (diff)
downloadgentoo-20da12d7933ae81dd5eba4bb9e0eb7ffa808203b.tar.gz
gentoo-20da12d7933ae81dd5eba4bb9e0eb7ffa808203b.tar.bz2
gentoo-20da12d7933ae81dd5eba4bb9e0eb7ffa808203b.zip
dev-util/scap-driver: fix build wth kernel 6.2
Closes: https://bugs.gentoo.org/895868 Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Closes: https://github.com/gentoo/gentoo/pull/29719 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/scap-driver')
-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
2 files changed, 103 insertions, 0 deletions
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"
+}