summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-09-10 06:10:52 +0000
committerMike Frysinger <vapier@gentoo.org>2006-09-10 06:10:52 +0000
commitdaf1c674eaaaf4cec6d05a5b08a37af6783bd6a0 (patch)
tree49d8e65a38107aca290f2f13e426baf8b2ae64c4
parentcf11d72ade48d18ecee97bcd9be3a5304c3ef699 (diff)
remove version checking code and add some more comments
-rwxr-xr-xextra/scripts/fix_includes.sh52
1 files changed, 17 insertions, 35 deletions
diff --git a/extra/scripts/fix_includes.sh b/extra/scripts/fix_includes.sh
index 62987d76d..3b97f04bf 100755
--- a/extra/scripts/fix_includes.sh
+++ b/extra/scripts/fix_includes.sh
@@ -36,6 +36,10 @@ usage() {
exit 1
}
+
+#
+# Parse our arguments
+#
HAS_MMU="y"
while [ -n "$1" ]; do
case $1 in
@@ -47,6 +51,10 @@ while [ -n "$1" ]; do
esac
done
+
+#
+# Perform some sanity checks on our kernel sources
+#
if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
echo ""
echo ""
@@ -56,7 +64,6 @@ if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/versio
echo ""
exit 1
fi
-
if [ ! -d "$KERNEL_SOURCE" ]; then
echo ""
echo ""
@@ -66,38 +73,10 @@ if [ ! -d "$KERNEL_SOURCE" ]; then
exit 1
fi
-if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
- # 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
- 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`
- if echo "$ver" | grep -q '-' ; then
- SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
- EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
- else
- SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
- #EXTRAVERSION=
- fi
-fi
-if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]; then
- echo "Unable to determine version for kernel headers"
- echo -e "\tprovided in directory $KERNEL_SOURCE"
- exit 1
-fi
-
-if [ "$MAKE_IS_SILENT" != "y" ]; then
- echo ""
- echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
- echo ""
- echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
- echo -e "\tprovided in directory $KERNEL_SOURCE"
- echo ""
-fi
+#
# Create a symlink to include/asm
-
+#
rm -f include/asm*
if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
echo ""
@@ -160,14 +139,17 @@ else
fi
+#
# Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
-if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ]; then
- if [ ! -e include/asm-generic ] && [ -e $KERNEL_SOURCE/include/asm-generic ]; then
- ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
- fi
+#
+if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
+ rm -f include/asm-generic
+ ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
fi
+#
# Create the include/linux symlink.
+#
rm -f include/linux
ln -fs $KERNEL_SOURCE/include/linux include/linux