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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EEDAE1581D3 for ; Tue, 14 May 2024 12:01:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 364DFE2A32; Tue, 14 May 2024 11:59: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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CDFA8E2A2B for ; Tue, 14 May 2024 11:59:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 185F933D9AD; Tue, 14 May 2024 11:59:43 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Flag: NO X-Spam-Score: -1.119 X-Spam-Level: X-Spam-Status: No, score=-1.119 tagged_above=-9999 required=3.5 tests=[AWL=0.000, BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.001, SPF_HELO_FAIL=0.001, SPF_NEUTRAL=0.779] autolearn=no autolearn_force=no Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CqSKhct_IN7C; Tue, 14 May 2024 11:59:37 +0000 (UTC) Received: from andrew-gentoo-laptop.science.ru.nl (n036122.science.ru.nl [131.174.36.122]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 666AB340BEF; Tue, 14 May 2024 11:59:36 +0000 (UTC) From: Andrew Ammerlaan To: gentoo-dev@lists.gentoo.org Cc: Andrew Ammerlaan Subject: [gentoo-dev] [PATCH 6/7] linux-info.eclass: respect eselect kernel setting in binpkgs Date: Tue, 14 May 2024 13:59:11 +0200 Message-ID: <20240514115924.29167-6-andrewammerlaan@gentoo.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514115924.29167-1-andrewammerlaan@gentoo.org> References: <20240514115924.29167-1-andrewammerlaan@gentoo.org> 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 Content-Transfer-Encoding: 8bit X-Archives-Salt: b45d1ec0-4f06-48e8-8b60-e1d9d65b1a46 X-Archives-Hash: 89dfdf0b51ef66cc5224115a95b81fff Commit f51cd5b64c14ddfb83488a12d538c66a4a309376 resets kernel environment variables when binpkgs are merged, this makes sense since we care about the system that the binpkg will be installed on, not the system the binpkg was built on. This introduced Bug 931213 as a side-effect, which will be fixed in a separate commit to linux-mod-r1.eclass. In preparation of that, we document and rename the LINUX_INFO_BINARY_RESET to SKIP_KERNEL_BINPKG_ENV_RESET. However, commit f51cd5b64c14ddfb83488a12d538c66a4a309376 also makes binpkgs always use the running kernel version. This behaviour is surprising and confusing. In principle the 'eselect kernel' setting should still be respected when binpkgs are used. Bug: https://bugs.gentoo.org/926063 Bug: https://bugs.gentoo.org/931213 Signed-off-by: Andrew Ammerlaan --- eclass/linux-info.eclass | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 864594f607ca..9449a6359d2a 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -158,6 +158,14 @@ KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}" # This is a user flag and should under _no circumstances_ be set in the ebuild. : "${SKIP_KERNEL_CHECK:=""}" +# @ECLASS_VARIABLE: SKIP_KERNEL_BINPKG_ENV_RESET +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, do not reset the kernel environment variables when merging a package +# as a binpkg. +# Main use-case is for kernel modules, i.e. linux-mod-r1.eclass. +# This should be set before running linux-info_pkg_setup + # And to ensure all the weirdness with crosscompile inherit toolchain-funcs [[ ${EAPI} == 6 ]] && inherit eapi7-ver @@ -696,12 +704,12 @@ linux-info_get_any_version() { die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" fi - if [[ ${MERGE_TYPE} == binary && -z ${LINUX_INFO_BINARY_RESET} ]]; then + if [[ ${MERGE_TYPE} == binary && -z ${SKIP_KERNEL_BINPKG_ENV_RESET} ]]; then unset KV_FULL _LINUX_CONFIG_EXISTS_DONE KV_OUT_DIR - LINUX_INFO_BINARY_RESET=1 + SKIP_KERNEL_BINPKG_ENV_RESET=1 fi - if [[ ${MERGE_TYPE} != binary ]] && ! get_version; then + if ! get_version; then ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version" fi -- 2.45.0