summaryrefslogtreecommitdiff
path: root/eclass/linux-info.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-16 22:05:01 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-16 22:05:01 +0100
commitcc4618c9ba3d974948ebf340b542d8cb01db2f55 (patch)
tree125ee67bb9e0d548771cf7b61d04bb1f0dc57687 /eclass/linux-info.eclass
parent677b7ba5c317778df2ad7e70df94b9b7eec4adbc (diff)
gentoo resync : 16.09.2021
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r--eclass/linux-info.eclass50
1 files changed, 22 insertions, 28 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 4e08949a3854..9eae5ad589bb 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -205,9 +205,10 @@ getfilevar() {
# We use nonfatal because we want the caller to take care of things #373151
# Pass need-config= to make to avoid config check in kernel Makefile.
+ # Pass dot-config=0 to avoid the config check in kernels prior to 5.4.
[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
- nonfatal emake -C "${basedname}" M="${T}" need-config= ${BUILD_FIXES} -s -f - 2>/dev/null
+ nonfatal emake -C "${basedname}" M="${T}" dot-config=0 need-config= ${BUILD_FIXES} -s -f - 2>/dev/null
ARCH=${myARCH}
fi
@@ -629,34 +630,27 @@ get_running_version() {
die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
fi
- KV_FULL=$(uname -r)
-
- if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
- KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
- unset KV_FULL
- get_version
- return $?
- elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
- unset KV_FULL
- get_version
- return $?
- elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
- unset KV_FULL
- get_version
- return $?
- else
- # This handles a variety of weird kernel versions. Make sure to update
- # tests/linux-info_get_running_version.sh if you want to change this.
- local kv_full=${KV_FULL//[-+_]*}
- KV_MAJOR=$(ver_cut 1 ${kv_full})
- KV_MINOR=$(ver_cut 2 ${kv_full})
- KV_PATCH=$(ver_cut 3 ${kv_full})
- KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
- : ${KV_PATCH:=0}
+ local kv=$(uname -r)
+
+ if [[ -f ${ROOT%/}/lib/modules/${kv}/source/Makefile ]]; then
+ KERNEL_DIR=$(readlink -f "${ROOT%/}/lib/modules/${kv}/source")
+ if [[ -f ${ROOT%/}/lib/modules/${kv}/build/Makefile ]]; then
+ KBUILD_OUTPUT=$(readlink -f "${ROOT%/}/lib/modules/${kv}/build")
+ fi
+ get_version && return 0
fi
+
+ KV_FULL=${kv}
+
+ # This handles a variety of weird kernel versions. Make sure to update
+ # tests/linux-info_get_running_version.sh if you want to change this.
+ local kv_full=${KV_FULL//[-+_]*}
+ KV_MAJOR=$(ver_cut 1 ${kv_full})
+ KV_MINOR=$(ver_cut 2 ${kv_full})
+ KV_PATCH=$(ver_cut 3 ${kv_full})
+ KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
+ : ${KV_PATCH:=0}
+
return 0
}