debuggers.hg
annotate unmodified_drivers/linux-2.6/mkbuildtree @ 18843:0b8c6c91c5a4
pv-on-hvm drivers: build fixes for Linux 2.6.27+
Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).
Portions from Charles Arnold <carnold@novell.com>.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).
Portions from Charles Arnold <carnold@novell.com>.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Nov 24 11:11:20 2008 +0000 (2008-11-24) |
parents | c98276a51ff8 |
children | bc6fe0a7622a |
rev | line source |
---|---|
kfraser@11202 | 1 #! /bin/sh |
kfraser@11202 | 2 |
kfraser@11885 | 3 if [ $1 ]; then |
kfraser@11885 | 4 uname="$1" |
kfraser@11885 | 5 else |
kfraser@11885 | 6 uname=`uname -m` |
kfraser@11885 | 7 echo "Defaulting to this machine's architecture, $uname, for linking." |
kfraser@11885 | 8 echo "This may be overridden on the command line (i386,x86_64,ia64)." |
kfraser@11885 | 9 fi |
kfraser@11885 | 10 |
keir@16796 | 11 C=$(cd $(dirname $0) && pwd) |
keir@16796 | 12 R=${C%/*/*} |
kfraser@11202 | 13 |
kfraser@15265 | 14 if [ -n "$XEN" -a -d "$XEN" ]; then |
kfraser@15265 | 15 XEN=$(cd $XEN && pwd) |
kfraser@15265 | 16 else |
keir@16796 | 17 XEN=$R/xen |
kfraser@15265 | 18 fi |
keir@16796 | 19 echo "Xen tree: $XEN" |
kfraser@15265 | 20 |
kfraser@15265 | 21 if [ -n "$XL" -a -d "$XL" ]; then |
kfraser@15265 | 22 XL=$(cd $XL && pwd) |
kfraser@15265 | 23 else |
keir@16796 | 24 XL=$R/linux-2.6.18-xen.hg |
kfraser@15265 | 25 fi |
keir@16796 | 26 echo "Linux tree: $XL" |
kfraser@11202 | 27 |
keir@16796 | 28 cd $C |
keir@16796 | 29 |
keir@16796 | 30 for d in $(find ${XL}/drivers/xen/ -mindepth 1 -maxdepth 1 -type d); do |
keir@16796 | 31 test -d $(basename $d) || continue |
keir@16796 | 32 lndir $d $(basename $d) > /dev/null 2>&1 |
kfraser@11209 | 33 done |
kfraser@11209 | 34 |
kfraser@11203 | 35 ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci |
kfraser@11202 | 36 ln -sf ${XL}/drivers/xen/core/features.c platform-pci |
kfraser@11209 | 37 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus |
kfraser@14820 | 38 ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci |
kfraser@11202 | 39 |
kaf24@13670 | 40 mkdir -p include/asm include/xen |
kfraser@11202 | 41 |
kfraser@11202 | 42 lndir -silent ${XL}/include/xen include/xen |
ian@12243 | 43 ln -nsf ${XEN}/include/public include/xen/interface |
kfraser@11202 | 44 |
kfraser@11202 | 45 # Need to be quite careful here: we don't want the files we link in to |
kfraser@11202 | 46 # risk overriding the native Linux ones (in particular, system.h must |
kfraser@11202 | 47 # be native and not xenolinux). |
keir@16796 | 48 case "$uname" in |
keir@16796 | 49 i[34567]86|x86_64) |
keir@16796 | 50 if [ -d ${XL}/include/asm-x86 ]; then |
keir@16796 | 51 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm |
keir@16796 | 52 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm |
keir@16796 | 53 ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm |
keir@16796 | 54 ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm |
keir@16796 | 55 ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm |
keir@18843 | 56 ln -sf ${XL}/arch/x86/lib/scrub.c balloon |
keir@16796 | 57 else |
keir@16796 | 58 if [ $uname = x86_64 ]; then |
keir@16796 | 59 mkdir -p include/asm-i386 |
keir@16796 | 60 lndir -silent ${XL}/include/asm-i386 include/asm-i386 |
keir@16796 | 61 else |
keir@16796 | 62 uname=i386 |
keir@16796 | 63 fi |
keir@16796 | 64 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm |
keir@16796 | 65 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm |
keir@16796 | 66 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm |
keir@16796 | 67 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm |
keir@16796 | 68 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm |
keir@16796 | 69 fi |
kfraser@11885 | 70 ;; |
kaf24@11502 | 71 "ia64") |
kfraser@11885 | 72 ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm |
kfraser@11885 | 73 ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm |
kfraser@11885 | 74 ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm |
kfraser@11885 | 75 ln -sf ${XL}/include/asm-ia64/maddr.h include/asm |
keir@15322 | 76 ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm |
kfraser@15264 | 77 mkdir -p include/asm/xen |
awilliam@12036 | 78 ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen |
awilliam@12036 | 79 ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen |
alex@16050 | 80 ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/ |
alex@17104 | 81 ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/ |
alex@15809 | 82 ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c |
alex@15809 | 83 ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci |
kfraser@11885 | 84 ;; |
kfraser@11202 | 85 *) |
kfraser@11885 | 86 echo unknown architecture $uname |
kfraser@11885 | 87 exit 1 |
kfraser@11885 | 88 ;; |
kfraser@11202 | 89 esac |