From b931ed00a0bf09abecb96abdb1213ee7b2695cab Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Mon, 2 Oct 2006 14:32:29 +0000 Subject: [PATCH] Added patch from Alon Bar-Lev for bug #148498 and also a patch from Robin H. Johnson to support git-based kernels. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@445 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_determineargs.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 11e94d6..fcafe33 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -38,9 +38,19 @@ get_KV() { cd ${KERNEL_DIR} #compile_generic prepare kernel > /dev/null 2>&1 cd - > /dev/null 2>&1 - if [ -f ${KERNEL_DIR}/include/linux/version.h ] + [ -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 ] then - UTS_RELEASE=`grep UTS_RELEASE ${KERNEL_DIR}/include/linux/version.h | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'` + 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 -- 2.26.2