hi folks,

with this patch, you can run prepare-kernel.sh on a kernel output tree,
at least once that tree contains the Makefile that the script looks for.



Index: scripts/prepare-kernel.sh
===================================================================
--- scripts/prepare-kernel.sh   (revision 550)
+++ scripts/prepare-kernel.sh   (working copy)
@@ -74,13 +74,14 @@
 done
 
 linux_tree=`cd $linux_tree && pwd`
+linux_out=$linux_tree
 
 if test \! -r $linux_tree/Makefile; then
    echo "$me: $linux_tree is not a valid Linux kernel tree"
    exit 2
 fi
 
-# Infere the default architecture if unspecified.
+# Infer the default architecture if unspecified.
 
 if test x$linux_arch = x; then
    build_arch=`$xenomai_root/config/config.guess`
@@ -144,6 +145,12 @@
    linux_arch=blackfin
 fi
 
+foo=`grep '^KERNELSRC    := ' $linux_tree/Makefile | cut -d= -f2`
+if [ ! -z $foo ] ; then
+    linux_tree=$foo
+fi
+unset foo
+
 eval linux_`grep '^EXTRAVERSION =' $linux_tree/Makefile | sed -e 's, ,,g'`
 eval linux_`grep '^PATCHLEVEL =' $linux_tree/Makefile | sed -e 's, ,,g'`
 eval linux_`grep '^SUBLEVEL =' $linux_tree/Makefile | sed -e 's, ,,g'`

Reply via email to