Files
xen/unmodified_drivers/linux-2.6/mkbuildtree
T
Keir Fraser c65b3f8832 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>
2008-11-24 11:11:20 +00:00

90 lines
3.0 KiB
Bash
Executable File

#! /bin/sh
if [ $1 ]; then
uname="$1"
else
uname=`uname -m`
echo "Defaulting to this machine's architecture, $uname, for linking."
echo "This may be overridden on the command line (i386,x86_64,ia64)."
fi
C=$(cd $(dirname $0) && pwd)
R=${C%/*/*}
if [ -n "$XEN" -a -d "$XEN" ]; then
XEN=$(cd $XEN && pwd)
else
XEN=$R/xen
fi
echo "Xen tree: $XEN"
if [ -n "$XL" -a -d "$XL" ]; then
XL=$(cd $XL && pwd)
else
XL=$R/linux-2.6.18-xen.hg
fi
echo "Linux tree: $XL"
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
ln -sf ${XL}/drivers/xen/core/features.c platform-pci
ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
mkdir -p include/asm include/xen
lndir -silent ${XL}/include/xen include/xen
ln -nsf ${XEN}/include/public include/xen/interface
# 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
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
ln -sf ${XL}/arch/x86/lib/scrub.c balloon
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
ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
mkdir -p include/asm/xen
ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
;;
*)
echo unknown architecture $uname
exit 1
;;
esac