aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2011-01-21 23:46:57 (GMT)
committerSebastian Pipping <sebastian@pipping.org>2011-01-21 23:46:57 (GMT)
commit48ca00ec29afdec6cb168fbaae87a7b07ea65988 (patch)
tree1dafd27baf18b5862330f6668ecad8e7adf646dc
parentAdd compatibility with older cmdline setup on console argument (diff)
downloadgenkernel-48ca00ec29afdec6cb168fbaae87a7b07ea65988.zip
genkernel-48ca00ec29afdec6cb168fbaae87a7b07ea65988.tar.gz
genkernel-48ca00ec29afdec6cb168fbaae87a7b07ea65988.tar.bz2
Do not query generated files (like include/config/kernel.release) for kernel version, as they may be out of sync (bug #263927)
-rw-r--r--ChangeLog4
-rwxr-xr-xgen_determineargs.sh31
2 files changed, 15 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a0a907..b4edb34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
# Distributed under the GPL v2
# $Id$
+ 21 Jan 2011; Sebastian Pipping <sping@gentoo.org> gen_determineargs.sh:
+ Do not query generated files (like include/config/kernel.release) for kernel
+ version, as they may be out of sync (bug #263927)
+
20 Jan 2011; Sebastian Pipping <sping@gentoo.org> ChangeLog:
Add proper mdadm support (bug #282100)
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index a55ccec..9cd4be8 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -39,29 +39,20 @@ get_KV() {
EXV=`grep ^EXTRAVERSION\ \= ${KERNEL_SOURCE_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g" -e 's/\$([a-z]*)//gi'`
fi
- cd ${KERNEL_DIR}
- #compile_generic prepare kernel > /dev/null 2>&1
- cd - > /dev/null 2>&1
- [ -f "${KERNEL_DIR}/include/linux/version.h" ] && \
- VERSION_SOURCE="${KERNEL_DIR}/include/linux/version.h"
- [ -f "${KERNEL_DIR}/include/linux/utsrelease.h" ] && \
- VERSION_SOURCE="${KERNEL_DIR}/include/linux/utsrelease.h"
- # Handle new-style releases where version.h doesn't have UTS_RELEASE
- if [ -f ${KERNEL_DIR}/include/config/kernel.release ]
+ # Extract local version suffix from .config
+ # Not, that we explicitly do not look at generated files like
+ # - include/config/kernel.release
+ # - include/linux/version.h
+ # - include/linux/utsrelease.h
+ # as they require "make prepare" to be up to date (bug #263927)
+ local future_config="${KERNEL_DIR}"/.config
+ if isTrue "${MRPROPER}" || [ ! -f "${future_config}" ]
then
- UTS_RELEASE=`cat ${KERNEL_DIR}/include/config/kernel.release`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
- elif [ -n "${VERSION_SOURCE}" ]
- then
- UTS_RELEASE=`grep UTS_RELEASE ${VERSION_SOURCE} | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
- else
determine_config_file
- LCV=`grep ^CONFIG_LOCALVERSION= "${KERNEL_CONFIG}" | sed -r -e "s/.*=\"(.*)\"/\1/"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LCV}
+ future_config=${KERNEL_CONFIG}
fi
+ LOV=`grep ^CONFIG_LOCALVERSION= "${future_config}" | sed -r -e "s/.*=\"(.*)\"/\1/"`
+ KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
fi
}