From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 810AC15838C for ; Tue, 30 Jan 2024 22:41:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2E0692BC088; Tue, 30 Jan 2024 22:41:44 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D96932BC084 for ; Tue, 30 Jan 2024 22:41:43 +0000 (UTC) Message-ID: <1f42cb12-ecfc-4aab-8597-78563a3fddf9@gentoo.org> Date: Tue, 30 Jan 2024 17:41:40 -0500 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [gentoo-dev] [PATCH] linux-mod-r1.eclass: warn if KV does not match virtual/dist-kernel To: gentoo-dev@lists.gentoo.org References: <7acfff74-c267-4215-9913-55dd0aab0b20@gentoo.org> Content-Language: en-US From: Mike Pagano In-Reply-To: <7acfff74-c267-4215-9913-55dd0aab0b20@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Archives-Salt: ad17907d-7fa5-4680-90e1-7063a24046cd X-Archives-Hash: 29dae1e4e3be3c38cbb6e88d85785e76 On 1/30/24 06:07, Andrew Ammerlaan wrote: > From 3a3a69379650af341fa318d8f2d1533885b52d0e Mon Sep 17 00:00:00 2001 > From: Andrew Ammerlaan > Date: Mon, 29 Jan 2024 10:58:11 +0100 > Subject: [PATCH] linux-mod-r1.eclass: warn if KV does not match >  virtual/dist-kernel > > We have no mechanism to ensure that we build the kernel modules for > the same kernel version as the version we will record in the > virtual/dist-kernel > subslot dependency. This does not fix this problem, but it does add a > warning > to ensure users are aware that, for example, built binpkgs are going to > have > wrong dependency metadata. > > Bug: https://bugs.gentoo.org/923025 > Signed-off-by: Andrew Ammerlaan > --- >  eclass/linux-mod-r1.eclass | 20 +++++++++++++++++++- >  1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass > index 67a4b64eb4815..8d384c2b30c88 100644 > --- a/eclass/linux-mod-r1.eclass > +++ b/eclass/linux-mod-r1.eclass > @@ -1,4 +1,4 @@ > -# Copyright 2023 Gentoo Authors > +# Copyright 2023-2024 Gentoo Authors >  # Distributed under the terms of the GNU General Public License v2 > >  # @ECLASS: linux-mod-r1.eclass > @@ -650,6 +650,24 @@ _modules_prepare_kernel() { >      fi > >      linux-info_pkg_setup > + > +    if use dist-kernel && > +        ! has_version > "~virtual/dist-kernel-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" > +    then > +        ewarn > +        ewarn "The kernel modules in ${CATEGORY}/${PN} are being built > for" > +        ewarn "kernel version ${KV_FULL}. But this does not match the" > +        ewarn "installed version of virtual/dist-kernel." > +        ewarn > +        ewarn "If this is not intentional, the problem may be corrected > by" > +        ewarn "using \"eselect kernel\" to set the default kernel > version to" > +        ewarn "the same version as the installed version of > virtual/dist-kernel." > +        ewarn > +        ewarn "If the distribution kernel is being downgraded, ensure > that" > +        ewarn "virtual/dist-kernel is also downgraded to the same version" > +        ewarn "before rebuilding external kernel modules." > +        ewarn > +    fi >  } > >  # @FUNCTION: _modules_prepare_sign > LGTM -- Mike Pagano Gentoo Developer - Kernel Project E-Mail : mpagano@gentoo.org GnuPG FP : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137 Public Key : http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index