summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-01-29 10:58:11 +0100
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2024-01-30 12:08:45 +0100
commitb1f74da11016a3c872f250983cd5f9d06f181708 (patch)
tree7c3d5de2bda8de19707298e39657fee787cf5539
parentdev-vcs/git-filter-repo: disable py3.9 (diff)
downloadgentoo-b1f74da11016a3c872f250983cd5f9d06f181708.tar.gz
gentoo-b1f74da11016a3c872f250983cd5f9d06f181708.tar.bz2
gentoo-b1f74da11016a3c872f250983cd5f9d06f181708.zip
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 <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/35066 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
-rw-r--r--eclass/linux-mod-r1.eclass20
1 files changed, 19 insertions, 1 deletions
diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass
index 67a4b64eb481..8d384c2b30c8 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