Gentoo Archives: gentoo-commits

From: Stefan Strogin <steils@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: sys-apps/kmod/files/, sys-apps/kmod/
Date: Fri, 22 May 2020 01:57:24
Message-Id: 1590111039.beb90d89c3e106d0e94b8c35bf3e424e95961c79.steils@gentoo
1 commit: beb90d89c3e106d0e94b8c35bf3e424e95961c79
2 Author: Stefan Strogin <steils <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 22 01:30:39 2020 +0000
4 Commit: Stefan Strogin <steils <AT> gentoo <DOT> org>
5 CommitDate: Fri May 22 01:30:39 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=beb90d89
7
8 sys-apps/kmod: drop; fixed in gentoo.git
9
10 Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>
11
12 sys-apps/kmod/Manifest | 1 -
13 sys-apps/kmod/files/kmod-26-libressl.patch | 186 ---------------------------
14 sys-apps/kmod/files/kmod-static-nodes-r1 | 18 ---
15 sys-apps/kmod/kmod-26-r1.ebuild | 200 -----------------------------
16 sys-apps/kmod/metadata.xml | 9 --
17 5 files changed, 414 deletions(-)
18
19 diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
20 deleted file mode 100644
21 index 3f2e6db..0000000
22 --- a/sys-apps/kmod/Manifest
23 +++ /dev/null
24 @@ -1 +0,0 @@
25 -DIST kmod-26.tar.xz 552032 BLAKE2B 3e596d06b48599bf4919346475a036b058fb18a7b19d39953e24fa943b95fdbe34a29a5062f6b4fe3510e667ae873d3b9ae03b72350fa85ddbb40ca6a7730b34 SHA512 3ca276c6fc13c2dd2220ec528b8dc4ab4edee5d2b22e16b6f945c552e51f74342c01c33a53740e6af8c893d42bd4d6f629cd8fa6e15ef8bd8da30cb003ef0865
26
27 diff --git a/sys-apps/kmod/files/kmod-26-libressl.patch b/sys-apps/kmod/files/kmod-26-libressl.patch
28 deleted file mode 100644
29 index 7d70ed2..0000000
30 --- a/sys-apps/kmod/files/kmod-26-libressl.patch
31 +++ /dev/null
32 @@ -1,186 +0,0 @@
33 -From fd8b59fb8c576751aef6d59dd5ab208baee2ad49 Mon Sep 17 00:00:00 2001
34 -From: Stefan Strogin <stefan.strogin@×××××.com>
35 -Date: Fri, 15 Feb 2019 05:34:55 +0200
36 -Subject: [PATCH] libkmod-signature: use PKCS7 for LibreSSL or older OpenSSL
37 -
38 -Linux kernel uses either PKCS #7 or CMS signing modules (scripts/sign-file.c).
39 -CMS is not supported by LibreSSL, PKCS #7 is used instead.
40 -For now modinfo used CMS with no altenative requiring >=openssl-1.1.0
41 -built with CMS support.
42 -
43 -Use PKCS #7 for parsing module signature information when CMS is not available.
44 -
45 -Upstream-Status: Submitted [https://patchwork.kernel.org/patch/10814147/]
46 -Signed-off-by: Stefan Strogin <stefan.strogin@×××××.com>
47 ----
48 - libkmod/libkmod-signature.c | 78 +++++++++++++++++++++++++++++++++++--
49 - 1 file changed, 75 insertions(+), 3 deletions(-)
50 -
51 -diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
52 -index 48d0145..aa2a60e 100644
53 ---- a/libkmod/libkmod-signature.c
54 -+++ b/libkmod/libkmod-signature.c
55 -@@ -20,9 +20,16 @@
56 - #include <endian.h>
57 - #include <inttypes.h>
58 - #ifdef ENABLE_OPENSSL
59 --#include <openssl/cms.h>
60 --#include <openssl/ssl.h>
61 --#endif
62 -+# include <openssl/ssl.h>
63 -+# if defined(LIBRESSL_VERSION_NUMBER) || \
64 -+ OPENSSL_VERSION_NUMBER < 0x10100000L || \
65 -+ defined(OPENSSL_NO_CMS)
66 -+# define USE_PKCS7
67 -+# include <openssl/pkcs7.h>
68 -+# else
69 -+# include <openssl/cms.h>
70 -+# endif /* LIBRESSL_VERSION_NUMBER */
71 -+#endif /* ENABLE_OPENSSL */
72 - #include <stdio.h>
73 - #include <stdlib.h>
74 - #include <string.h>
75 -@@ -122,7 +129,11 @@ static bool fill_default(const char *mem, off_t size,
76 - #ifdef ENABLE_OPENSSL
77 -
78 - struct pkcs7_private {
79 -+#ifndef USE_PKCS7
80 - CMS_ContentInfo *cms;
81 -+#else
82 -+ PKCS7 *pkcs7;
83 -+#endif
84 - unsigned char *key_id;
85 - BIGNUM *sno;
86 - };
87 -@@ -132,7 +143,11 @@ static void pkcs7_free(void *s)
88 - struct kmod_signature_info *si = s;
89 - struct pkcs7_private *pvt = si->private;
90 -
91 -+#ifndef USE_PKCS7
92 - CMS_ContentInfo_free(pvt->cms);
93 -+#else
94 -+ PKCS7_free(pvt->pkcs7);
95 -+#endif
96 - BN_free(pvt->sno);
97 - free(pvt->key_id);
98 - free(pvt);
99 -@@ -187,7 +202,13 @@ static const char *x509_name_to_str(X509_NAME *name)
100 - return NULL;
101 -
102 - d = X509_NAME_ENTRY_get_data(e);
103 -+#if (defined(LIBRESSL_VERSION_NUMBER) && \
104 -+ LIBRESSL_VERSION_NUMBER < 0x20700000L) || \
105 -+ OPENSSL_VERSION_NUMBER < 0x10100000L
106 -+ str = (const char *)ASN1_STRING_data(d);
107 -+#else
108 - str = (const char *)ASN1_STRING_get0_data(d);
109 -+#endif
110 -
111 - return str;
112 - }
113 -@@ -197,11 +218,18 @@ static bool fill_pkcs7(const char *mem, off_t size,
114 - struct kmod_signature_info *sig_info)
115 - {
116 - const char *pkcs7_raw;
117 -+#ifndef USE_PKCS7
118 - CMS_ContentInfo *cms;
119 - STACK_OF(CMS_SignerInfo) *sis;
120 - CMS_SignerInfo *si;
121 - int rc;
122 - ASN1_OCTET_STRING *key_id;
123 -+#else
124 -+ PKCS7 *pkcs7;
125 -+ STACK_OF(PKCS7_SIGNER_INFO) *sis;
126 -+ PKCS7_SIGNER_INFO *si;
127 -+ PKCS7_ISSUER_AND_SERIAL *is;
128 -+#endif
129 - X509_NAME *issuer;
130 - ASN1_INTEGER *sno;
131 - ASN1_OCTET_STRING *sig;
132 -@@ -220,14 +248,23 @@ static bool fill_pkcs7(const char *mem, off_t size,
133 -
134 - in = BIO_new_mem_buf(pkcs7_raw, sig_len);
135 -
136 -+#ifndef USE_PKCS7
137 - cms = d2i_CMS_bio(in, NULL);
138 - if (cms == NULL) {
139 - BIO_free(in);
140 - return false;
141 - }
142 -+#else
143 -+ pkcs7 = d2i_PKCS7_bio(in, NULL);
144 -+ if (pkcs7 == NULL) {
145 -+ BIO_free(in);
146 -+ return false;
147 -+ }
148 -+#endif
149 -
150 - BIO_free(in);
151 -
152 -+#ifndef USE_PKCS7
153 - sis = CMS_get0_SignerInfos(cms);
154 - if (sis == NULL)
155 - goto err;
156 -@@ -245,8 +282,35 @@ static bool fill_pkcs7(const char *mem, off_t size,
157 - goto err;
158 -
159 - CMS_SignerInfo_get0_algs(si, NULL, NULL, &dig_alg, &sig_alg);
160 -+#else
161 -+ sis = PKCS7_get_signer_info(pkcs7);
162 -+ if (sis == NULL)
163 -+ goto err;
164 -+
165 -+ si = sk_PKCS7_SIGNER_INFO_value(sis, 0);
166 -+ if (si == NULL)
167 -+ goto err;
168 -+
169 -+ is = si->issuer_and_serial;
170 -+ if (is == NULL)
171 -+ goto err;
172 -+ issuer = is->issuer;
173 -+ sno = is->serial;
174 -+
175 -+ sig = si->enc_digest;
176 -+ if (sig == NULL)
177 -+ goto err;
178 -+
179 -+ PKCS7_SIGNER_INFO_get0_algs(si, NULL, &dig_alg, &sig_alg);
180 -+#endif
181 -
182 -+#if (defined(LIBRESSL_VERSION_NUMBER) && \
183 -+ LIBRESSL_VERSION_NUMBER < 0x20700000L) || \
184 -+ OPENSSL_VERSION_NUMBER < 0x10100000L
185 -+ sig_info->sig = (const char *)ASN1_STRING_data(sig);
186 -+#else
187 - sig_info->sig = (const char *)ASN1_STRING_get0_data(sig);
188 -+#endif
189 - sig_info->sig_len = ASN1_STRING_length(sig);
190 -
191 - sno_bn = ASN1_INTEGER_to_BN(sno, NULL);
192 -@@ -277,7 +341,11 @@ static bool fill_pkcs7(const char *mem, off_t size,
193 - if (pvt == NULL)
194 - goto err3;
195 -
196 -+#ifndef USE_PKCS7
197 - pvt->cms = cms;
198 -+#else
199 -+ pvt->pkcs7 = pkcs7;
200 -+#endif
201 - pvt->key_id = key_id_str;
202 - pvt->sno = sno_bn;
203 - sig_info->private = pvt;
204 -@@ -290,7 +358,11 @@ err3:
205 - err2:
206 - BN_free(sno_bn);
207 - err:
208 -+#ifndef USE_PKCS7
209 - CMS_ContentInfo_free(cms);
210 -+#else
211 -+ PKCS7_free(pkcs7);
212 -+#endif
213 - return false;
214 - }
215 -
216 ---
217 -2.20.1
218 -
219
220 diff --git a/sys-apps/kmod/files/kmod-static-nodes-r1 b/sys-apps/kmod/files/kmod-static-nodes-r1
221 deleted file mode 100644
222 index 9362f28..0000000
223 --- a/sys-apps/kmod/files/kmod-static-nodes-r1
224 +++ /dev/null
225 @@ -1,18 +0,0 @@
226 -#!/sbin/openrc-run
227 -# Copyright 1999-2019 Gentoo Authors
228 -# Distributed under the terms of the GNU General Public License v2
229 -
230 -description="Create list of required static device nodes for the current kernel"
231 -
232 -depend() {
233 - after dev-mount
234 - before tmpfiles.dev dev
235 - keyword -lxc -systemd-nspawn
236 -}
237 -
238 -start() {
239 - ebegin "Creating list of required static device nodes for the current kernel"
240 - checkpath -q -d /run/tmpfiles.d
241 - kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
242 - eend $?
243 -}
244
245 diff --git a/sys-apps/kmod/kmod-26-r1.ebuild b/sys-apps/kmod/kmod-26-r1.ebuild
246 deleted file mode 100644
247 index 2752b85..0000000
248 --- a/sys-apps/kmod/kmod-26-r1.ebuild
249 +++ /dev/null
250 @@ -1,200 +0,0 @@
251 -# Copyright 1999-2019 Gentoo Authors
252 -# Distributed under the terms of the GNU General Public License v2
253 -
254 -EAPI=6
255 -
256 -PYTHON_COMPAT=( python{2_7,3_{4,5,6,7}} )
257 -
258 -inherit bash-completion-r1 multilib python-r1
259 -
260 -if [[ ${PV} == 9999* ]]; then
261 - EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
262 - inherit autotools git-r3
263 -else
264 - SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz"
265 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
266 - inherit libtool
267 -fi
268 -
269 -DESCRIPTION="library and tools for managing linux kernel modules"
270 -HOMEPAGE="https://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
271 -
272 -LICENSE="LGPL-2"
273 -SLOT="0"
274 -IUSE="debug doc libressl lzma python ssl static-libs +tools zlib"
275 -
276 -# Upstream does not support running the test suite with custom configure flags.
277 -# I was also told that the test suite is intended for kmod developers.
278 -# So we have to restrict it.
279 -# See bug #408915.
280 -RESTRICT="test"
281 -
282 -# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
283 -RDEPEND="!sys-apps/module-init-tools
284 - !sys-apps/modutils
285 - !<sys-apps/openrc-0.13.8
286 - !<sys-apps/systemd-216-r3
287 - lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
288 - python? ( ${PYTHON_DEPS} )
289 - ssl? (
290 - !libressl? ( >=dev-libs/openssl-1.1.0:0= )
291 - libressl? ( dev-libs/libressl:0= )
292 - )
293 - zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
294 -DEPEND="${RDEPEND}
295 - doc? ( dev-util/gtk-doc )
296 - lzma? ( virtual/pkgconfig )
297 - python? (
298 - dev-python/cython[${PYTHON_USEDEP}]
299 - virtual/pkgconfig
300 - )
301 - zlib? ( virtual/pkgconfig )"
302 -if [[ ${PV} == 9999* ]]; then
303 - DEPEND="${DEPEND}
304 - dev-libs/libxslt"
305 -fi
306 -
307 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
308 -
309 -DOCS="NEWS README TODO"
310 -
311 -PATCHES=(
312 - "${FILESDIR}/${P}-libressl.patch" # bug 677960
313 -)
314 -
315 -src_prepare() {
316 - default
317 -
318 - if [[ ! -e configure ]] ; then
319 - if use doc; then
320 - gtkdocize --copy --docdir libkmod/docs || die
321 - else
322 - touch libkmod/docs/gtk-doc.make
323 - fi
324 - eautoreconf
325 - else
326 - elibtoolize
327 - fi
328 -
329 - # Restore possibility of running --enable-static wrt #472608
330 - sed -i \
331 - -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
332 - configure || die
333 -}
334 -
335 -src_configure() {
336 - local myeconfargs=(
337 - --bindir="${EPREFIX}/bin"
338 - --enable-shared
339 - --with-bashcompletiondir="$(get_bashcompdir)"
340 - --with-rootlibdir="${EPREFIX}/$(get_libdir)"
341 - $(use_enable debug)
342 - $(use_enable doc gtk-doc)
343 - $(use_enable static-libs static)
344 - $(use_enable tools)
345 - $(use_with lzma xz)
346 - $(use_with ssl openssl)
347 - $(use_with zlib)
348 - )
349 -
350 - local ECONF_SOURCE="${S}"
351 -
352 - kmod_configure() {
353 - mkdir -p "${BUILD_DIR}" || die
354 - run_in_build_dir econf "${myeconfargs[@]}" "$@"
355 - }
356 -
357 - BUILD_DIR="${WORKDIR}/build"
358 - kmod_configure --disable-python
359 -
360 - if use python; then
361 - python_foreach_impl kmod_configure --enable-python
362 - fi
363 -}
364 -
365 -src_compile() {
366 - emake -C "${BUILD_DIR}"
367 -
368 - if use python; then
369 - local native_builddir=${BUILD_DIR}
370 -
371 - python_compile() {
372 - emake -C "${BUILD_DIR}" -f Makefile -f - python \
373 - VPATH="${native_builddir}:${S}" \
374 - native_builddir="${native_builddir}" \
375 - libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
376 - <<< 'python: $(pkgpyexec_LTLIBRARIES)'
377 - }
378 -
379 - python_foreach_impl python_compile
380 - fi
381 -}
382 -
383 -src_install() {
384 - emake -C "${BUILD_DIR}" DESTDIR="${D}" install
385 - einstalldocs
386 -
387 - if use python; then
388 - local native_builddir=${BUILD_DIR}
389 -
390 - python_install() {
391 - emake -C "${BUILD_DIR}" DESTDIR="${D}" \
392 - VPATH="${native_builddir}:${S}" \
393 - install-pkgpyexecLTLIBRARIES \
394 - install-dist_pkgpyexecPYTHON
395 - }
396 -
397 - python_foreach_impl python_install
398 - fi
399 -
400 - find "${ED}" -name "*.la" -delete || die
401 -
402 - if use tools; then
403 - local bincmd sbincmd
404 - for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
405 - dosym ../bin/kmod /sbin/${sbincmd}
406 - done
407 -
408 - # These are also usable as normal user
409 - for bincmd in lsmod modinfo; do
410 - dosym kmod /bin/${bincmd}
411 - done
412 - fi
413 -
414 - cat <<-EOF > "${T}"/usb-load-ehci-first.conf
415 - softdep uhci_hcd pre: ehci_hcd
416 - softdep ohci_hcd pre: ehci_hcd
417 - EOF
418 -
419 - insinto /lib/modprobe.d
420 - doins "${T}"/usb-load-ehci-first.conf #260139
421 -
422 - newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
423 -}
424 -
425 -pkg_postinst() {
426 - if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
427 - ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
428 - rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
429 - fi
430 -
431 - # Add kmod to the runlevel automatically if this is the first install of this package.
432 - if [[ -z ${REPLACING_VERSIONS} ]]; then
433 - if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
434 - mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
435 - fi
436 - if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
437 - ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
438 - fi
439 - fi
440 -
441 - if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
442 - if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
443 - ewarn
444 - ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
445 - ewarn "kernel modules to have required static nodes!"
446 - ewarn "Run this command:"
447 - ewarn "\trc-update add kmod-static-nodes sysinit"
448 - fi
449 - fi
450 -}
451
452 diff --git a/sys-apps/kmod/metadata.xml b/sys-apps/kmod/metadata.xml
453 deleted file mode 100644
454 index 4379966..0000000
455 --- a/sys-apps/kmod/metadata.xml
456 +++ /dev/null
457 @@ -1,9 +0,0 @@
458 -<?xml version="1.0" encoding="UTF-8"?>
459 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
460 -<pkgmetadata>
461 -<use>
462 - <flag name="lzma">Enable support for XZ compressed modules</flag>
463 - <flag name="tools">Install module loading/unloading tools.</flag>
464 - <flag name="zlib">Enable support for gzipped modules</flag>
465 -</use>
466 -</pkgmetadata>