commit: 77ffd89b56ed7492a0a3d6c9e11c433e6b00f8cd Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com> AuthorDate: Wed Jul 20 11:56:56 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Aug 23 05:34:18 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77ffd89b
dev-util/scap-driver: new package, replacement for sysdig-kmod Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com> Signed-off-by: Sam James <sam <AT> gentoo.org> dev-util/scap-driver/Manifest | 1 + dev-util/scap-driver/metadata.xml | 15 +++++++ dev-util/scap-driver/scap-driver-0.29.3.ebuild | 54 ++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/dev-util/scap-driver/Manifest b/dev-util/scap-driver/Manifest new file mode 100644 index 000000000000..ea647a605682 --- /dev/null +++ b/dev-util/scap-driver/Manifest @@ -0,0 +1 @@ +DIST falcosecurity-libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a.tar.gz 816972 BLAKE2B b47ae6a7677935500ebdab8aea7f4c49ef50b7175ec097e7213a1f041ac2b5aa642379924927ec12c84271016e9ab9d191c0c1d4ffacd6ade58b7a03c37f9221 SHA512 65e5916e5f9507fd867a5e9ba3b2670a1b73b7672a22479d3019e948a52ad74441d7e2ce1c74ebd0fdbd1ce66808efa49f285bd5180bceae9d4e6730a60787ce diff --git a/dev-util/scap-driver/metadata.xml b/dev-util/scap-driver/metadata.xml new file mode 100644 index 000000000000..e786b1b99988 --- /dev/null +++ b/dev-util/scap-driver/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>hol...@applied-asynchrony.com</email> + <name>Holger Hoffstätte</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-ma...@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">falcosecuity/libs</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-util/scap-driver/scap-driver-0.29.3.ebuild b/dev-util/scap-driver/scap-driver-0.29.3.ebuild new file mode 100644 index 000000000000..518e80e54462 --- /dev/null +++ b/dev-util/scap-driver/scap-driver-0.29.3.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2022 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" + +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" +}