ia64/xen-unstable

changeset 15224:3fcd0b9fd083

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

This re-introduces 14883:6568c1882af5 and 14862:98efd2e410ae plus
further fixes.

Also add makefile fragments to support building the paravirt ops tree
(make linux-2.6-paravirt-build).

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Fri May 25 11:03:40 2007 +0100 (2007-05-25)
parents a717cb2fac90
children ca62b4b4f762
files .hgignore buildconfigs/Rules.mk buildconfigs/create_config.sh buildconfigs/mk.linux-2.6-native buildconfigs/mk.linux-2.6-paravirt buildconfigs/mk.linux-2.6-xen buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU buildconfigs/mk.linux-2.6.5-SLES-xen buildconfigs/mk.linux-2.6.9-RHEL-xen buildconfigs/src.hg-clone buildconfigs/src.sparse buildconfigs/src.tarball linux-2.6-xen-sparse/arch/i386/Makefile linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile linux-2.6-xen-sparse/arch/x86_64/Makefile
line diff
     1.1 --- a/.hgignore	Fri May 25 10:53:07 2007 +0100
     1.2 +++ b/.hgignore	Fri May 25 11:03:40 2007 +0100
     1.3 @@ -66,6 +66,7 @@
     1.4  ^linux-[^/]*-xen/.*$
     1.5  ^linux-[^/]*-xen0/.*$
     1.6  ^linux-[^/]*-xenU/.*$
     1.7 +^linux-[^/]*-paravirt/.*$
     1.8  ^linux-[^/]*\.patch$
     1.9  ^mkddbxen$
    1.10  ^netbsd-[^/]*-tools/.*$
     2.1 --- a/buildconfigs/Rules.mk	Fri May 25 10:53:07 2007 +0100
     2.2 +++ b/buildconfigs/Rules.mk	Fri May 25 11:03:40 2007 +0100
     2.3 @@ -3,79 +3,9 @@ include Config.mk
     2.4  
     2.5  export DESTDIR
     2.6  
     2.7 -# Choose the best mirror to download linux kernel
     2.8 -KERNEL_REPO = http://www.kernel.org
     2.9 -
    2.10  ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
    2.11  ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
    2.12  
    2.13 -# Setup pristine search path
    2.14 -PRISTINE_SRC_PATH	?= .:..
    2.15 -vpath pristine-% $(PRISTINE_SRC_PATH)
    2.16 -
    2.17 -# Let XEN_TARGET_ARCH override ARCH.
    2.18 -ifeq ($(XEN_TARGET_ARCH),x86_32)
    2.19 -LINUX_ARCH	?= i386
    2.20 -else
    2.21 -LINUX_ARCH	?= $(XEN_TARGET_ARCH)
    2.22 -endif
    2.23 -
    2.24 -# Expand Linux series to Linux version
    2.25 -LINUX_SERIES	?= 2.6
    2.26 -LINUX_VER	?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
    2.27 -
    2.28 -# Setup Linux search path
    2.29 -LINUX_SRC_PATH	?= .:..
    2.30 -vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    2.31 -vpath patch-%.bz2 $(LINUX_SRC_PATH)
    2.32 -
    2.33 -# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
    2.34 -linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
    2.35 -linux-%.tar.bz2:
    2.36 -	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
    2.37 -	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
    2.38 -
    2.39 -patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
    2.40 -patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
    2.41 -patch-%.bz2:
    2.42 -	@echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
    2.43 -	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
    2.44 -
    2.45 -pristine-%: pristine-%/.valid-pristine
    2.46 -	@true
    2.47 -
    2.48 -pristine-%/.valid-pristine: %.tar.bz2
    2.49 -	rm -rf tmp-pristine-$* $(@D)
    2.50 -	mkdir -p tmp-pristine-$*
    2.51 -	tar -C tmp-pristine-$* -jxf $<
    2.52 -	-@rm -f tmp-pristine-$*/pax_global_header
    2.53 -	mv tmp-pristine-$*/* $(@D)
    2.54 -	@rm -rf tmp-pristine-$*
    2.55 -	touch $(@D)/.hgskip
    2.56 -	touch $@ # update timestamp to avoid rebuild
    2.57 -
    2.58 -PATCHDIRS := $(wildcard patches/*-*)
    2.59 -
    2.60 -ifneq ($(PATCHDIRS),)
    2.61 --include $(patsubst %,%/.makedep,$(PATCHDIRS))
    2.62 -
    2.63 -$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
    2.64 -	@echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
    2.65 -
    2.66 -ref-%/.valid-ref: pristine-%/.valid-pristine
    2.67 -	set -e
    2.68 -	rm -rf $(@D)
    2.69 -	cp -al $(<D) $(@D)
    2.70 -	if [ -d patches/$* ] ; then                                    \
    2.71 -	    echo Applying patches from patches/$*... ;                 \
    2.72 -	    for i in $$(cat patches/$*/series) ; do                    \
    2.73 -	        echo ... $$i ;                                         \
    2.74 -	        patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
    2.75 -	     done ;                                                    \
    2.76 -	fi
    2.77 -	touch $@ # update timestamp to avoid rebuild
    2.78 -endif
    2.79 -
    2.80  %-install:
    2.81  	$(MAKE) -f buildconfigs/mk.$* build
    2.82  
    2.83 @@ -101,32 +31,13 @@ endif
    2.84  %-clean:
    2.85  	$(MAKE) -f buildconfigs/mk.$* clean
    2.86  
    2.87 -linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
    2.88 -	rm -rf tmp-$@
    2.89 -	cp -al $(<D) tmp-$@
    2.90 -	( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
    2.91 -	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
    2.92 -	rm -rf tmp-$@
    2.93 -
    2.94 -%-xen.patch: ref-%/.valid-ref
    2.95 -	rm -rf tmp-$@
    2.96 -	cp -al $(<D) tmp-$@
    2.97 -	( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
    2.98 -	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
    2.99 -	rm -rf tmp-$@
   2.100 +%.patch:
   2.101 +	$(MAKE) -f buildconfigs/mk.$* $@
   2.102  
   2.103  %-mrproper:
   2.104 -	$(MAKE) -f buildconfigs/mk.$*-xen mrpropper
   2.105 +	$(MAKE) -f buildconfigs/mk.$*-xen mrproper
   2.106  	rm -rf pristine-$(*)* ref-$(*)*
   2.107  	rm -rf $*-xen.patch
   2.108  
   2.109 -.PHONY: config-update-pae
   2.110 -config-update-pae:
   2.111 -ifeq ($(XEN_TARGET_X86_PAE),y)
   2.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)
   2.113 -else
   2.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
   2.115 -endif
   2.116 -
   2.117  # never delete any intermediate files.
   2.118  .SECONDARY:
     3.1 --- a/buildconfigs/create_config.sh	Fri May 25 10:53:07 2007 +0100
     3.2 +++ b/buildconfigs/create_config.sh	Fri May 25 11:03:40 2007 +0100
     3.3 @@ -18,23 +18,26 @@ systype=$4
     3.4  # Start with initial config skeleton file, if any.
     3.5  # Derive from linux-defconfig_xen_x86_32 otherwise.
     3.6  #
     3.7 -skeleton=buildconfigs/linux-defconfig_${extraversion}_${target_arch}${systype}
     3.8 +skeleton=buildconfigs/linux-defconfig_${extraversion#-}_${target_arch}${systype}
     3.9  [ -r $skeleton ] || skeleton=buildconfigs/linux-defconfig_xen_x86_32
    3.10  [ -r $skeleton.local ] && skeleton=$skeleton.local
    3.11  cp $skeleton $config_file
    3.12  
    3.13 +echo "Using $skeleton as base config"
    3.14  
    3.15  # Update
    3.16  #
    3.17  filter_template="s/^#\{0,1\} *\(CONFIG[^= ]*\).*/\/^#\\\{0,1\\\} *\1[= ].*\/d/p"
    3.18 -config_dirs="buildconfigs/conf.linux buildconfigs/conf.linux-${target_arch} buildconfigs/conf.linux-${extraversion} buildconfigs/conf.linux-${target_arch}-${extraversion}"
    3.19 +config_dirs="buildconfigs/conf.linux buildconfigs/conf.linux-${target_arch} buildconfigs/conf.linux${extraversion} buildconfigs/conf.linux-${target_arch}${extraversion}"
    3.20  
    3.21  for config_dir in $config_dirs
    3.22  do
    3.23      if [ -d $config_dir ]; then
    3.24 +        echo "Processing $config_dir..." 1>&2
    3.25          # processing is done in alphanumeric order
    3.26          find $config_dir -type f | sort | while read update
    3.27          do
    3.28 +            echo "   ... $update" 1>&2
    3.29              # create the filter rules in a temp file
    3.30              filter_rules=`mktemp -t xenupdateconf.XXXXXXXXXX`
    3.31              sed -n "${filter_template}" < $update > $filter_rules
     4.1 --- a/buildconfigs/mk.linux-2.6-native	Fri May 25 10:53:07 2007 +0100
     4.2 +++ b/buildconfigs/mk.linux-2.6-native	Fri May 25 11:03:40 2007 +0100
     4.3 @@ -1,4 +1,4 @@
     4.4 -EXTRAVERSION = native
     4.5 +EXTRAVERSION = -native
     4.6  IMAGE_TARGET = bzImage
     4.7  INSTALL_BOOT_PATH = $(DESTDIR)/boot
     4.8  include buildconfigs/mk.linux-2.6-xen
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/buildconfigs/mk.linux-2.6-paravirt	Fri May 25 11:03:40 2007 +0100
     5.3 @@ -0,0 +1,11 @@
     5.4 +XEN_LINUX_SOURCE ?= tarball
     5.5 +XEN_LINUX_MIRROR ?= http://xenbits.xensource.com/ext/paravirt_ops/
     5.6 +LINUX_VER ?= 2.6-paravirt
     5.7 +
     5.8 +# This target currently only supports x86_32.
     5.9 +XEN_TARGET_ARCH = x86_32
    5.10 +IMAGE_TARGET ?= vmlinux bzImage
    5.11 +
    5.12 +EXTRAVERSION ?=
    5.13 +
    5.14 +include buildconfigs/mk.linux-2.6-xen
     6.1 --- a/buildconfigs/mk.linux-2.6-xen	Fri May 25 10:53:07 2007 +0100
     6.2 +++ b/buildconfigs/mk.linux-2.6-xen	Fri May 25 11:03:40 2007 +0100
     6.3 @@ -1,21 +1,28 @@
     6.4  LINUX_SERIES = 2.6
     6.5 -LINUX_VER    = 2.6.18
     6.6 +LINUX_VER    ?= 2.6.18
     6.7 +
     6.8 +EXTRAVERSION ?= -xen
     6.9 +
    6.10 +XEN_LINUX_SOURCE ?= sparse
    6.11  
    6.12 -EXTRAVERSION ?= xen
    6.13 +# Let XEN_TARGET_ARCH override ARCH.
    6.14 +ifeq ($(XEN_TARGET_ARCH),x86_32)
    6.15 +LINUX_ARCH	?= i386
    6.16 +else
    6.17 +LINUX_ARCH	?= $(XEN_TARGET_ARCH)
    6.18 +endif
    6.19  
    6.20 -LINUX_SRCDIR = linux-$(LINUX_VER)-xen
    6.21 -LINUX_DIR    = build-linux-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
    6.22 +LINUX_DIR     = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
    6.23  
    6.24  IMAGE_TARGET ?= vmlinuz
    6.25 -INSTALL_BOOT_PATH ?= $(DESTDIR)
    6.26 -
    6.27 -ifeq ($(XEN_TARGET_ARCH),ia64)
    6.28  INSTALL_BOOT_PATH := $(DESTDIR)/boot
    6.29 -endif
    6.30  
    6.31  LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
    6.32  
    6.33 -include buildconfigs/Rules.mk
    6.34 +.PHONY: _build
    6.35 +_build: build
    6.36 +
    6.37 +include buildconfigs/src.$(XEN_LINUX_SOURCE)
    6.38  
    6.39  # The real action starts here!
    6.40  .PHONY: build
    6.41 @@ -28,31 +35,63 @@ build: $(LINUX_DIR)/include/linux/autoco
    6.42  	mkdir -p $(INSTALL_BOOT_PATH)
    6.43  	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(INSTALL_BOOT_PATH) install
    6.44  
    6.45 -$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
    6.46 -	rm -rf $(LINUX_SRCDIR)
    6.47 -	cp -al $(<D) $(LINUX_SRCDIR)
    6.48 -	# Apply arch-xen patches
    6.49 -	( cd linux-$(LINUX_SERIES)-xen-sparse && \
    6.50 -          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
    6.51 -	# Patch kernel Makefile to set EXTRAVERSION
    6.52 -	( cd $(LINUX_SRCDIR) ; \
    6.53 -	  sed -e 's,^EXTRAVERSION.*,&$$(XENGUEST),' \
    6.54 -	      -e 's,^KERNELRELEASE,XENGUEST := $$(shell [ -r $$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; \
    6.55 -	  rm -f Makefile ; mv Mk.tmp Makefile )
    6.56 -	touch $@
    6.57 -
    6.58 +$(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(PWD)/$(LINUX_DIR)/.config
    6.59  $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
    6.60  	rm -rf $(LINUX_DIR)
    6.61  	mkdir -p $(LINUX_DIR)
    6.62 -	# Re-use config from install dir if one exits else use default config
    6.63 +	# Re-use config from install dir if one exists. Next try to use
    6.64 +	# buildconfigs/create_config.sh is one is provided by the source
    6.65 +	# tree. Finally attempt to use make defconfig.
    6.66 +	set -e ; \
    6.67  	CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
    6.68 -	[ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
    6.69 -	  cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \
    6.70 -	  || sh buildconfigs/create_config.sh $(LINUX_DIR)/.config $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE)
    6.71 -	# See if we need to munge config to enable PAE
    6.72 -	$(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk config-update-pae
    6.73 -	echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest
    6.74 +	if [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
    6.75 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) $(CONFIG_FILE) ; \
    6.76 +        elif [ -e $(LINUX_SRCDIR)/buildconfigs/create_config.sh ] ; then \
    6.77 +	  cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
    6.78 +		$(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE) ; \
    6.79 +          echo "Configured $(LINUX_DIR) using create_config.sh" ; \
    6.80 +	elif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) defconfig O=$$(/bin/pwd)/$(LINUX_DIR) ; then \
    6.81 +	  echo "Configured $(LINUX_DIR) using defconfig" ; \
    6.82 +	else \
    6.83 +          echo "No configuration method found for this kernel" ; \
    6.84 +	fi
    6.85 +ifeq ($(XEN_TARGET_ARCH),x86_32)
    6.86 +ifeq ($(pae),y)
    6.87 +	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)
    6.88 +else
    6.89 +	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
    6.90 +endif
    6.91 +endif
    6.92 +ifneq ($(EXTRAVERSION),)
    6.93 +	echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
    6.94 +endif
    6.95  	$(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
    6.96 +	@if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
    6.97 +	    echo "***********************************"; \
    6.98 +	    echo "oldconfig did not create a Makefile"; \
    6.99 +	    echo "Generating $(LINUX_DIR)/Makefile   "; \
   6.100 +	    echo "***********************************"; \
   6.101 +	    ( echo "# Automatically generated: don't edit"; \
   6.102 +	      echo ""; \
   6.103 +	      echo "VERSION = 2"; \
   6.104 +	      echo "PATCHLEVEL = 6"; \
   6.105 +	      echo ""; \
   6.106 +	      echo "KERNELSRC    := $(PWD)/$(LINUX_SRCDIR)"; \
   6.107 +	      echo "KERNELOUTPUT := $(PWD)/$(LINUX_DIR)"; \
   6.108 +	      echo ""; \
   6.109 +	      echo "MAKEFLAGS += --no-print-directory"; \
   6.110 +	      echo ""; \
   6.111 +	      echo ".PHONY: all \$$(MAKECMDGOALS)"; \
   6.112 +	      echo ""; \
   6.113 +	      echo "all:"; \
   6.114 +	      echo "	\$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
   6.115 +	      echo ""; \
   6.116 +	      echo "Makefile:;"; \
   6.117 +	      echo ""; \
   6.118 +	      echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
   6.119 +	      echo "	\$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
   6.120 +	    ) > $(LINUX_DIR)/Makefile ; \
   6.121 +	fi
   6.122  
   6.123  .PHONY: prep
   6.124  prep: $(LINUX_DIR)/include/linux/autoconf.h
   6.125 @@ -67,12 +106,11 @@ clean::
   6.126  	[ ! -d $(LINUX_DIR) ] || \
   6.127  		$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
   6.128  
   6.129 -
   6.130  .PHONY: delete
   6.131  delete: 
   6.132  	rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
   6.133  
   6.134 -.PHONY: mrpropper
   6.135 -mrpropper:
   6.136 +.PHONY: mrproper
   6.137 +mrproper:
   6.138  	rm -rf $(LINUX_SRCDIR)
   6.139  	rm -f linux-$(LINUX_VER).tar.bz2
     7.1 --- a/buildconfigs/mk.linux-2.6-xen0	Fri May 25 10:53:07 2007 +0100
     7.2 +++ b/buildconfigs/mk.linux-2.6-xen0	Fri May 25 11:03:40 2007 +0100
     7.3 @@ -1,2 +1,2 @@
     7.4 -EXTRAVERSION = xen0
     7.5 +EXTRAVERSION = -xen0
     7.6  include buildconfigs/mk.linux-2.6-xen
     8.1 --- a/buildconfigs/mk.linux-2.6-xenU	Fri May 25 10:53:07 2007 +0100
     8.2 +++ b/buildconfigs/mk.linux-2.6-xenU	Fri May 25 11:03:40 2007 +0100
     8.3 @@ -1,2 +1,2 @@
     8.4 -EXTRAVERSION = xenU
     8.5 +EXTRAVERSION = -xenU
     8.6  include buildconfigs/mk.linux-2.6-xen
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/buildconfigs/mk.linux-2.6.5-SLES-xen	Fri May 25 11:03:40 2007 +0100
     9.3 @@ -0,0 +1,12 @@
     9.4 +# This tree only supports PAE
     9.5 +XEN_TARGET_ARCH = x86_32
     9.6 +XEN_TARGET_X86_PAE = y
     9.7 +
     9.8 +EXTRAVERSION = -xen
     9.9 +LINUX_VER = 2.6.5-SLES
    9.10 +
    9.11 +XEN_LINUX_SOURCE = hg-clone
    9.12 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/sles9x.hg
    9.13 +XEN_LINUX_HGREV  ?= tip
    9.14 +
    9.15 +include buildconfigs/mk.linux-2.6-xen
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/buildconfigs/mk.linux-2.6.9-RHEL-xen	Fri May 25 11:03:40 2007 +0100
    10.3 @@ -0,0 +1,12 @@
    10.4 +# This tree only supports PAE
    10.5 +XEN_TARGET_ARCH = x86_32
    10.6 +XEN_TARGET_X86_PAE = y
    10.7 +
    10.8 +EXTRAVERSION = -xen
    10.9 +LINUX_VER = 2.6.9-RHEL
   10.10 +
   10.11 +XEN_LINUX_SOURCE = hg-clone
   10.12 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/rhel4x.hg
   10.13 +XEN_LINUX_HGREV  ?= tip
   10.14 +
   10.15 +include buildconfigs/mk.linux-2.6-xen
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/buildconfigs/src.hg-clone	Fri May 25 11:03:40 2007 +0100
    11.3 @@ -0,0 +1,26 @@
    11.4 +# Main repository to clone.
    11.5 +XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/linux-$(LINUX_VER)-xen.hg
    11.6 +
    11.7 +# Set this to pull additional changesets from a second source.
    11.8 +
    11.9 +# This can be useful if you use a local mirror for XEN_LINUX_HGREPO
   11.10 +# (to reduce time spent cloning) but still want to pull the very
   11.11 +# latest changesets from xenbits.
   11.12 +XEN_LINUX_HGUPDATES ?=
   11.13 +
   11.14 +# Set this to update to a particlar revision.
   11.15 +XEN_LINUX_HGREV  ?=
   11.16 +
   11.17 +LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
   11.18 +
   11.19 +$(LINUX_SRCDIR)/.valid-src:
   11.20 +	if [ ! -d $(LINUX_SRCDIR) ] ; then \
   11.21 +	    hg clone $(XEN_LINUX_HGREPO) $(LINUX_SRCDIR) ; \
   11.22 +	fi
   11.23 +	if [ -n "$(XEN_LINUX_HGUPDATES)" ] ; then \
   11.24 +	    hg pull -R $(LINUX_SRCDIR) $(XEN_LINUX_HGUPDATES) ; \
   11.25 +	fi
   11.26 +	if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
   11.27 +	    hg update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
   11.28 +	fi
   11.29 +	touch $@
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/buildconfigs/src.sparse	Fri May 25 11:03:40 2007 +0100
    12.3 @@ -0,0 +1,76 @@
    12.4 +# Choose the best mirror to download linux kernel
    12.5 +KERNEL_REPO = http://www.kernel.org
    12.6 +
    12.7 +LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen
    12.8 +
    12.9 +# Setup pristine search path
   12.10 +PRISTINE_SRC_PATH	?= .:..
   12.11 +vpath pristine-% $(PRISTINE_SRC_PATH)
   12.12 +
   12.13 +# Setup Linux search path
   12.14 +LINUX_SRC_PATH	?= .:..
   12.15 +vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
   12.16 +vpath patch-%.bz2 $(LINUX_SRC_PATH)
   12.17 +
   12.18 +# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
   12.19 +linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
   12.20 +linux-%.tar.bz2:
   12.21 +	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
   12.22 +	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
   12.23 +
   12.24 +patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
   12.25 +patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
   12.26 +patch-%.bz2:
   12.27 +	@echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
   12.28 +	wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
   12.29 +
   12.30 +pristine-%: pristine-%/.valid-pristine
   12.31 +	@true
   12.32 +
   12.33 +pristine-%/.valid-pristine: %.tar.bz2
   12.34 +	rm -rf tmp-pristine-$* $(@D)
   12.35 +	mkdir -p tmp-pristine-$*
   12.36 +	tar -C tmp-pristine-$* -jxf $<
   12.37 +	-@rm -f tmp-pristine-$*/pax_global_header
   12.38 +	mv tmp-pristine-$*/* $(@D)
   12.39 +	@rm -rf tmp-pristine-$*
   12.40 +	touch $(@D)/.hgskip
   12.41 +	touch $@ # update timestamp to avoid rebuild
   12.42 +
   12.43 +PATCHDIRS := $(wildcard patches/*-*)
   12.44 +
   12.45 +ifneq ($(PATCHDIRS),)
   12.46 +-include $(patsubst %,%/.makedep,$(PATCHDIRS))
   12.47 +
   12.48 +$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
   12.49 +	@echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
   12.50 +
   12.51 +ref-%/.valid-ref: pristine-%/.valid-pristine
   12.52 +	set -e
   12.53 +	rm -rf $(@D)
   12.54 +	cp -al $(<D) $(@D)
   12.55 +	if [ -d patches/$* ] ; then                                    \
   12.56 +	    echo Applying patches from patches/$*... ;                 \
   12.57 +	    for i in $$(cat patches/$*/series) ; do                    \
   12.58 +	        echo ... $$i ;                                         \
   12.59 +	        patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
   12.60 +	     done ;                                                    \
   12.61 +	fi
   12.62 +	touch $@ # update timestamp to avoid rebuild
   12.63 +endif
   12.64 +
   12.65 +$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
   12.66 +	rm -rf $(LINUX_SRCDIR)
   12.67 +	cp -al $(<D) $(LINUX_SRCDIR)
   12.68 +	# Apply arch-xen patches
   12.69 +	( cd linux-$(LINUX_SERIES)-xen-sparse && \
   12.70 +          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
   12.71 +	( cd $(LINUX_SRCDIR) && [ -e buildconfigs ] || ln -s $(PWD)/buildconfigs buildconfigs )
   12.72 +	touch $@
   12.73 +
   12.74 +linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
   12.75 +	rm -rf tmp-$@
   12.76 +	cp -al $(<D) tmp-$@
   12.77 +	( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
   12.78 +	diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
   12.79 +	rm -rf tmp-$@
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/buildconfigs/src.tarball	Fri May 25 11:03:40 2007 +0100
    13.3 @@ -0,0 +1,25 @@
    13.4 +XEN_LINUX_MIRROR ?= http://www.kernel.org/pub/linux/kernel/v2.6/
    13.5 +XEN_LINUX_TARBALL ?= linux-$(LINUX_VER)-xen.tar.bz2
    13.6 +
    13.7 +LINUX_SRCDIR ?= linux-$(LINUX_VER)
    13.8 +
    13.9 +# Setup Linux search path
   13.10 +LINUX_SRC_PATH	?= .:..
   13.11 +vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
   13.12 +
   13.13 +# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
   13.14 +linux-%.tar.bz2:
   13.15 +	@echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
   13.16 +	wget $(XEN_LINUX_MIRROR)/$@ -O./$@
   13.17 +
   13.18 +# XXX create a pristine tree for diff -Nurp convenience
   13.19 +
   13.20 +%/.valid-src: %.tar.bz2
   13.21 +	rm -rf tmp-linux-$* $(@D)
   13.22 +	mkdir -p tmp-linux-$*
   13.23 +	tar -C tmp-linux-$* -jxf $<
   13.24 +	-@rm -f tmp-linux-$*/pax_global_header
   13.25 +	mv tmp-linux-$*/* $(@D)
   13.26 +	@rm -rf tmp-linux-$*
   13.27 +	touch $(@D)/.hgskip
   13.28 +	touch $@ # update timestamp to avoid rebuild
    14.1 --- a/linux-2.6-xen-sparse/arch/i386/Makefile	Fri May 25 10:53:07 2007 +0100
    14.2 +++ b/linux-2.6-xen-sparse/arch/i386/Makefile	Fri May 25 11:03:40 2007 +0100
    14.3 @@ -125,7 +125,7 @@ vmlinuz: vmlinux
    14.4  	$(Q)$(MAKE) $(build)=$(boot) $@
    14.5  
    14.6  install:
    14.7 -	$(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
    14.8 +	$(Q)$(MAKE) $(build)=$(boot) $@
    14.9  else
   14.10  all: bzImage
   14.11  
    15.1 --- a/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile	Fri May 25 10:53:07 2007 +0100
    15.2 +++ b/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile	Fri May 25 11:03:40 2007 +0100
    15.3 @@ -12,10 +12,8 @@ INSTALL_ROOT := $(patsubst %/boot,%,$(IN
    15.4  XINSTALL_NAME ?= $(KERNELRELEASE)
    15.5  install:
    15.6  	mkdir -p $(INSTALL_ROOT)/boot
    15.7 -	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
    15.8 -	rm -f $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
    15.9  	install -m0644 vmlinuz $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
   15.10  	install -m0644 vmlinux $(INSTALL_ROOT)/boot/vmlinux-syms-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
   15.11  	install -m0664 .config $(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
   15.12  	install -m0664 System.map $(INSTALL_ROOT)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
   15.13 -	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
   15.14 +	ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(shell [ -e $(objtree)/localversion-xen ] && cat $(objtree)/localversion-xen)$(INSTALL_SUFFIX)
    16.1 --- a/linux-2.6-xen-sparse/arch/x86_64/Makefile	Fri May 25 10:53:07 2007 +0100
    16.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/Makefile	Fri May 25 11:03:40 2007 +0100
    16.3 @@ -91,7 +91,7 @@ vmlinuz: vmlinux
    16.4  	$(Q)$(MAKE) $(build)=$(boot) $@
    16.5  
    16.6  install:
    16.7 -	$(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
    16.8 +	$(Q)$(MAKE) $(build)=$(boot) $@
    16.9  else
   16.10  #Default target when executing "make"
   16.11  all: bzImage