WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] fix/adjust pv driver's mkbuildtree

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix/adjust pv driver's mkbuildtree
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 18 Jan 2008 14:42:47 +0000
Delivery-date: Fri, 18 Jan 2008 06:42:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Allow invoking the script from other than the current directory (the
script now infers the tree is where the script lives). Print which
trees are actually being used.

Fix the linking of sources from Linux tree's drivers/xen/ - this was
needlessly invoking lndir on various sub-directories, in some cases
even twice.

Adjust the script to be able to deal with Linux 2.6.24's unified x86
include directory.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-01-07/unmodified_drivers/linux-2.6/mkbuildtree
===================================================================
--- 2008-01-07.orig/unmodified_drivers/linux-2.6/mkbuildtree    2007-10-09 
11:46:22.000000000 +0200
+++ 2008-01-07/unmodified_drivers/linux-2.6/mkbuildtree 2008-01-17 
17:32:01.000000000 +0100
@@ -8,27 +8,28 @@ else
     echo "This may be overridden on the command line (i386,x86_64,ia64)."
 fi
 
-C=$PWD
+C=$(cd $(dirname $0) && pwd)
+R=${C%/*/*}
 
 if [ -n "$XEN" -a -d "$XEN" ]; then
   XEN=$(cd $XEN && pwd)
 else
-  XEN=$C/../../xen
+  XEN=$R/xen
 fi
+echo "Xen tree: $XEN"
 
 if [ -n "$XL" -a -d "$XL" ]; then
   XL=$(cd $XL && pwd)
 else
-  XL=$C/../../linux-2.6.18-xen.hg
+  XL=$R/linux-2.6.18-xen.hg
 fi
+echo "Linux tree: $XL"
 
-for d in $(find ${XL}/drivers/xen/ -maxdepth 1 -type d | sed -e 1d); do
-    if ! echo $d | egrep -q back; then
-        lndir $d $(basename $d) > /dev/null 2>&1
-    fi
-    if ! echo $d | egrep -q ball; then
-        lndir $d $(basename $d) > /dev/null 2>&1
-    fi
+cd $C
+
+for d in $(find ${XL}/drivers/xen/ -mindepth 1 -maxdepth 1 -type d); do
+    test -d $(basename $d) || continue
+    lndir $d $(basename $d) > /dev/null 2>&1
 done
 
 ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
@@ -44,23 +45,27 @@ ln -nsf ${XEN}/include/public include/xe
 # Need to be quite careful here: we don't want the files we link in to
 # risk overriding the native Linux ones (in particular, system.h must
 # be native and not xenolinux).
-case "$uname"
-in
-"x86_64")
-    ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypervisor.h include/asm
-    ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypercall.h include/asm
-    ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/synch_bitops.h include/asm
-    ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/maddr.h include/asm
-    ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/gnttab_dma.h include/asm
-    mkdir -p include/asm-i386
-    lndir -silent ${XL}/include/asm-i386 include/asm-i386
-  ;;
-i[34567]86)
-    ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypervisor.h include/asm
-    ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypercall.h include/asm
-    ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm
-    ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm
-    ln -sf ${XL}/include/asm-i386/mach-xen/asm/gnttab_dma.h include/asm
+case "$uname" in
+i[34567]86|x86_64)
+    if [ -d ${XL}/include/asm-x86 ]; then
+        ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
+        ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
+        ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm
+        ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm
+        ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm
+    else
+        if [ $uname = x86_64 ]; then
+            mkdir -p include/asm-i386
+            lndir -silent ${XL}/include/asm-i386 include/asm-i386
+        else
+            uname=i386
+        fi
+        ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm
+        ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm
+        ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm
+        ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm
+        ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
+    fi
   ;;
 "ia64")
     ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix/adjust pv driver's mkbuildtree, Jan Beulich <=