commit: 582a2c2f0756c68d4a51be7a4f408eb71d5797a6
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri May 23 09:40:55 2025 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Jun 5 10:55:07 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=582a2c2f
linux-info.eclass: Don't try to read KBUILD_OUTPUT from the Makefile
This code originates from 21 years ago, but I don't think it ever made
sense. KBUILD_OUTPUT was never written anywhere until last year. Now it
is written to the Makefile in the output directory, which is what we're
trying to locate in the first place!
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
eclass/linux-info.eclass | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index c395eca9ee85..067c94ccdc1f 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -464,25 +464,6 @@ kernel_is() {
"${1:-${KV_MAJOR:-0}}.${2:-${KV_MINOR:-0}}.${3:-${KV_PATCH:-0}}"
}
-# @FUNCTION: get_makefile_extract_function
-# @INTERNAL
-# @DESCRIPTION:
-# Check if the Makefile is valid for direct parsing.
-# Check status results:
-# - PASS, use 'getfilevar' to extract values
-# - FAIL, use 'getfilevar_noexec' to extract values
-# The check may fail if:
-# - make is not present
-# - corruption exists in the kernel makefile
-get_makefile_extract_function() {
- [[ -n ${SKIP_KERNEL_CHECK} ]] && return
- local a='' b='' mkfunc='getfilevar'
- a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
- b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
- [[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
- echo "${mkfunc}"
-}
-
# @ECLASS_VARIABLE: get_version_warning_done
# @INTERNAL
# @DESCRIPTION:
@@ -567,14 +548,6 @@ get_version() {
# Do we pass KBUILD_OUTPUT on the CLI?
local OUTPUT_DIR=${KBUILD_OUTPUT}
- if [[ -z ${OUTPUT_DIR} ]]; then
- # Decide the function used to extract makefile variables.
- local mkfunc=$(get_makefile_extract_function
"${KERNEL_MAKEFILE}")
-
- # And if we didn't pass it, we can take a nosey in the Makefile.
- OUTPUT_DIR=$(${mkfunc} KBUILD_OUTPUT "${KERNEL_MAKEFILE}")
- fi
-
# And contrary to existing functions, I feel we shouldn't trust the
# directory name to find version information as this seems insane.
# So we parse ${KERNEL_MAKEFILE}.