[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/

2024-03-01 Thread Sam James
commit: bc235c9a342826e6aab77d08ded3ca008823dd28
Author: Sam James  gentoo  org>
AuthorDate: Sat Mar  2 00:16:07 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Mar  2 00:16:07 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc235c9a

sys-apps/kmod: drop 30-r1

Signed-off-by: Sam James  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..
--- 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 
-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
deleted file mode 100644
index 5dff1407325b..
--- 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} == * ]]; 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-build/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
- 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/

2020-09-03 Thread Thomas Deutschmann
commit: 4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583
Author: Thomas Deutschmann  gentoo  org>
AuthorDate: Wed Sep  2 23:15:16 2020 +
Commit: Thomas Deutschmann  gentoo  org>
CommitDate: Thu Sep  3 14:16:38 2020 +
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  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 000..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 
+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-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
 



[gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/

2019-06-10 Thread Thomas Deutschmann
commit: fb2edfa0a5001ed4e3cdc406b6bcd9bb4fb1c6cb
Author: Stefan Strogin  gentoo  org>
AuthorDate: Wed May 29 15:36:08 2019 +
Commit: Thomas Deutschmann  gentoo  org>
CommitDate: Mon Jun 10 13:34:47 2019 +
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  gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/11146
Signed-off-by: Thomas Deutschmann  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 000..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 
+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);
+   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, _id, , );
+-  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, _alg, _alg);
++  PKCS7_SIGNER_INFO_get0_algs(si, NULL, _alg, _alg);
+ 
+   sig_info->sig = (const char *)ASN1_STRING_get0_data(sig);
+