Added patch from Alon Bar-Lev <alon.barlev@gmail.com> for bug #148498 and also a...
authorChris Gianelloni <wolf31o2@gentoo.org>
Mon, 2 Oct 2006 14:32:29 +0000 (14:32 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Mon, 2 Oct 2006 14:32:29 +0000 (14:32 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@445 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_determineargs.sh

index 11e94d6e6d6b9a90f4cac7de8a917cb4958e1d7e..fcafe33f92b89134d2b99b3c7cda08507b847e2c 100644 (file)
@@ -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