commit: 419f11ba911c0136956fdb0aba3d59ff5c1799e1
Author: James Calligeros <jcalligeros99 <AT> gmail <DOT> com>
AuthorDate: Sat Jun 29 03:44:38 2024 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Jul 15 19:17:08 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=419f11ba
kernel-build.eclass: check that KV_FULL matches the kernel release
We want to ensure all our installed directories are consistent and
match the kernel's own idea of its release version. Do an extra
sanity check to ensure that KV_FULL is indeed what it is supposed
to be, and bail out if it isn't.
Signed-off-by: James Calligeros <jcalligeros99 <AT> gmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
eclass/kernel-build.eclass | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 9ddc7793d6e6..d8e50e75812f 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -235,14 +235,22 @@ kernel-build_src_configure() {
cp -pR "${WORKDIR}"/modprep "${WORKDIR}"/build || die
# Now that we have a release file, set KV_FULL
+ local relfile=${WORKDIR}/build/include/config/kernel.release
if [[ -z ${KV_FULL} ]]; then
- local relfile=${WORKDIR}/build/include/config/kernel.release
KV_FULL=$(<"${relfile}") || die
fi
# Make sure we are about to build the correct kernel
if [[ ${PV} != *9999 ]]; then
local expected_ver=$(dist-kernel_PV_to_KV "${PV}")
+ local expected_rel=$(<"${relfile}")
+
+ if [[ ${KV_FULL} != ${expected_rel} ]]; then
+ eerror "KV_FULL mismatch!"
+ eerror "KV_FULL: ${KV_FULL}"
+ eerror "Expected: ${expected_rel}"
+ die "KV_FULL mismatch: got ${KV_FULL}, expected
${expected_rel}"
+ fi
if [[ ${KV_FULL} != ${expected_ver}* ]]; then
eerror "Kernel version does not match PV!"