Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 212562 Details for
Bug 87242
linux-info.eclass: unable to find kernel version - SUBLEVEL and EXTRAVERSION not present when using KBUILD_OUTPUT
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against linux-info.eclass v1.73 (as of 2009-12-09)
linux-info.eclass-20091209.patch (text/plain), 5.83 KB, created by
Bruno
on 2009-12-09 18:46:34 UTC
(
hide
)
Description:
Patch against linux-info.eclass v1.73 (as of 2009-12-09)
Filename:
MIME Type:
Creator:
Bruno
Created:
2009-12-09 18:46:34 UTC
Size:
5.83 KB
patch
obsolete
>--- portage/eclass/linux-info.eclass 2009-10-11 12:48:33.000000000 +0100 >+++ portage/eclass/linux-info.eclass 2009-12-09 19:19:59.000000000 +0100 >@@ -155,6 +155,7 @@ qout() { > } > > qeinfo() { qout einfo "${@}" ; } >+qewarn() { qout ewarn "$@" ; } > qeerror() { qout eerror "${@}" ; } > > # File Functions >@@ -215,7 +216,7 @@ getfilevar_noexec() { > else > ${mycat} "${2}" | \ > sed -n \ >- -e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{ >+ -e "/^[[:space:]]*${1}[[:space:]]*:\\?=[[:space:]]*\(.*\)\$/{ > s,^[^=]*[[:space:]]*=[[:space:]]*,,g ; > s,[[:space:]]*\$,,g ; > p >@@ -404,6 +405,45 @@ get_localversion() { > # internal variable, so we know to only print the warning once > get_version_warning_done= > >+check_kbuild_output() { >+ if [ ! -s "${KBUILD_OUTPUT}/Makefile" ]; then >+ if [ -z "${get_version_warning_done}" ]; then >+ get_version_warning_done=1 >+ qeerror "Could not find a Makefile in the kernel build directory." >+ qeerror "Please ensure that ${KBUILD_OUTPUT} points to an initialized" >+ qeerror "kernel output directory." >+ fi >+ return 1 >+ else >+ local make_args="$(getfilevar MAKEARGS ${KBUILD_OUTPUT}/Makefile)" >+ if [ -n "${make_args}" ]; then >+ # 2.6.25 or more recent Makefile of KBUILD_OUTPUT >+ [ -z "${get_version_warning_done}" ] && \ >+ qeinfo "This KBUILD_OUTPUT makefile looks like 2.6.25 or more recent format" >+ OUTPUT_DIR=$(echo ${make_args} | sed -r -e 's:^(.* )?O=([^ ]*)/\.( .*)?$:\2:') >+ KV_DIR=$(echo ${make_args} | sed -r -e 's:^(.* )?-C ([^ ]*)/? .*$:\2:') >+ else >+ # Attempt vars as in KBUILD_OUTPUT Makefile of older kernels >+ OUTPUT_DIR="$(getfilevar_noexec KERNELOUTPUT ${KBUILD_OUTPUT}/Makefile)" >+ KV_DIR="$(getfilevar_noexec KERNELSRC ${KBUILD_OUTPUT}/Makefile)" >+ fi >+ if [ -z "${KV_DIR}" ] && [ -n "$(getfilevar_noexec SUBLEVEL ${KBUILD_OUTPUT}/Makefile)" ]; then >+ # KBUILD_OUTPUT is the same as KERNEL_DIR >+ OUTPUT_DIR="${KBUILD_OUTPUT}" >+ KV_DIR="${KBUILD_OUTPUT}" >+ elif [ -z "${KV_DIR}" ]; then >+ if [ -z "${get_version_warning_done}" ]; then >+ get_version_warning_done=1 >+ qeerror "Can't figure out anything out of ${KBUILD_OUTPUT}," >+ qeerror "make sure it points to a valid kernel object tree or" >+ qeerror "kernel source tree if you build in tree." >+ fi >+ return 1 >+ fi >+ fi >+ return 0 >+} >+ > # @FUNCTION: get_version > # @DESCRIPTION: > # It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable >@@ -424,13 +464,20 @@ get_version() { > # if we dont know KV_FULL, then we need too. > # make sure KV_DIR isnt set since we need to work it out via KERNEL_DIR > unset KV_DIR >+ unset OUTPUT_DIR > >- # KV_DIR will contain the full path to the sources directory we should use > [ -z "${get_version_warning_done}" ] && \ > qeinfo "Determining the location of the kernel source code" >- [ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})" >- [ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}" > >+ if [ -n "${KBUILD_OUTPUT}" ]; then >+ check_kbuild_output || return 1 >+ fi >+ >+ if [ -z "${KV_DIR}" ]; then >+ # KV_DIR will contain the full path to the sources directory we should use >+ [ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})" >+ [ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}" >+ fi > if [ -z "${KV_DIR}" ] > then > if [ -z "${get_version_warning_done}" ]; then >@@ -456,6 +503,7 @@ get_version() { > if [ ! -s "${KV_DIR}/Makefile" ] > then > if [ -z "${get_version_warning_done}" ]; then >+ echo "${KV_DIR}/Makefile does not exist/is empty" > get_version_warning_done=1 > qeerror "Could not find a Makefile in the kernel source directory." > qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources" >@@ -463,16 +511,6 @@ get_version() { > return 1 > fi > >- # OK so now we know our sources directory, but they might be using >- # KBUILD_OUTPUT, and we need this for .config and localversions-* >- # so we better find it eh? >- # do we pass KBUILD_OUTPUT on the CLI? >- OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}" >- >- # And if we didn't pass it, we can take a nosey in the Makefile >- kbuild_output="$(getfilevar_noexec KBUILD_OUTPUT ${KV_DIR}/Makefile)" >- OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}" >- > # 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 ${KV_DIR}/Makefile >@@ -481,6 +519,21 @@ get_version() { > KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)" > KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)" > >+ if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]; then >+ qewarn "It was not a kernel source directory, checking as kernel object directory" >+ KBUILD_OUTPUT=${KV_DIR} >+ if check_kbuild_output; then >+ if [ -z "${get_version_warning_done}" ]; then >+ qeinfo "Found kernel source directory:" >+ qeinfo " ${KV_DIR}" >+ fi >+ >+ KV_MAJOR="$(getfilevar_noexec VERSION ${KV_DIR}/Makefile)" >+ KV_MINOR="$(getfilevar_noexec PATCHLEVEL ${KV_DIR}/Makefile)" >+ KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)" >+ KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)" >+ fi >+ fi > if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ] > then > if [ -z "${get_version_warning_done}" ]; then >@@ -489,6 +542,8 @@ get_version() { > qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources." > fi > return 1 >+ elif [ -z "${OUTPUT_DIR}" -a -s "${KV_DIR}/.config" ]; then >+ OUTPUT_DIR="${KV_DIR}" > fi > > # and in newer versions we can also pull LOCALVERSION if it is set. >@@ -539,6 +594,9 @@ get_running_version() { > > if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then > KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) >+ if [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then >+ KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) >+ fi > unset KV_FULL > get_version > return $?
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 87242
:
66083
|
117659
|
153403
|
203372
|
203706
|
203709
|
212561
|
212562
|
216766
|
216846
|
216847