ia64/xen-unstable

changeset 14863:98efd2e410ae

Factor out sparse tree makefile fragments and introduce an alternative hg-clone
method in preparation for migrating away from the sparse tree layout.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Mon Apr 16 17:38:37 2007 +0100 (2007-04-16)
parents 52474e2df628
children b96df7a4e0a7
files buildconfigs/Rules.mk buildconfigs/mk.linux-2.6-xen buildconfigs/mk.linux-2.6.5-SLES-xen buildconfigs/mk.linux-2.6.9-RHEL-xen buildconfigs/src.hg-clone buildconfigs/src.sparse
line diff
     1.1 --- a/buildconfigs/Rules.mk	Mon Apr 16 11:42:12 2007 +0100
     1.2 +++ b/buildconfigs/Rules.mk	Mon Apr 16 17:38:37 2007 +0100
     1.3 @@ -3,79 +3,9 @@ include Config.mk
     1.4  
     1.5  export DESTDIR
     1.6  
     1.7 -# Choose the best mirror to download linux kernel
     1.8 -KERNEL_REPO = http://www.kernel.org
     1.9 -
    1.10  ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
    1.11  ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
    1.12  
    1.13 -# Setup pristine search path
    1.14 -PRISTINE_SRC_PATH	?= .:..
    1.15 -vpath pristine-% $(PRISTINE_SRC_PATH)
    1.16 -
    1.17 -# Let XEN_TARGET_ARCH override ARCH.
    1.18 -ifeq ($(XEN_TARGET_ARCH),x86_32)
    1.19 -LINUX_ARCH	?= i386
    1.20 -else
    1.21 -LINUX_ARCH	?= $(XEN_TARGET_ARCH)
    1.22 -endif
    1.23 -
    1.24 -# Expand Linux series to Linux version
    1.25 -LINUX_SERIES	?= 2.6
    1.26 -LINUX_VER	?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
    1.27 -
    1.28 -# Setup Linux search path
    1.29 -LINUX_SRC_PATH	?= .:..
    1.30 -vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    1.31 -vpath patch-%.bz2 $(LINUX_SRC_PATH)
    1.32 -
    1.33 -# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
    1.34 -linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
    1.35 -linux-%.tar.bz2:
    1.36 -	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
    1.37 -	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
    1.38 -
    1.39 -patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
    1.40 -patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
    1.41 -patch-%.bz2:
    1.42 -	@echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
    1.43 -	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
    1.44 -
    1.45 -pristine-%: pristine-%/.valid-pristine
    1.46 -	@true
    1.47 -
    1.48 -pristine-%/.valid-pristine: %.tar.bz2
    1.49 -	rm -rf tmp-pristine-$* $(@D)
    1.50 -	mkdir -p tmp-pristine-$*
    1.51 -	tar -C tmp-pristine-$* -jxf $<
    1.52 -	-@rm -f tmp-pristine-$*/pax_global_header
    1.53 -	mv tmp-pristine-$*/* $(@D)
    1.54 -	@rm -rf tmp-pristine-$*
    1.55 -	touch $(@D)/.hgskip
    1.56 -	touch $@ # update timestamp to avoid rebuild
    1.57 -
    1.58 -PATCHDIRS := $(wildcard patches/*-*)
    1.59 -
    1.60 -ifneq ($(PATCHDIRS),)
    1.61 --include $(patsubst %,%/.makedep,$(PATCHDIRS))
    1.62 -
    1.63 -$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
    1.64 -	@echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
    1.65 -
    1.66 -ref-%/.valid-ref: pristine-%/.valid-pristine
    1.67 -	set -e
    1.68 -	rm -rf $(@D)
    1.69 -	cp -al $(<D) $(@D)
    1.70 -	if [ -d patches/$* ] ; then                                    \
    1.71 -	    echo Applying patches from patches/$*... ;                 \
    1.72 -	    for i in $$(cat patches/$*/series) ; do                    \
    1.73 -	        echo ... $$i ;                                         \
    1.74 -	        patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
    1.75 -	     done ;                                                    \
    1.76 -	fi
    1.77 -	touch $@ # update timestamp to avoid rebuild
    1.78 -endif
    1.79 -
    1.80  %-install:
    1.81  	$(MAKE) -f buildconfigs/mk.$* build
    1.82  
    1.83 @@ -101,32 +31,13 @@ endif
    1.84  %-clean:
    1.85  	$(MAKE) -f buildconfigs/mk.$* clean
    1.86  
    1.87 -linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
    1.88 -	rm -rf tmp-$@
    1.89 -	cp -al $(<D) tmp-$@
    1.90 -	( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
    1.91 -	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
    1.92 -	rm -rf tmp-$@
    1.93 -
    1.94 -%-xen.patch: ref-%/.valid-ref
    1.95 -	rm -rf tmp-$@
    1.96 -	cp -al $(<D) tmp-$@
    1.97 -	( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
    1.98 -	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
    1.99 -	rm -rf tmp-$@
   1.100 +%.patch:
   1.101 +	$(MAKE) -f buildconfigs/mk.$* $@
   1.102  
   1.103  %-mrproper:
   1.104 -	$(MAKE) -f buildconfigs/mk.$*-xen mrpropper
   1.105 +	$(MAKE) -f buildconfigs/mk.$*-xen mrproper
   1.106  	rm -rf pristine-$(*)* ref-$(*)*
   1.107  	rm -rf $*-xen.patch
   1.108  
   1.109 -.PHONY: config-update-pae
   1.110 -config-update-pae:
   1.111 -ifeq ($(XEN_TARGET_X86_PAE),y)
   1.112 -	sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
   1.113 -else
   1.114 -	grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
   1.115 -endif
   1.116 -
   1.117  # never delete any intermediate files.
   1.118  .SECONDARY:
     2.1 --- a/buildconfigs/mk.linux-2.6-xen	Mon Apr 16 11:42:12 2007 +0100
     2.2 +++ b/buildconfigs/mk.linux-2.6-xen	Mon Apr 16 17:38:37 2007 +0100
     2.3 @@ -1,8 +1,17 @@
     2.4  LINUX_SERIES = 2.6
     2.5 -LINUX_VER    = 2.6.18
     2.6 +LINUX_VER    ?= 2.6.18
     2.7  
     2.8  EXTRAVERSION ?= xen
     2.9  
    2.10 +XEN_LINUX_SOURCE ?= sparse
    2.11 +
    2.12 +# Let XEN_TARGET_ARCH override ARCH.
    2.13 +ifeq ($(XEN_TARGET_ARCH),x86_32)
    2.14 +LINUX_ARCH	?= i386
    2.15 +else
    2.16 +LINUX_ARCH	?= $(XEN_TARGET_ARCH)
    2.17 +endif
    2.18 +
    2.19  LINUX_SRCDIR = linux-$(LINUX_VER)-xen
    2.20  LINUX_DIR    = build-linux-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
    2.21  
    2.22 @@ -15,8 +24,6 @@ endif
    2.23  
    2.24  LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
    2.25  
    2.26 -include buildconfigs/Rules.mk
    2.27 -
    2.28  # The real action starts here!
    2.29  .PHONY: build
    2.30  build: $(LINUX_DIR)/include/linux/autoconf.h
    2.31 @@ -28,31 +35,56 @@ build: $(LINUX_DIR)/include/linux/autoco
    2.32  	mkdir -p $(INSTALL_BOOT_PATH)
    2.33  	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(INSTALL_BOOT_PATH) install
    2.34  
    2.35 -$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
    2.36 -	rm -rf $(LINUX_SRCDIR)
    2.37 -	cp -al $(<D) $(LINUX_SRCDIR)
    2.38 -	# Apply arch-xen patches
    2.39 -	( cd linux-$(LINUX_SERIES)-xen-sparse && \
    2.40 -          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
    2.41 -	# Patch kernel Makefile to set EXTRAVERSION
    2.42 -	( cd $(LINUX_SRCDIR) ; \
    2.43 -	  sed -e 's,^EXTRAVERSION.*,&$$(XENGUEST),' \
    2.44 -	      -e 's,^KERNELRELEASE,XENGUEST := $$(shell [ -r $$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; \
    2.45 -	  rm -f Makefile ; mv Mk.tmp Makefile )
    2.46 -	touch $@
    2.47 -
    2.48 +$(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(PWD)/$(LINUX_DIR)/.config
    2.49  $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
    2.50  	rm -rf $(LINUX_DIR)
    2.51  	mkdir -p $(LINUX_DIR)
    2.52 -	# Re-use config from install dir if one exits else use default config
    2.53 +	# Re-use config from install dir if one exists else use the create_config.sh provided
    2.54 +	# by the source tree.
    2.55  	CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
    2.56 -	[ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
    2.57 -	  cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \
    2.58 -	  || sh buildconfigs/create_config.sh $(LINUX_DIR)/.config $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE)
    2.59 -	# See if we need to munge config to enable PAE
    2.60 -	$(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk config-update-pae
    2.61 -	echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest
    2.62 +	if [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) ] ; then \
    2.63 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) $(CONFIG_FILE) ; \
    2.64 +        else \
    2.65 +	  cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
    2.66 +		$(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE) ; \
    2.67 +	fi
    2.68 +ifeq ($(XEN_TARGET_ARCH),x86_32)
    2.69 +ifeq ($(XEN_TARGET_X86_PAE),y)
    2.70 +	sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
    2.71 +else
    2.72 +	grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
    2.73 +endif
    2.74 +endif
    2.75 +	echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
    2.76  	$(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
    2.77 +	@if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
    2.78 +	    echo "***********************************"; \
    2.79 +	    echo "oldconfig did not create a Makefile"; \
    2.80 +	    echo "Generating $(LINUX_DIR)/Makefile   "; \
    2.81 +	    echo "***********************************"; \
    2.82 +	    ( echo "# Automatically generated: don't edit"; \
    2.83 +	      echo ""; \
    2.84 +	      echo "VERSION = 2"; \
    2.85 +	      echo "PATCHLEVEL = 6"; \
    2.86 +	      echo ""; \
    2.87 +	      echo "KERNELSRC    := $(PWD)/$(LINUX_SRCDIR)"; \
    2.88 +	      echo "KERNELOUTPUT := $(PWD)/$(LINUX_DIR)"; \
    2.89 +	      echo ""; \
    2.90 +	      echo "MAKEFLAGS += --no-print-directory"; \
    2.91 +	      echo ""; \
    2.92 +	      echo ".PHONY: all \$$(MAKECMDGOALS)"; \
    2.93 +	      echo ""; \
    2.94 +	      echo "all:"; \
    2.95 +	      echo "	\$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
    2.96 +	      echo ""; \
    2.97 +	      echo "Makefile:;"; \
    2.98 +	      echo ""; \
    2.99 +	      echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
   2.100 +	      echo "	\$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
   2.101 +	    ) > $(LINUX_DIR)/Makefile ; \
   2.102 +	fi
   2.103 +
   2.104 +include buildconfigs/src.$(XEN_LINUX_SOURCE)
   2.105  
   2.106  .PHONY: prep
   2.107  prep: $(LINUX_DIR)/include/linux/autoconf.h
   2.108 @@ -67,12 +99,11 @@ clean::
   2.109  	[ ! -d $(LINUX_DIR) ] || \
   2.110  		$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
   2.111  
   2.112 -
   2.113  .PHONY: delete
   2.114  delete: 
   2.115  	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
   2.116  
   2.117 -.PHONY: mrpropper
   2.118 -mrpropper:
   2.119 +.PHONY: mrproper
   2.120 +mrproper:
   2.121  	rm -rf $(LINUX_SRCDIR)
   2.122  	rm -f linux-$(LINUX_VER).tar.bz2
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/buildconfigs/mk.linux-2.6.5-SLES-xen	Mon Apr 16 17:38:37 2007 +0100
     3.3 @@ -0,0 +1,12 @@
     3.4 +# This tree only supports PAE
     3.5 +XEN_TARGET_ARCH = x86_32
     3.6 +XEN_TARGET_X86_PAE = y
     3.7 +
     3.8 +EXTRAVERSION = xen
     3.9 +LINUX_VER = 2.6.5-SLES
    3.10 +
    3.11 +XEN_LINUX_SOURCE = hg-clone
    3.12 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/sles9x.hg
    3.13 +XEN_LINUX_HGREV  ?= tip
    3.14 +
    3.15 +include buildconfigs/mk.linux-2.6-xen
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/buildconfigs/mk.linux-2.6.9-RHEL-xen	Mon Apr 16 17:38:37 2007 +0100
     4.3 @@ -0,0 +1,12 @@
     4.4 +# This tree only supports PAE
     4.5 +XEN_TARGET_ARCH = x86_32
     4.6 +XEN_TARGET_X86_PAE = y
     4.7 +
     4.8 +EXTRAVERSION = xen
     4.9 +LINUX_VER = 2.6.9-RHEL
    4.10 +
    4.11 +XEN_LINUX_SOURCE = hg-clone
    4.12 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/rhel4x.hg
    4.13 +XEN_LINUX_HGREV  ?= tip
    4.14 +
    4.15 +include buildconfigs/mk.linux-2.6-xen
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/buildconfigs/src.hg-clone	Mon Apr 16 17:38:37 2007 +0100
     5.3 @@ -0,0 +1,9 @@
     5.4 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/linux-$(LINUX_VER)-xen.hg
     5.5 +XEN_LINUX_HGREV  ?= tip
     5.6 +
     5.7 +$(LINUX_SRCDIR)/.valid-src:
     5.8 +# TODO handle updating an existing clone?
     5.9 +	if [ ! -d $(LINUX_SRCDIR) ] ; then \
    5.10 +	    hg clone -r $(XEN_LINUX_HGREV) $(XEN_LINUX_HGREPO) $(LINUX_SRCDIR); \
    5.11 +	fi
    5.12 +	touch $@
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/buildconfigs/src.sparse	Mon Apr 16 17:38:37 2007 +0100
     6.3 @@ -0,0 +1,74 @@
     6.4 +# Choose the best mirror to download linux kernel
     6.5 +KERNEL_REPO = http://www.kernel.org
     6.6 +
     6.7 +# Setup pristine search path
     6.8 +PRISTINE_SRC_PATH	?= .:..
     6.9 +vpath pristine-% $(PRISTINE_SRC_PATH)
    6.10 +
    6.11 +# Setup Linux search path
    6.12 +LINUX_SRC_PATH	?= .:..
    6.13 +vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    6.14 +vpath patch-%.bz2 $(LINUX_SRC_PATH)
    6.15 +
    6.16 +# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
    6.17 +linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
    6.18 +linux-%.tar.bz2:
    6.19 +	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
    6.20 +	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
    6.21 +
    6.22 +patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
    6.23 +patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
    6.24 +patch-%.bz2:
    6.25 +	@echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
    6.26 +	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
    6.27 +
    6.28 +pristine-%: pristine-%/.valid-pristine
    6.29 +	@true
    6.30 +
    6.31 +pristine-%/.valid-pristine: %.tar.bz2
    6.32 +	rm -rf tmp-pristine-$* $(@D)
    6.33 +	mkdir -p tmp-pristine-$*
    6.34 +	tar -C tmp-pristine-$* -jxf $<
    6.35 +	-@rm -f tmp-pristine-$*/pax_global_header
    6.36 +	mv tmp-pristine-$*/* $(@D)
    6.37 +	@rm -rf tmp-pristine-$*
    6.38 +	touch $(@D)/.hgskip
    6.39 +	touch $@ # update timestamp to avoid rebuild
    6.40 +
    6.41 +PATCHDIRS := $(wildcard patches/*-*)
    6.42 +
    6.43 +ifneq ($(PATCHDIRS),)
    6.44 +-include $(patsubst %,%/.makedep,$(PATCHDIRS))
    6.45 +
    6.46 +$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
    6.47 +	@echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
    6.48 +
    6.49 +ref-%/.valid-ref: pristine-%/.valid-pristine
    6.50 +	set -e
    6.51 +	rm -rf $(@D)
    6.52 +	cp -al $(<D) $(@D)
    6.53 +	if [ -d patches/$* ] ; then                                    \
    6.54 +	    echo Applying patches from patches/$*... ;                 \
    6.55 +	    for i in $$(cat patches/$*/series) ; do                    \
    6.56 +	        echo ... $$i ;                                         \
    6.57 +	        patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
    6.58 +	     done ;                                                    \
    6.59 +	fi
    6.60 +	touch $@ # update timestamp to avoid rebuild
    6.61 +endif
    6.62 +
    6.63 +$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
    6.64 +	rm -rf $(LINUX_SRCDIR)
    6.65 +	cp -al $(<D) $(LINUX_SRCDIR)
    6.66 +	# Apply arch-xen patches
    6.67 +	( cd linux-$(LINUX_SERIES)-xen-sparse && \
    6.68 +          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
    6.69 +	( cd $(LINUX_SRCDIR) && ln -s $(PWD)/buildconfigs buildconfigs )
    6.70 +	touch $@
    6.71 +
    6.72 +linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
    6.73 +	rm -rf tmp-$@
    6.74 +	cp -al $(<D) tmp-$@
    6.75 +	( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
    6.76 +	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
    6.77 +	rm -rf tmp-$@