public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Subject: [gentoo-dev] [PATCH 6/7] linux-info.eclass: respect eselect kernel setting in binpkgs
Date: Tue, 14 May 2024 13:59:11 +0200	[thread overview]
Message-ID: <20240514115924.29167-6-andrewammerlaan@gentoo.org> (raw)
In-Reply-To: <20240514115924.29167-1-andrewammerlaan@gentoo.org>

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 <andrewammerlaan@gentoo.org>
---
 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



  parent reply	other threads:[~2024-05-14 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 11:59 [gentoo-dev] [PATCH 1/7] linux-mod-r1.eclass: add USE=initramfs Andrew Ammerlaan
2024-05-14 11:59 ` [gentoo-dev] [PATCH 2/7] profiles/use.desc: add new global flag "initramfs" Andrew Ammerlaan
2024-05-14 11:59 ` [gentoo-dev] [PATCH 3/7] sys-fs/zfs-kmod: add USE=initramfs, and enable by default Andrew Ammerlaan
2024-05-14 11:59 ` [gentoo-dev] [PATCH 4/7] sys-firmware/intel-microcode: add USE=dist-kernel Andrew Ammerlaan
2024-05-14 11:59 ` [gentoo-dev] [PATCH 5/7] sys-kernel/linux-firmware: " Andrew Ammerlaan
2024-05-14 11:59 ` Andrew Ammerlaan [this message]
2024-05-15 16:02   ` [gentoo-dev] [PATCH 6/7] linux-info.eclass: respect eselect kernel setting in binpkgs Mike Gilbert
2024-05-14 11:59 ` [gentoo-dev] [PATCH 7/7] linux-mod-r1.eclass: do not reset kernel env vars " Andrew Ammerlaan
2024-05-14 12:02   ` [gentoo-dev] [PATCH 0/7] Changes to dracut kernel module/microcode handling Andrew Nowa Ammerlaan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240514115924.29167-6-andrewammerlaan@gentoo.org \
    --to=andrewammerlaan@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox