debuggers.hg

annotate unmodified_drivers/linux-2.6/mkbuildtree @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents bc6fe0a7622a
children
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
keir@20342 36 if [ -f ${XL}/drivers/xen/core/features.c ]; then
keir@20342 37 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
keir@20342 38 else
keir@20342 39 ln -sf ${XL}/drivers/xen/features.c platform-pci
keir@20342 40 fi
kfraser@11209 41 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
kfraser@14820 42 ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
kfraser@11202 43
kaf24@13670 44 mkdir -p include/asm include/xen
kfraser@11202 45
kfraser@11202 46 lndir -silent ${XL}/include/xen include/xen
ian@12243 47 ln -nsf ${XEN}/include/public include/xen/interface
kfraser@11202 48
kfraser@11202 49 # Need to be quite careful here: we don't want the files we link in to
kfraser@11202 50 # risk overriding the native Linux ones (in particular, system.h must
kfraser@11202 51 # be native and not xenolinux).
keir@16796 52 case "$uname" in
keir@16796 53 i[34567]86|x86_64)
keir@20342 54 if [ -d ${XL}/arch/x86/include/mach-xen ]; then
keir@20342 55 ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypervisor.h include/asm
keir@20342 56 ln -sf ${XL}/arch/x86/include/mach-xen/asm/hypercall*.h include/asm
keir@20342 57 ln -sf ${XL}/arch/x86/include/mach-xen/asm/synch_bitops*.h include/asm
keir@20342 58 ln -sf ${XL}/arch/x86/include/mach-xen/asm/maddr*.h include/asm
keir@20342 59 ln -sf ${XL}/arch/x86/include/mach-xen/asm/gnttab_dma.h include/asm
keir@20342 60 ln -sf ${XL}/arch/x86/lib/scrub.c balloon
keir@20342 61 elif [ -d ${XL}/include/asm-x86 ]; then
keir@16796 62 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypervisor.h include/asm
keir@16796 63 ln -sf ${XL}/include/asm-x86/mach-xen/asm/hypercall*.h include/asm
keir@16796 64 ln -sf ${XL}/include/asm-x86/mach-xen/asm/synch_bitops*.h include/asm
keir@16796 65 ln -sf ${XL}/include/asm-x86/mach-xen/asm/maddr*.h include/asm
keir@16796 66 ln -sf ${XL}/include/asm-x86/mach-xen/asm/gnttab_dma.h include/asm
keir@18843 67 ln -sf ${XL}/arch/x86/lib/scrub.c balloon
keir@16796 68 else
keir@16796 69 if [ $uname = x86_64 ]; then
keir@16796 70 mkdir -p include/asm-i386
keir@16796 71 lndir -silent ${XL}/include/asm-i386 include/asm-i386
keir@16796 72 else
keir@16796 73 uname=i386
keir@16796 74 fi
keir@16796 75 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypervisor.h include/asm
keir@16796 76 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/hypercall.h include/asm
keir@16796 77 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/synch_bitops.h include/asm
keir@16796 78 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/maddr.h include/asm
keir@16796 79 ln -sf ${XL}/include/asm-$uname/mach-xen/asm/gnttab_dma.h include/asm
keir@16796 80 fi
kfraser@11885 81 ;;
kaf24@11502 82 "ia64")
kfraser@11885 83 ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm
kfraser@11885 84 ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm
kfraser@11885 85 ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm
kfraser@11885 86 ln -sf ${XL}/include/asm-ia64/maddr.h include/asm
keir@15322 87 ln -sf ${XL}/include/asm-ia64/gnttab_dma.h include/asm
kfraser@15264 88 mkdir -p include/asm/xen
awilliam@12036 89 ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen
awilliam@12036 90 ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen
alex@16050 91 ln -sf ${XL}/arch/ia64/xen/xcom_hcall.c platform-pci/
alex@17104 92 ln -sf ${XL}/arch/ia64/xen/xcom_asm.S platform-pci/
alex@15809 93 ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci/xencomm_arch.c
alex@15809 94 ln -sf ${XL}/drivers/xen/core/xencomm.c platform-pci
kfraser@11885 95 ;;
kfraser@11202 96 *)
kfraser@11885 97 echo unknown architecture $uname
kfraser@11885 98 exit 1
kfraser@11885 99 ;;
kfraser@11202 100 esac