[PATCH] fix fix_includes.sh for 2.6.18 kernel (resend)
Atsushi Nemoto
anemo at mba.ocn.ne.jp
Wed Sep 6 16:48:01 UTC 2006
# I resend this since it seems lost somewhere ... sorry if you
# received this already.
The linux/version.h in 2.6.18 kernel does not contain UTS_RELEASE.
UTS_RELEASE was moved to new linux/utsrelease.h file and the file is
not exported by "make headers_install". Use LINUX_VERSION_CODE for
fallback.
-------------- next part --------------
Index: extra/scripts/fix_includes.sh
===================================================================
--- extra/scripts/fix_includes.sh (revision 16056)
+++ extra/scripts/fix_includes.sh (working copy)
@@ -70,6 +70,7 @@
# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
else
+if grep -q UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h; then
ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
VERSION=`echo "$ver" | cut -d '.' -f 1`
PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
@@ -80,7 +81,13 @@
SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
#EXTRAVERSION=
fi
+else
+ver=`grep LINUX_VERSION_CODE $KERNEL_SOURCE/include/linux/version.h | cut -d ' ' -f 3`
+VERSION=`expr $ver / 65536`
+PATCHLEVEL=`expr $ver % 65536 / 256`
+SUBLEVEL=`expr $ver % 256`
fi
+fi
if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
then
echo "Unable to determine version for kernel headers"
More information about the uClibc
mailing list