* [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
@ 2019-06-10 13:36 Thomas Deutschmann
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Deutschmann @ 2019-06-10 13:36 UTC (permalink / raw
To: gentoo-commits
commit: fb2edfa0a5001ed4e3cdc406b6bcd9bb4fb1c6cb
Author: Stefan Strogin <steils <AT> gentoo <DOT> org>
AuthorDate: Wed May 29 15:36:08 2019 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 13:34:47 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb2edfa0
sys-apps/kmod: add patch and USE flag for LibreSSL support
Closes: https://bugs.gentoo.org/677960
Package-Manager: Portage-2.3.67, Repoman-2.3.13
Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/11146
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
sys-apps/kmod/files/kmod-26-libressl.patch | 143 +++++++++++++++++++++
.../kmod/{kmod-26.ebuild => kmod-26-r1.ebuild} | 11 +-
sys-apps/kmod/kmod-26.ebuild | 11 +-
3 files changed, 161 insertions(+), 4 deletions(-)
diff --git a/sys-apps/kmod/files/kmod-26-libressl.patch b/sys-apps/kmod/files/kmod-26-libressl.patch
new file mode 100644
index 00000000000..cb36ab401c2
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-26-libressl.patch
@@ -0,0 +1,143 @@
+From 628677e066198d8658d7edd5511a5bb27cd229f5 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <steils@gentoo.org>
+Date: Sun, 19 May 2019 03:42:01 +0300
+Subject: [PATCH] libkmod-signature: use PKCS#7 instead of CMS
+
+Linux uses either PKCS #7 or CMS for signing modules (see
+scripts/sign-file.c). CMS is not supported by LibreSSL or older OpenSSL,
+so PKCS #7 is used on systems with these libcrypto providers.
+
+CMS and PKCS #7 formats are very similar. CMS is newer but is as much as
+possible backward compatible with PKCS #7 [1]. PKCS #7 is supported in
+the latest OpenSSL as well as CMS. The fields used for signing kernel
+modules are supported both in PKCS #7 and CMS.
+
+For now modinfo uses CMS with no alternative requiring OpenSSL 1.1.0 or
+newer.
+
+Use PKCS #7 for parsing module signature information, so that modinfo
+could be used both with OpenSSL and LibreSSL.
+
+[1] https://tools.ietf.org/html/rfc5652#section-1.1
+
+Changes v1->v2:
+- Don't use ifdefs for keeping redundant CMS code, just use PKCS #7 both
+with OpenSSL and LibreSSL.
+
+Upstream-Status: Accepted
+[https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=628677e066198d8658d7edd5511a5bb27cd229f5]
+Signed-off-by: Stefan Strogin <steils@gentoo.org>
+---
+ libkmod/libkmod-signature.c | 37 +++++++++++++++++++------------------
+ 1 file changed, 19 insertions(+), 18 deletions(-)
+
+diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
+index 48d0145..4e8748c 100644
+--- a/libkmod/libkmod-signature.c
++++ b/libkmod/libkmod-signature.c
+@@ -20,7 +20,7 @@
+ #include <endian.h>
+ #include <inttypes.h>
+ #ifdef ENABLE_OPENSSL
+-#include <openssl/cms.h>
++#include <openssl/pkcs7.h>
+ #include <openssl/ssl.h>
+ #endif
+ #include <stdio.h>
+@@ -122,7 +122,7 @@ static bool fill_default(const char *mem, off_t size,
+ #ifdef ENABLE_OPENSSL
+
+ struct pkcs7_private {
+- CMS_ContentInfo *cms;
++ PKCS7 *pkcs7;
+ unsigned char *key_id;
+ BIGNUM *sno;
+ };
+@@ -132,7 +132,7 @@ static void pkcs7_free(void *s)
+ struct kmod_signature_info *si = s;
+ struct pkcs7_private *pvt = si->private;
+
+- CMS_ContentInfo_free(pvt->cms);
++ PKCS7_free(pvt->pkcs7);
+ BN_free(pvt->sno);
+ free(pvt->key_id);
+ free(pvt);
+@@ -197,11 +197,10 @@ static bool fill_pkcs7(const char *mem, off_t size,
+ struct kmod_signature_info *sig_info)
+ {
+ const char *pkcs7_raw;
+- CMS_ContentInfo *cms;
+- STACK_OF(CMS_SignerInfo) *sis;
+- CMS_SignerInfo *si;
+- int rc;
+- ASN1_OCTET_STRING *key_id;
++ PKCS7 *pkcs7;
++ STACK_OF(PKCS7_SIGNER_INFO) *sis;
++ PKCS7_SIGNER_INFO *si;
++ PKCS7_ISSUER_AND_SERIAL *is;
+ X509_NAME *issuer;
+ ASN1_INTEGER *sno;
+ ASN1_OCTET_STRING *sig;
+@@ -220,31 +219,33 @@ static bool fill_pkcs7(const char *mem, off_t size,
+
+ in = BIO_new_mem_buf(pkcs7_raw, sig_len);
+
+- cms = d2i_CMS_bio(in, NULL);
+- if (cms == NULL) {
++ pkcs7 = d2i_PKCS7_bio(in, NULL);
++ if (pkcs7 == NULL) {
+ BIO_free(in);
+ return false;
+ }
+
+ BIO_free(in);
+
+- sis = CMS_get0_SignerInfos(cms);
++ sis = PKCS7_get_signer_info(pkcs7);
+ if (sis == NULL)
+ goto err;
+
+- si = sk_CMS_SignerInfo_value(sis, 0);
++ si = sk_PKCS7_SIGNER_INFO_value(sis, 0);
+ if (si == NULL)
+ goto err;
+
+- rc = CMS_SignerInfo_get0_signer_id(si, &key_id, &issuer, &sno);
+- if (rc == 0)
++ is = si->issuer_and_serial;
++ if (is == NULL)
+ goto err;
++ issuer = is->issuer;
++ sno = is->serial;
+
+- sig = CMS_SignerInfo_get0_signature(si);
++ sig = si->enc_digest;
+ if (sig == NULL)
+ goto err;
+
+- CMS_SignerInfo_get0_algs(si, NULL, NULL, &dig_alg, &sig_alg);
++ PKCS7_SIGNER_INFO_get0_algs(si, NULL, &dig_alg, &sig_alg);
+
+ sig_info->sig = (const char *)ASN1_STRING_get0_data(sig);
+ sig_info->sig_len = ASN1_STRING_length(sig);
+@@ -277,7 +278,7 @@ static bool fill_pkcs7(const char *mem, off_t size,
+ if (pvt == NULL)
+ goto err3;
+
+- pvt->cms = cms;
++ pvt->pkcs7 = pkcs7;
+ pvt->key_id = key_id_str;
+ pvt->sno = sno_bn;
+ sig_info->private = pvt;
+@@ -290,7 +291,7 @@ err3:
+ err2:
+ BN_free(sno_bn);
+ err:
+- CMS_ContentInfo_free(cms);
++ PKCS7_free(pkcs7);
+ return false;
+ }
+
+--
+2.21.0
+
diff --git a/sys-apps/kmod/kmod-26.ebuild b/sys-apps/kmod/kmod-26-r1.ebuild
similarity index 95%
copy from sys-apps/kmod/kmod-26.ebuild
copy to sys-apps/kmod/kmod-26-r1.ebuild
index c65b8e72243..a10a6cdda8d 100644
--- a/sys-apps/kmod/kmod-26.ebuild
+++ b/sys-apps/kmod/kmod-26-r1.ebuild
@@ -21,7 +21,7 @@ HOMEPAGE="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
LICENSE="LGPL-2"
SLOT="0"
-IUSE="debug doc lzma python ssl static-libs +tools zlib"
+IUSE="debug doc libressl lzma python ssl static-libs +tools zlib"
# Upstream does not support running the test suite with custom configure flags.
# I was also told that the test suite is intended for kmod developers.
@@ -36,7 +36,10 @@ RDEPEND="!sys-apps/module-init-tools
!<sys-apps/systemd-216-r3
lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
python? ( ${PYTHON_DEPS} )
- ssl? ( >=dev-libs/openssl-1.1.0:0= )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.1.0:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
DEPEND="${RDEPEND}
doc? ( dev-util/gtk-doc )
@@ -55,6 +58,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS="NEWS README TODO"
+PATCHES=(
+ "${FILESDIR}/${P}-libressl.patch" # bug 677960
+)
+
src_prepare() {
default
diff --git a/sys-apps/kmod/kmod-26.ebuild b/sys-apps/kmod/kmod-26.ebuild
index c65b8e72243..a10a6cdda8d 100644
--- a/sys-apps/kmod/kmod-26.ebuild
+++ b/sys-apps/kmod/kmod-26.ebuild
@@ -21,7 +21,7 @@ HOMEPAGE="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
LICENSE="LGPL-2"
SLOT="0"
-IUSE="debug doc lzma python ssl static-libs +tools zlib"
+IUSE="debug doc libressl lzma python ssl static-libs +tools zlib"
# Upstream does not support running the test suite with custom configure flags.
# I was also told that the test suite is intended for kmod developers.
@@ -36,7 +36,10 @@ RDEPEND="!sys-apps/module-init-tools
!<sys-apps/systemd-216-r3
lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
python? ( ${PYTHON_DEPS} )
- ssl? ( >=dev-libs/openssl-1.1.0:0= )
+ ssl? (
+ !libressl? ( >=dev-libs/openssl-1.1.0:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )
zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
DEPEND="${RDEPEND}
doc? ( dev-util/gtk-doc )
@@ -55,6 +58,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS="NEWS README TODO"
+PATCHES=(
+ "${FILESDIR}/${P}-libressl.patch" # bug 677960
+)
+
src_prepare() {
default
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
@ 2020-09-03 14:16 Thomas Deutschmann
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Deutschmann @ 2020-09-03 14:16 UTC (permalink / raw
To: gentoo-commits
commit: 4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 2 23:15:16 2020 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Sep 3 14:16:38 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e4dff82
sys-apps/kmod: rev bump to fix crash
Fixes
depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
...od-27-depmod-do-not-output-.bin-to-stdout.patch | 53 ++++++++++++++++++++++
.../kmod/{kmod-27-r1.ebuild => kmod-27-r2.ebuild} | 2 +
2 files changed, 55 insertions(+)
diff --git a/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
new file mode 100644
index 00000000000..dc776b515bc
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
@@ -0,0 +1,53 @@
+From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi@intel.com>
+Date: Thu, 5 Mar 2020 13:33:10 -0800
+Subject: depmod: do not output .bin to stdout
+
+index_write() relies on fseek/ftell to manage the position to which we
+are write and thus needs the file stream to support it.
+
+Right now when trying to write the index to stdout we fail with:
+
+ depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
+ Aborted (core dumped)
+
+We have no interest in outputting our index to stdout, so just skip it
+like is done with other indexes.
+
+While at it, add/remove some newlines to improve readability.
+
+Reported-by: Yanko Kaneti <yaneti@declera.com>
+Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo")
+---
+ tools/depmod.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/tools/depmod.c b/tools/depmod.c
+index fbbce10..875e314 100644
+--- a/tools/depmod.c
++++ b/tools/depmod.c
+@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+ struct index_node *idx;
+ struct kmod_list *l, *builtin = NULL;
+
+- idx = index_create();
++ if (out == stdout)
++ return 0;
+
++ idx = index_create();
+ if (idx == NULL) {
+ ret = -ENOMEM;
+ goto fail;
+@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+
+ if (count)
+ index_write(idx, out);
++
+ index_destroy(idx);
++
+ fail:
+ if (builtin)
+ kmod_module_unref_list(builtin);
+--
+cgit 1.2.3-1.el7
+
diff --git a/sys-apps/kmod/kmod-27-r1.ebuild b/sys-apps/kmod/kmod-27-r2.ebuild
similarity index 98%
rename from sys-apps/kmod/kmod-27-r1.ebuild
rename to sys-apps/kmod/kmod-27-r2.ebuild
index c9e60cdc33f..d01054db3c4 100644
--- a/sys-apps/kmod/kmod-27-r1.ebuild
+++ b/sys-apps/kmod/kmod-27-r2.ebuild
@@ -63,6 +63,8 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS="NEWS README TODO"
+PATCHES=( "${FILESDIR}"/${P}-depmod-do-not-output-.bin-to-stdout.patch )
+
src_prepare() {
default
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
@ 2024-03-02 0:21 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-03-02 0:21 UTC (permalink / raw
To: gentoo-commits
commit: bc235c9a342826e6aab77d08ded3ca008823dd28
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 2 00:16:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 2 00:16:07 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc235c9a
sys-apps/kmod: drop 30-r1
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/kmod/Manifest | 1 -
.../kmod/files/kmod-30-configure-clang16.patch | 26 ---
sys-apps/kmod/kmod-30-r1.ebuild | 231 ---------------------
3 files changed, 258 deletions(-)
diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
index c20a66d382eb..554efc99d6a0 100644
--- a/sys-apps/kmod/Manifest
+++ b/sys-apps/kmod/Manifest
@@ -1,2 +1 @@
-DIST kmod-30.tar.xz 567484 BLAKE2B c5cb690dbb8fad66ac603648ff330794b417ff2fa2f8f61b6e9cb76dab93f984128b3d83a826203f39f3fb94f174f0db7395db6a47e52e8b7c561486f9d00778 SHA512 e2cd34e600a72e44710760dfda9364b790b8352a99eafbd43e683e4a06f37e6b5c0b5d14e7c28070e30fc5fc6ceddedf7b97f3b6c2c5c2d91204fefd630b9a3e
DIST kmod-31.tar.xz 570936 BLAKE2B 0dc8572da570315cf0aadd87fa7e83d0f88dea91c8566749e6f3004f9a6df916dce337ca99ea5929d41f45b408c1e3effa50f9d24615d7fa28688150a5ce91cf SHA512 05ca70381808bec5f262b94db625662c385408988178a35e4aaf4960ee0716dc0cbfc327160ea4b61098d0c2130ab1b5142ea8156bea8e06ded7f4d288b6d085
diff --git a/sys-apps/kmod/files/kmod-30-configure-clang16.patch b/sys-apps/kmod/files/kmod-30-configure-clang16.patch
deleted file mode 100644
index a9e1093aecff..000000000000
--- a/sys-apps/kmod/files/kmod-30-configure-clang16.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://github.com/kmod-project/kmod/commit/035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2
-
-From 035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2 Mon Sep 17 00:00:00 2001
-From: Florian Weimer <fweimer@redhat.com>
-Date: Sat, 17 Dec 2022 17:52:34 +0100
-Subject: [PATCH] kmod: configure.ac: In _Noreturn check, include <stdlib.h>
- for exit
-
-Otherwise, an implicit functiona declaration is used, causing
-a C99 compatibility issue.
-
-Signed-off-by: Florian Weimer <fweimer@redhat.com>
-Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
---- a/configure.ac
-+++ b/configure.ac
-@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE(
-
- AC_MSG_CHECKING([whether _Noreturn is supported])
- AC_COMPILE_IFELSE(
-- [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])],
-+ [AC_LANG_SOURCE([[#include <stdlib.h>
-+ _Noreturn int foo(void) { exit(0); }]])],
- [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available])
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
-
diff --git a/sys-apps/kmod/kmod-30-r1.ebuild b/sys-apps/kmod/kmod-30-r1.ebuild
deleted file mode 100644
index 5dff1407325b..000000000000
--- a/sys-apps/kmod/kmod-30-r1.ebuild
+++ /dev/null
@@ -1,231 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{10..11} )
-
-inherit autotools libtool bash-completion-r1 python-r1
-
-if [[ ${PV} == 9999* ]]; then
- EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
- inherit git-r3
-else
- SRC_URI="https://www.kernel.org/pub/linux/utils/kernel/kmod/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-fi
-
-DESCRIPTION="library and tools for managing linux kernel modules"
-HOMEPAGE="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug doc +lzma pkcs7 python static-libs +tools +zlib +zstd"
-
-# Upstream does not support running the test suite with custom configure flags.
-# I was also told that the test suite is intended for kmod developers.
-# So we have to restrict it.
-# See bug #408915.
-#RESTRICT="test"
-
-# - >=zlib-1.2.6 required because of bug #427130
-# - Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
-# - >=zstd-1.5.2-r1 required for bug #771078
-RDEPEND="!sys-apps/module-init-tools
- !sys-apps/modutils
- !<sys-apps/openrc-0.13.8
- !<sys-apps/systemd-216-r3
- lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
- python? ( ${PYTHON_DEPS} )
- pkcs7? ( >=dev-libs/openssl-1.1.0:= )
- zlib? ( >=sys-libs/zlib-1.2.6 )
- zstd? ( >=app-arch/zstd-1.5.2-r1:= )"
-DEPEND="${RDEPEND}"
-BDEPEND="
- doc? (
- dev-util/gtk-doc
- dev-build/gtk-doc-am
- )
- lzma? ( virtual/pkgconfig )
- python? (
- dev-python/cython[${PYTHON_USEDEP}]
- virtual/pkgconfig
- )
- zlib? ( virtual/pkgconfig )
-"
-if [[ ${PV} == 9999* ]]; then
- BDEPEND="${BDEPEND}
- dev-libs/libxslt"
-fi
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-DOCS=( NEWS README.md TODO )
-
-PATCHES=(
- "${FILESDIR}"/${P}-configure-clang16.patch
-)
-
-src_prepare() {
- default
-
- if [[ ! -e configure ]] || use doc ; then
- if use doc; then
- cp "${BROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
- gtkdocize --copy --docdir libkmod/docs || die
- else
- touch libkmod/docs/gtk-doc.make
- fi
- eautoreconf
- else
- #elibtoolize
- # TODO: restore to elibtoolize in next release after 30
- # autoreconf only here for clang patch.
- eautoreconf
- fi
-
- # Restore possibility of running --enable-static, bug #472608
- sed -i \
- -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
- configure || die
-}
-
-src_configure() {
- local myeconfargs=(
- --bindir="${EPREFIX}/bin"
- --enable-shared
- --with-bashcompletiondir="$(get_bashcompdir)"
- --with-rootlibdir="${EPREFIX}/$(get_libdir)"
- $(use_enable debug)
- $(usex doc '--enable-gtk-doc' '')
- $(use_enable static-libs static)
- $(use_enable tools)
- $(use_with lzma xz)
- $(use_with pkcs7 openssl)
- $(use_with zlib)
- $(use_with zstd)
- )
-
- local ECONF_SOURCE="${S}"
-
- kmod_configure() {
- mkdir -p "${BUILD_DIR}" || die
- run_in_build_dir econf "${myeconfargs[@]}" "$@"
- }
-
- BUILD_DIR="${WORKDIR}/build"
- kmod_configure --disable-python
-
- if use python; then
- python_foreach_impl kmod_configure --enable-python
- fi
-}
-
-src_compile() {
- emake -C "${BUILD_DIR}"
-
- if use python; then
- local native_builddir="${BUILD_DIR}"
-
- python_compile() {
- emake -C "${BUILD_DIR}" -f Makefile -f - python \
- VPATH="${native_builddir}:${S}" \
- native_builddir="${native_builddir}" \
- libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
- <<< 'python: $(pkgpyexec_LTLIBRARIES)'
- }
-
- python_foreach_impl python_compile
- fi
-}
-
-src_test() {
- python_test() {
- mkdir "${T}/test-${EPYTHON}" || die
- emake -C "${BUILD_DIR}" DESTDIR="${T}/test-${EPYTHON}" \
- VPATH="${native_builddir}:${S}" \
- install-pkgpyexecLTLIBRARIES \
- install-dist_pkgpyexecPYTHON
-
- # Smoke test based on https://bugs.gentoo.org/891975#c5
- local -x PYTHONPATH="${T}/test-${EPYTHON}/usr/lib/${EPYTHON}/site-packages:${PYTHONPATH}"
- ${EPYTHON} -c 'import kmod; km = kmod.Kmod(); print([(m.name, m.size) for m in km.loaded()])' || die
- rm -r "${T}/test-${EPYTHON}" || die
- }
-
- if use python; then
- python_foreach_impl python_test
- fi
-}
-
-src_install() {
- emake -C "${BUILD_DIR}" DESTDIR="${D}" install
-
- einstalldocs
-
- if use python; then
- local native_builddir="${BUILD_DIR}"
-
- python_install() {
- emake -C "${BUILD_DIR}" DESTDIR="${D}" \
- VPATH="${native_builddir}:${S}" \
- install-pkgpyexecLTLIBRARIES \
- install-dist_pkgpyexecPYTHON
- python_optimize
- }
-
- python_foreach_impl python_install
- fi
-
- find "${ED}" -type f -name "*.la" -delete || die
-
- if use tools; then
- local cmd
- for cmd in depmod insmod modprobe rmmod; do
- dosym ../bin/kmod /sbin/${cmd}
- done
-
- # These are also usable as normal user
- for cmd in lsmod modinfo; do
- dosym kmod /bin/${cmd}
- done
- fi
-
- cat <<-EOF > "${T}"/usb-load-ehci-first.conf
- softdep uhci_hcd pre: ehci_hcd
- softdep ohci_hcd pre: ehci_hcd
- EOF
-
- insinto /lib/modprobe.d
- # bug #260139
- doins "${T}"/usb-load-ehci-first.conf
-
- newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
-}
-
-pkg_postinst() {
- if [[ -L ${EROOT}/etc/runlevels/boot/static-nodes ]]; then
- ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
- rm -f "${EROOT}"/etc/runlevels/boot/static-nodes
- fi
-
- # Add kmod to the runlevel automatically if this is the first install of this package.
- if [[ -z ${REPLACING_VERSIONS} ]]; then
- if [[ ! -d ${EROOT}/etc/runlevels/sysinit ]]; then
- mkdir -p "${EROOT}"/etc/runlevels/sysinit
- fi
- if [[ -x ${EROOT}/etc/init.d/kmod-static-nodes ]]; then
- ln -s /etc/init.d/kmod-static-nodes "${EROOT}"/etc/runlevels/sysinit/kmod-static-nodes
- fi
- fi
-
- if [[ -e ${EROOT}/etc/runlevels/sysinit ]]; then
- if ! has_version sys-apps/systemd && [[ ! -e ${EROOT}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
- ewarn
- ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
- ewarn "kernel modules to have required static nodes!"
- ewarn "Run this command:"
- ewarn "\trc-update add kmod-static-nodes sysinit"
- fi
- fi
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
@ 2025-03-14 10:42 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2025-03-14 10:42 UTC (permalink / raw
To: gentoo-commits
commit: 60f73e347fd6815fea01d4f6fe841dc60ab86e55
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 14 10:40:59 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 14 10:41:31 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60f73e34
sys-apps/kmod: drop 32-r2
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-apps/kmod/Manifest | 1 -
sys-apps/kmod/files/kmod-31-musl-basename.patch | 113 ------------------
sys-apps/kmod/kmod-32-r2.ebuild | 149 ------------------------
3 files changed, 263 deletions(-)
diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
index 3f2f5cc1ff71..e6c3dab07105 100644
--- a/sys-apps/kmod/Manifest
+++ b/sys-apps/kmod/Manifest
@@ -1,2 +1 @@
-DIST kmod-32.tar.xz 511988 BLAKE2B 5b5dac4639406549b23bb1da44bedd86a42885304ef4c7c67344dc8fd70b9e0ca3f83d033c6b80f6e00371d7188e205f4b68fadc56a9ddbf9d6a9d28e9b1e9a4 SHA512 29162135aabd025dff178a4147a754b5da5964855dbeee65ca867dec3b84437f35c1c97f0f027e974a021d3ee9a4940309a716859cc3cfe93c7ed0aada338f24
DIST kmod-33.tar.xz 514428 BLAKE2B 5fb4ea9d96217f8c94cba752b07a1b53228c6ae79dbaa605030cd84e3c6ca8d9c1a703a0253cea1d6c78a78f1507e2a1d9c6215d28dcb01b9e7f8b98a9fde425 SHA512 32d79d0bb7e89012f18458d4e88325f8e19a7dba6e1d5cff01aec3e618d1757b0f7c119735bf38d02e0d056a14273fd7522fca7c61a4d12a3ea5854bb662fff8
diff --git a/sys-apps/kmod/files/kmod-31-musl-basename.patch b/sys-apps/kmod/files/kmod-31-musl-basename.patch
deleted file mode 100644
index f4839dad2474..000000000000
--- a/sys-apps/kmod/files/kmod-31-musl-basename.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-https://github.com/kmod-project/kmod/pull/32
-
-From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 9 Dec 2023 17:35:59 -0800
-Subject: [PATCH] Use portable implementation for basename API
-
-musl has removed the non-prototype declaration of basename from
-string.h [1] which now results in build errors with clang-17+ compiler
-
-Implement GNU basename behavior using strchr which is portable across libcs
-
-Fixes
-../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
-71 | "Commands:\n", basename(argv[0]));
-| ^
-
-[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
-
-Suggested-by: Rich Felker
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
---- a/libkmod/libkmod-config.c
-+++ b/libkmod/libkmod-config.c
-@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx,
- bool is_single = false;
-
- if (name == NULL) {
-- name = basename(path);
-+ name = gnu_basename(path);
- is_single = true;
- }
-
---- a/shared/util.c
-+++ b/shared/util.c
-@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t *
-
- char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len)
- {
-- char *modname;
-+ const char *modname;
-
-- modname = basename(path);
-+ modname = gnu_basename(path);
- if (modname == NULL || modname[0] == '\0')
- return NULL;
-
---- a/shared/util.h
-+++ b/shared/util.h
-@@ -5,6 +5,7 @@
- #include <stdbool.h>
- #include <stdlib.h>
- #include <stdio.h>
-+#include <string.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <time.h>
-@@ -76,6 +77,12 @@ do { \
- __p->__v = (val); \
- } while(0)
-
-+static _always_inline_ const char *gnu_basename(const char *s)
-+{
-+ const char *p = strrchr(s, '/');
-+ return p ? p+1 : s;
-+}
-+
- static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u)
- {
- return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1));
---- a/testsuite/testsuite.c
-+++ b/testsuite/testsuite.c
-@@ -70,7 +70,7 @@ static void help(void)
-
- printf("Usage:\n"
- "\t%s [options] <test>\n"
-- "Options:\n", basename(progname));
-+ "Options:\n", gnu_basename(progname));
-
- for (itr = options, itr_short = options_short;
- itr->name != NULL; itr++, itr_short++)
---- a/tools/depmod.c
-+++ b/tools/depmod.c
-@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files
- if (name != NULL)
- namelen = strlen(name);
- else {
-- name = basename(dir);
-+ name = gnu_basename(dir);
- namelen = strlen(name);
- dirlen -= namelen + 1;
- }
---- a/tools/kmod.c
-+++ b/tools/kmod.c
-@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[])
- "Options:\n"
- "\t-V, --version show version\n"
- "\t-h, --help show this help\n\n"
-- "Commands:\n", basename(argv[0]));
-+ "Commands:\n", gnu_basename(argv[0]));
-
- for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) {
- if (kmod_cmds[i]->help != NULL) {
-@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[])
- const char *cmd;
- size_t i;
-
-- cmd = basename(argv[0]);
-+ cmd = gnu_basename(argv[0]);
-
- for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) {
- if (streq(kmod_compat_cmds[i]->name, cmd))
-
diff --git a/sys-apps/kmod/kmod-32-r2.ebuild b/sys-apps/kmod/kmod-32-r2.ebuild
deleted file mode 100644
index ba1675a4d321..000000000000
--- a/sys-apps/kmod/kmod-32-r2.ebuild
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit autotools libtool bash-completion-r1
-
-DESCRIPTION="Library and tools for managing linux kernel modules"
-HOMEPAGE="https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git"
-
-if [[ ${PV} == 9999* ]]; then
- EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
- inherit git-r3
-else
- SRC_URI="https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kmod/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-fi
-
-LICENSE="LGPL-2"
-SLOT="0"
-IUSE="debug doc +lzma pkcs7 static-libs +tools +zlib +zstd"
-
-# Upstream does not support running the test suite with custom configure flags.
-# I was also told that the test suite is intended for kmod developers.
-# So we have to restrict it.
-# See bug #408915.
-#RESTRICT="test"
-
-# - >=zlib-1.2.6 required because of bug #427130
-# - Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
-# - >=zstd-1.5.2-r1 required for bug #771078
-RDEPEND="
- !sys-apps/module-init-tools
- !sys-apps/modutils
- !<sys-apps/openrc-0.13.8
- !<sys-apps/systemd-216-r3
- lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
- pkcs7? ( >=dev-libs/openssl-1.1.0:= )
- zlib? ( >=sys-libs/zlib-1.2.6 )
- zstd? ( >=app-arch/zstd-1.5.2-r1:= )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- doc? (
- dev-util/gtk-doc
- dev-build/gtk-doc-am
- )
- lzma? ( virtual/pkgconfig )
- zlib? ( virtual/pkgconfig )
-"
-if [[ ${PV} == 9999* ]]; then
- BDEPEND+=" dev-libs/libxslt"
-fi
-
-PATCHES=(
- "${FILESDIR}"/${PN}-31-musl-basename.patch
-)
-
-src_prepare() {
- default
-
- if [[ ! -e configure ]] || use doc ; then
- if use doc; then
- cp "${BROOT}"/usr/share/aclocal/gtk-doc.m4 m4 || die
- gtkdocize --copy --docdir libkmod/docs || die
- else
- touch libkmod/docs/gtk-doc.make
- fi
- eautoreconf
- else
- elibtoolize
- fi
-
- # Restore possibility of running --enable-static, bug #472608
- sed -i \
- -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
- configure || die
-}
-
-src_configure() {
- local myeconfargs=(
- --bindir="${EPREFIX}/bin"
- --sbindir="${EPREFIX}/sbin"
- --enable-shared
- --with-bashcompletiondir="$(get_bashcompdir)"
- $(use_enable debug)
- $(usev doc '--enable-gtk-doc')
- $(use_enable static-libs static)
- $(use_enable tools)
- $(use_with lzma xz)
- $(use_with pkcs7 openssl)
- $(use_with zlib)
- $(use_with zstd)
- )
-
- econf "${myeconfargs[@]}"
-}
-
-src_install() {
- default
-
- find "${ED}" -type f -name "*.la" -delete || die
-
- if use tools; then
- local cmd
- for cmd in depmod insmod modprobe rmmod; do
- rm "${ED}"/bin/${cmd} || die
- dosym ../bin/kmod /sbin/${cmd}
- done
- fi
-
- cat <<-EOF > "${T}"/usb-load-ehci-first.conf
- softdep uhci_hcd pre: ehci_hcd
- softdep ohci_hcd pre: ehci_hcd
- EOF
-
- insinto /lib/modprobe.d
- # bug #260139
- doins "${T}"/usb-load-ehci-first.conf
-
- newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
-}
-
-pkg_postinst() {
- if [[ -L ${EROOT}/etc/runlevels/boot/static-nodes ]]; then
- ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
- rm -f "${EROOT}"/etc/runlevels/boot/static-nodes
- fi
-
- # Add kmod to the runlevel automatically if this is the first install of this package.
- if [[ -z ${REPLACING_VERSIONS} ]]; then
- if [[ ! -d ${EROOT}/etc/runlevels/sysinit ]]; then
- mkdir -p "${EROOT}"/etc/runlevels/sysinit
- fi
- if [[ -x ${EROOT}/etc/init.d/kmod-static-nodes ]]; then
- ln -s /etc/init.d/kmod-static-nodes "${EROOT}"/etc/runlevels/sysinit/kmod-static-nodes
- fi
- fi
-
- if [[ -e ${EROOT}/etc/runlevels/sysinit ]]; then
- if ! has_version sys-apps/systemd && [[ ! -e ${EROOT}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
- ewarn
- ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
- ewarn "kernel modules to have required static nodes!"
- ewarn "Run this command:"
- ewarn "\trc-update add kmod-static-nodes sysinit"
- fi
- fi
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-14 10:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-10 13:36 [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/ Thomas Deutschmann
-- strict thread matches above, loose matches on Subject: below --
2020-09-03 14:16 Thomas Deutschmann
2024-03-02 0:21 Sam James
2025-03-14 10:42 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox