[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/files/, sys-apps/kmod/
commit: 7e18d8b8c3d468754790010cc157cc8eaff3d5b5 Author: Sam James gentoo org> AuthorDate: Sat Mar 2 00:13:33 2024 + Commit: Sam James gentoo org> CommitDate: Sat Mar 2 00:14:43 2024 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e18d8b8 sys-apps/kmod: drop Python bindings, fix musl-1.2.5 compat (modern C porting) * Drop Python bindings for weird double install issue (bug #925568). This is a somewhat extreme response, but it turns out upstream have dropped the bindings upstream anyway in https://github.com/kmod-project/kmod/commit/594f102cf575b0d5c01ebff22aae450c8a204d45 for the next release. * Fix musl-1.2.5 compat wrt POSIX vs GNU basename. Would segfault at runtime otherwise on a non-strict C compiler. Closes: https://bugs.gentoo.org/925568 Signed-off-by: Sam James gentoo.org> sys-apps/kmod/files/kmod-31-musl-basename.patch| 113 + .../kmod/{kmod-.ebuild => kmod-31-r1.ebuild} | 102 +++ sys-apps/kmod/kmod-.ebuild | 102 +++ 3 files changed, 145 insertions(+), 172 deletions(-) diff --git a/sys-apps/kmod/files/kmod-31-musl-basename.patch b/sys-apps/kmod/files/kmod-31-musl-basename.patch new file mode 100644 index ..f4839dad2474 --- /dev/null +++ b/sys-apps/kmod/files/kmod-31-musl-basename.patch @@ -0,0 +1,113 @@ +https://github.com/kmod-project/kmod/pull/32 + +From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +--- 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 + #include + #include ++#include + #include + #include + #include +@@ -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] \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, --helpshow 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; + +-
[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/files/, sys-apps/kmod/
commit: 930f5a77702f60fa65b27e71f6ddd214eb2ed1a4 Author: Sam James gentoo org> AuthorDate: Wed Jan 4 03:46:22 2023 + Commit: Sam James gentoo org> CommitDate: Wed Jan 4 04:31:57 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=930f5a77 sys-apps/kmod: fix configure w/ clang 16 Signed-off-by: Sam James gentoo.org> .../kmod/files/kmod-30-configure-clang16.patch | 26 +++ sys-apps/kmod/kmod-30-r1.ebuild| 212 + 2 files changed, 238 insertions(+) diff --git a/sys-apps/kmod/files/kmod-30-configure-clang16.patch b/sys-apps/kmod/files/kmod-30-configure-clang16.patch new file mode 100644 index ..a9e1093aecff --- /dev/null +++ b/sys-apps/kmod/files/kmod-30-configure-clang16.patch @@ -0,0 +1,26 @@ +https://github.com/kmod-project/kmod/commit/035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2 + +From 035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Sat, 17 Dec 2022 17:52:34 +0100 +Subject: [PATCH] kmod: configure.ac: In _Noreturn check, include + for exit + +Otherwise, an implicit functiona declaration is used, causing +a C99 compatibility issue. + +Signed-off-by: Florian Weimer +Signed-off-by: Lucas De Marchi +--- 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 ++ _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 new file mode 100644 index ..745848fed41f --- /dev/null +++ b/sys-apps/kmod/kmod-30-r1.ebuild @@ -0,0 +1,212 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit autotools libtool bash-completion-r1 python-r1 + +if [[ ${PV} == * ]]; 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 + !=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-util/gtk-doc-am + ) + lzma? ( virtual/pkgconfig ) + python? ( + dev-python/cython[${PYTHON_USEDEP}] + virtual/pkgconfig + ) + zlib? ( virtual/pkgconfig ) +" +if [[ ${PV} == * ]]; 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)" +
[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/files/, sys-apps/kmod/
commit: 874fc0b17dd30cf7c7221f74cf557c4c7e535585 Author: Lars Wendler gentoo org> AuthorDate: Fri May 21 06:49:28 2021 + Commit: Lars Wendler gentoo org> CommitDate: Fri May 21 07:06:12 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=874fc0b1 sys-apps/kmod: Removed old Signed-off-by: Lars Wendler gentoo.org> sys-apps/kmod/Manifest | 1 - ...od-27-depmod-do-not-output-.bin-to-stdout.patch | 53 -- sys-apps/kmod/kmod-27-r2.ebuild| 202 - 3 files changed, 256 deletions(-) diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest index 43d7af8f39e..9ad5f1386be 100644 --- a/sys-apps/kmod/Manifest +++ b/sys-apps/kmod/Manifest @@ -1,3 +1,2 @@ -DIST kmod-27.tar.xz 548924 BLAKE2B 9f12bf5792d4c867e28e0776c279369c063e84269212e3f699ae6e5e69b8b2b466b5033e43e17ac64d6101592edcf3c34881916afb6ae676b49dc8838dfe1396 SHA512 e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c DIST kmod-28.tar.xz 552448 BLAKE2B af41a0c5681fb94eb5264f46ed2ae666d171d4e2d0dc21419a3c2f4b12a783350a06b408fb02a7afb00fcea1cd994ee35864c1ec8b7a8cc58a8c9dcdeffaf1b3 SHA512 50646dc72675a5e17b01e327e3d41b972f18aaeac20c8b00983c4d099c6218f35c32c184a833a2d7f716755d6a86851c90913d2835874cef933bdc4a9722df9a DIST kmod-29.tar.xz 560160 BLAKE2B 1362b6e7c07f66594074f07239d0f7a64e6efeb928483ed027b22a4ac77b916c631d1c03780b0515714a87847a716c35341edb1ced04a1795b4c7f8942d3207a SHA512 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 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 deleted file mode 100644 index dc776b515bc..000 --- a/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -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 -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-r2.ebuild b/sys-apps/kmod/kmod-27-r2.ebuild deleted file mode 100644 index 1f01479f150..000 --- a/sys-apps/kmod/kmod-27-r2.ebuild +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) - -inherit autotools bash-completion-r1 multilib python-r1 - -if [[ ${PV} == * ]]; 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 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" - #inherit libtool -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" - -# 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" - -# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/files/, sys-apps/kmod/
commit: abe3c527bd51c009f61e85e2a86fca60ea3c4f20 Author: Lars Wendler gentoo org> AuthorDate: Fri Jan 8 14:12:00 2021 + Commit: Lars Wendler gentoo org> CommitDate: Fri Jan 8 14:15:20 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abe3c527 sys-apps/kmod: Removed old Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Lars Wendler gentoo.org> sys-apps/kmod/Manifest | 1 - sys-apps/kmod/files/kmod-26-libressl.patch | 143 sys-apps/kmod/kmod-26-r5.ebuild| 201 - 3 files changed, 345 deletions(-) diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest index 010ee9f2330..29b9d69a8f0 100644 --- a/sys-apps/kmod/Manifest +++ b/sys-apps/kmod/Manifest @@ -1,3 +1,2 @@ -DIST kmod-26.tar.xz 552032 BLAKE2B 3e596d06b48599bf4919346475a036b058fb18a7b19d39953e24fa943b95fdbe34a29a5062f6b4fe3510e667ae873d3b9ae03b72350fa85ddbb40ca6a7730b34 SHA512 3ca276c6fc13c2dd2220ec528b8dc4ab4edee5d2b22e16b6f945c552e51f74342c01c33a53740e6af8c893d42bd4d6f629cd8fa6e15ef8bd8da30cb003ef0865 DIST kmod-27.tar.xz 548924 BLAKE2B 9f12bf5792d4c867e28e0776c279369c063e84269212e3f699ae6e5e69b8b2b466b5033e43e17ac64d6101592edcf3c34881916afb6ae676b49dc8838dfe1396 SHA512 e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c DIST kmod-28.tar.xz 552448 BLAKE2B af41a0c5681fb94eb5264f46ed2ae666d171d4e2d0dc21419a3c2f4b12a783350a06b408fb02a7afb00fcea1cd994ee35864c1ec8b7a8cc58a8c9dcdeffaf1b3 SHA512 50646dc72675a5e17b01e327e3d41b972f18aaeac20c8b00983c4d099c6218f35c32c184a833a2d7f716755d6a86851c90913d2835874cef933bdc4a9722df9a diff --git a/sys-apps/kmod/files/kmod-26-libressl.patch b/sys-apps/kmod/files/kmod-26-libressl.patch deleted file mode 100644 index cb36ab401c2..000 --- a/sys-apps/kmod/files/kmod-26-libressl.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 628677e066198d8658d7edd5511a5bb27cd229f5 Mon Sep 17 00:00:00 2001 -From: Stefan Strogin -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 - 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 - #include - #ifdef ENABLE_OPENSSL --#include -+#include - #include - #endif - #include -@@ -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); -