summaryrefslogtreecommitdiff
path: root/eclass/linux-info.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-04 08:53:53 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-04 08:53:53 +0100
commite3872864be25f7421015bef2732fa57c0c9fb726 (patch)
tree9cb29a544215119b5c5538e37211b994ce1c87ae /eclass/linux-info.eclass
parent480486b52ea64765faf696c88b2c6a26a5a454d4 (diff)
gentoo resync : 04.08.2018
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r--eclass/linux-info.eclass50
1 files changed, 25 insertions, 25 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 6cd64457edd2..b158e345d166 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -548,6 +548,30 @@ get_version() {
return 1
fi
+ # Grab the kernel release from the output directory.
+ # TODO: we MUST detect kernel.release being out of date, and 'return 1' from
+ # this function.
+ if [ -s "${KV_DIR}"/include/config/kernel.release ]; then
+ KV_LOCAL=$(<"${KV_DIR}"/include/config/kernel.release)
+ elif [ -s "${KV_DIR}"/.kernelrelease ]; then
+ KV_LOCAL=$(<"${KV_DIR}"/.kernelrelease)
+ else
+ KV_LOCAL=
+ fi
+
+ # KV_LOCAL currently contains the full release; discard the first bits.
+ tmplocal=${KV_LOCAL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}}
+
+ # If the updated local version was not changed, the tree is not prepared.
+ # Clear out KV_LOCAL in that case.
+ # TODO: this does not detect a change in the localversion part between
+ # kernel.release and the value that would be generated.
+ if [ "$KV_LOCAL" = "$tmplocal" ]; then
+ KV_LOCAL=
+ else
+ KV_LOCAL=$tmplocal
+ fi
+
# and in newer versions we can also pull LOCALVERSION if it is set.
# but before we do this, we need to find if we use a different object directory.
# This *WILL* break if the user is using localversions, but we assume it was
@@ -555,7 +579,7 @@ get_version() {
if [[ -z ${OUTPUT_DIR} ]] ; then
# Try to locate a kernel that is most relevant for us.
for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}" "" ; do
- OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
+ OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}/build"
if [[ -e ${OUTPUT_DIR} ]] ; then
break
fi
@@ -571,30 +595,6 @@ get_version() {
# and if we STILL have not got it, then we better just set it to KV_DIR
KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
- # Grab the kernel release from the output directory.
- # TODO: we MUST detect kernel.release being out of date, and 'return 1' from
- # this function.
- if [ -s "${KV_OUT_DIR}"/include/config/kernel.release ]; then
- KV_LOCAL=$(<"${KV_OUT_DIR}"/include/config/kernel.release)
- elif [ -s "${KV_OUT_DIR}"/.kernelrelease ]; then
- KV_LOCAL=$(<"${KV_OUT_DIR}"/.kernelrelease)
- else
- KV_LOCAL=
- fi
-
- # KV_LOCAL currently contains the full release; discard the first bits.
- tmplocal=${KV_LOCAL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}}
-
- # If the updated local version was not changed, the tree is not prepared.
- # Clear out KV_LOCAL in that case.
- # TODO: this does not detect a change in the localversion part between
- # kernel.release and the value that would be generated.
- if [ "$KV_LOCAL" = "$tmplocal" ]; then
- KV_LOCAL=
- else
- KV_LOCAL=$tmplocal
- fi
-
# And we should set KV_FULL to the full expanded version
KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"