diff options
author | 2018-07-30 01:22:38 +0200 | |
---|---|---|
committer | 2018-07-30 01:23:27 +0200 | |
commit | 50078fbbb3966773401c1fc59838c1e5952c1318 (patch) | |
tree | e7d55aabb5f883dcde5839a1e3d9bd256da4f1c0 /eclass/linux-info.eclass | |
parent | kernel-2.eclass: drop EAPI 0-1 support code (diff) | |
download | gentoo-50078fbbb3966773401c1fc59838c1e5952c1318.tar.gz gentoo-50078fbbb3966773401c1fc59838c1e5952c1318.tar.bz2 gentoo-50078fbbb3966773401c1fc59838c1e5952c1318.zip |
linux-info.eclass: respect kernel CONFIG_LOCALVERSION
Closes: https://bugs.gentoo.org/460996
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r-- | eclass/linux-info.eclass | 50 |
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}" |