/[gentoo-x86]/eclass/linux-info.eclass
Gentoo

Diff of /eclass/linux-info.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.83 Revision 1.85
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.83 2010/01/17 21:46:55 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.85 2010/08/03 07:03:39 robbat2 Exp $
4# 4#
5# Original author: John Mylchreest <johnm@gentoo.org> 5# Original author: John Mylchreest <johnm@gentoo.org>
6# Maintainer: kernel-misc@gentoo.org 6# Maintainer: kernel-misc@gentoo.org
7# 7#
8# Please direct your bugs to the current eclass maintainer :) 8# Please direct your bugs to the current eclass maintainer :)
533 [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}" 533 [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"
534 if [ -n "${KV_OUT_DIR}" ]; 534 if [ -n "${KV_OUT_DIR}" ];
535 then 535 then
536 qeinfo "Found kernel object directory:" 536 qeinfo "Found kernel object directory:"
537 qeinfo " ${KV_OUT_DIR}" 537 qeinfo " ${KV_OUT_DIR}"
538
539 KV_LOCAL="$(get_localversion ${KV_OUT_DIR})"
540 fi 538 fi
541 # and if we STILL have not got it, then we better just set it to KV_DIR 539 # and if we STILL have not got it, then we better just set it to KV_DIR
542 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}" 540 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
543 541
544 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
545 if linux_config_src_exists; then 542 if linux_config_src_exists; then
546 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
547 KV_LOCAL="${KV_LOCAL//\"/}"
548
549 # For things like git that can append extra stuff: 543 # For things like git that can append extra stuff:
544 # This script is NOT posix-compliant. Running it with 'sh' when 'sh'
545 # is a real POSIX shell causes some breakages (bug #323717).
550 [ -e ${KV_DIR}/scripts/setlocalversion ] && 546 if [ -e ${KV_DIR}/scripts/setlocalversion ] ; then
551 linux_chkconfig_builtin LOCALVERSION_AUTO &&
552 KV_LOCAL="${KV_LOCAL}$(sh ${KV_DIR}/scripts/setlocalversion ${KV_DIR})" 547 KV_LOCAL="${KV_LOCAL}$(cd ${KV_OUT_DIR} ; bash ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
548 else
549 # localversion* files
550 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
551
552 # CONFIG_LOCALVERSION + LOCALVERSION
553 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)${LOCALVERSION}"
554 KV_LOCAL="${KV_LOCAL//\"/}"
555
556 # CONFIG_LOCALVERSION_AUTO logic ???
557 fi
558 else
559 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
553 fi 560 fi
554 561
555 # And we should set KV_FULL to the full expanded version 562 # And we should set KV_FULL to the full expanded version
556 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}" 563 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
557 564
566# It gets the version of the current running kernel and the result is the same as get_version() if the 573# It gets the version of the current running kernel and the result is the same as get_version() if the
567# function can find the sources. 574# function can find the sources.
568get_running_version() { 575get_running_version() {
569 KV_FULL=$(uname -r) 576 KV_FULL=$(uname -r)
570 577
578 if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
579 KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
580 KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build)
581 unset KV_FULL
582 get_version
583 return $?
571 if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then 584 elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
572 KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) 585 KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
573 unset KV_FULL 586 unset KV_FULL
574 get_version 587 get_version
575 return $? 588 return $?
576 elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then 589 elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.85

  ViewVC Help
Powered by ViewVC 1.1.20