[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Factor out sparse tree makefile fragments and introduce hg-clone and



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1180087420 -3600
# Node ID 3fcd0b9fd083aca0bbf2be6085269e39434308c6
# Parent  a717cb2fac908ba82619ba52e34a2cc77942df4f
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@xxxxxxxxxxxxx>
---
 .hgignore                                        |    1 
 buildconfigs/Rules.mk                            |   94 ---------------------
 buildconfigs/create_config.sh                    |    7 +
 buildconfigs/mk.linux-2.6-native                 |    2 
 buildconfigs/mk.linux-2.6-paravirt               |   11 ++
 buildconfigs/mk.linux-2.6-xen                    |  102 +++++++++++++++--------
 buildconfigs/mk.linux-2.6-xen0                   |    2 
 buildconfigs/mk.linux-2.6-xenU                   |    2 
 buildconfigs/mk.linux-2.6.5-SLES-xen             |   12 ++
 buildconfigs/mk.linux-2.6.9-RHEL-xen             |   12 ++
 buildconfigs/src.hg-clone                        |   26 +++++
 buildconfigs/src.sparse                          |   76 +++++++++++++++++
 buildconfigs/src.tarball                         |   25 +++++
 linux-2.6-xen-sparse/arch/i386/Makefile          |    2 
 linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile |    4 
 linux-2.6-xen-sparse/arch/x86_64/Makefile        |    2 
 16 files changed, 247 insertions(+), 133 deletions(-)

diff -r a717cb2fac90 -r 3fcd0b9fd083 .hgignore
--- a/.hgignore Fri May 25 10:53:07 2007 +0100
+++ b/.hgignore Fri May 25 11:03:40 2007 +0100
@@ -66,6 +66,7 @@
 ^linux-[^/]*-xen/.*$
 ^linux-[^/]*-xen0/.*$
 ^linux-[^/]*-xenU/.*$
+^linux-[^/]*-paravirt/.*$
 ^linux-[^/]*\.patch$
 ^mkddbxen$
 ^netbsd-[^/]*-tools/.*$
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/Rules.mk
--- a/buildconfigs/Rules.mk     Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/Rules.mk     Fri May 25 11:03:40 2007 +0100
@@ -3,78 +3,8 @@ include Config.mk
 
 export DESTDIR
 
-# Choose the best mirror to download linux kernel
-KERNEL_REPO = http://www.kernel.org
-
 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
-
-# Setup pristine search path
-PRISTINE_SRC_PATH      ?= .:..
-vpath pristine-% $(PRISTINE_SRC_PATH)
-
-# Let XEN_TARGET_ARCH override ARCH.
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-LINUX_ARCH     ?= i386
-else
-LINUX_ARCH     ?= $(XEN_TARGET_ARCH)
-endif
-
-# Expand Linux series to Linux version
-LINUX_SERIES   ?= 2.6
-LINUX_VER      ?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | 
sed -e 's/.*=[ ]*//')
-
-# Setup Linux search path
-LINUX_SRC_PATH ?= .:..
-vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
-vpath patch-%.bz2 $(LINUX_SRC_PATH)
-
-# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
-linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 
2,$(subst ., ,$*))
-linux-%.tar.bz2:
-       @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
-       wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
-
-patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 
2,$(subst ., ,$(*F)))
-patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, 
,$(*F))),snapshots,testing)
-patch-%.bz2:
-       @echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
-       wget 
$(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
-
-pristine-%: pristine-%/.valid-pristine
-       @true
-
-pristine-%/.valid-pristine: %.tar.bz2
-       rm -rf tmp-pristine-$* $(@D)
-       mkdir -p tmp-pristine-$*
-       tar -C tmp-pristine-$* -jxf $<
-       -@rm -f tmp-pristine-$*/pax_global_header
-       mv tmp-pristine-$*/* $(@D)
-       @rm -rf tmp-pristine-$*
-       touch $(@D)/.hgskip
-       touch $@ # update timestamp to avoid rebuild
-
-PATCHDIRS := $(wildcard patches/*-*)
-
-ifneq ($(PATCHDIRS),)
--include $(patsubst %,%/.makedep,$(PATCHDIRS))
-
-$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
-       @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
-
-ref-%/.valid-ref: pristine-%/.valid-pristine
-       set -e
-       rm -rf $(@D)
-       cp -al $(<D) $(@D)
-       if [ -d patches/$* ] ; then                                    \
-           echo Applying patches from patches/$*... ;                 \
-           for i in $$(cat patches/$*/series) ; do                    \
-               echo ... $$i ;                                         \
-               patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
-            done ;                                                    \
-       fi
-       touch $@ # update timestamp to avoid rebuild
-endif
 
 %-install:
        $(MAKE) -f buildconfigs/mk.$* build
@@ -101,32 +31,13 @@ endif
 %-clean:
        $(MAKE) -f buildconfigs/mk.$* clean
 
-linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
-       rm -rf tmp-$@
-       cp -al $(<D) tmp-$@
-       ( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )     
-       diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
-       rm -rf tmp-$@
-
-%-xen.patch: ref-%/.valid-ref
-       rm -rf tmp-$@
-       cp -al $(<D) tmp-$@
-       ( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )    
-       diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
-       rm -rf tmp-$@
+%.patch:
+       $(MAKE) -f buildconfigs/mk.$* $@
 
 %-mrproper:
-       $(MAKE) -f buildconfigs/mk.$*-xen mrpropper
+       $(MAKE) -f buildconfigs/mk.$*-xen mrproper
        rm -rf pristine-$(*)* ref-$(*)*
        rm -rf $*-xen.patch
 
-.PHONY: config-update-pae
-config-update-pae:
-ifeq ($(XEN_TARGET_X86_PAE),y)
-       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)
-else
-       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
-endif
-
 # never delete any intermediate files.
 .SECONDARY:
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/create_config.sh
--- a/buildconfigs/create_config.sh     Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/create_config.sh     Fri May 25 11:03:40 2007 +0100
@@ -18,23 +18,26 @@ systype=$4
 # Start with initial config skeleton file, if any.
 # Derive from linux-defconfig_xen_x86_32 otherwise.
 #
-skeleton=buildconfigs/linux-defconfig_${extraversion}_${target_arch}${systype}
+skeleton=buildconfigs/linux-defconfig_${extraversion#-}_${target_arch}${systype}
 [ -r $skeleton ] || skeleton=buildconfigs/linux-defconfig_xen_x86_32
 [ -r $skeleton.local ] && skeleton=$skeleton.local
 cp $skeleton $config_file
 
+echo "Using $skeleton as base config"
 
 # Update
 #
 filter_template="s/^#\{0,1\} *\(CONFIG[^= ]*\).*/\/^#\\\{0,1\\\} *\1[= 
].*\/d/p"
-config_dirs="buildconfigs/conf.linux buildconfigs/conf.linux-${target_arch} 
buildconfigs/conf.linux-${extraversion} 
buildconfigs/conf.linux-${target_arch}-${extraversion}"
+config_dirs="buildconfigs/conf.linux buildconfigs/conf.linux-${target_arch} 
buildconfigs/conf.linux${extraversion} 
buildconfigs/conf.linux-${target_arch}${extraversion}"
 
 for config_dir in $config_dirs
 do
     if [ -d $config_dir ]; then
+        echo "Processing $config_dir..." 1>&2
         # processing is done in alphanumeric order
         find $config_dir -type f | sort | while read update
         do
+            echo "   ... $update" 1>&2
             # create the filter rules in a temp file
             filter_rules=`mktemp -t xenupdateconf.XXXXXXXXXX`
             sed -n "${filter_template}" < $update > $filter_rules
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6-native
--- a/buildconfigs/mk.linux-2.6-native  Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/mk.linux-2.6-native  Fri May 25 11:03:40 2007 +0100
@@ -1,4 +1,4 @@ EXTRAVERSION = native
-EXTRAVERSION = native
+EXTRAVERSION = -native
 IMAGE_TARGET = bzImage
 INSTALL_BOOT_PATH = $(DESTDIR)/boot
 include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6-paravirt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/mk.linux-2.6-paravirt        Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,11 @@
+XEN_LINUX_SOURCE ?= tarball
+XEN_LINUX_MIRROR ?= http://xenbits.xensource.com/ext/paravirt_ops/
+LINUX_VER ?= 2.6-paravirt
+
+# This target currently only supports x86_32.
+XEN_TARGET_ARCH = x86_32
+IMAGE_TARGET ?= vmlinux bzImage
+
+EXTRAVERSION ?=
+
+include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6-xen
--- a/buildconfigs/mk.linux-2.6-xen     Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/mk.linux-2.6-xen     Fri May 25 11:03:40 2007 +0100
@@ -1,21 +1,28 @@ LINUX_SERIES = 2.6
 LINUX_SERIES = 2.6
-LINUX_VER    = 2.6.18
+LINUX_VER    ?= 2.6.18
 
-EXTRAVERSION ?= xen
+EXTRAVERSION ?= -xen
 
-LINUX_SRCDIR = linux-$(LINUX_VER)-xen
-LINUX_DIR    = build-linux-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
+XEN_LINUX_SOURCE ?= sparse
+
+# Let XEN_TARGET_ARCH override ARCH.
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+LINUX_ARCH     ?= i386
+else
+LINUX_ARCH     ?= $(XEN_TARGET_ARCH)
+endif
+
+LINUX_DIR     = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
 
 IMAGE_TARGET ?= vmlinuz
-INSTALL_BOOT_PATH ?= $(DESTDIR)
-
-ifeq ($(XEN_TARGET_ARCH),ia64)
 INSTALL_BOOT_PATH := $(DESTDIR)/boot
-endif
 
 LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
 
-include buildconfigs/Rules.mk
+.PHONY: _build
+_build: build
+
+include buildconfigs/src.$(XEN_LINUX_SOURCE)
 
 # The real action starts here!
 .PHONY: build
@@ -28,31 +35,63 @@ build: $(LINUX_DIR)/include/linux/autoco
        mkdir -p $(INSTALL_BOOT_PATH)
        $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) 
INSTALL_PATH=$(INSTALL_BOOT_PATH) install
 
-$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
-       rm -rf $(LINUX_SRCDIR)
-       cp -al $(<D) $(LINUX_SRCDIR)
-       # Apply arch-xen patches
-       ( cd linux-$(LINUX_SERIES)-xen-sparse && \
-          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
-       # Patch kernel Makefile to set EXTRAVERSION
-       ( cd $(LINUX_SRCDIR) ; \
-         sed -e 's,^EXTRAVERSION.*,&$$(XENGUEST),' \
-             -e 's,^KERNELRELEASE,XENGUEST := $$(shell [ -r 
$$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; 
\
-         rm -f Makefile ; mv Mk.tmp Makefile )
-       touch $@
-
+$(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(PWD)/$(LINUX_DIR)/.config
 $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
        rm -rf $(LINUX_DIR)
        mkdir -p $(LINUX_DIR)
-       # Re-use config from install dir if one exits else use default config
+       # Re-use config from install dir if one exists. Next try to use
+       # buildconfigs/create_config.sh is one is provided by the source
+       # tree. Finally attempt to use make defconfig.
+       set -e ; \
        CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' 
$(LINUX_SRCDIR)/Makefile); \
-       [ -r 
$(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
-         cp 
$(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) 
$(LINUX_DIR)/.config \
-         || sh buildconfigs/create_config.sh $(LINUX_DIR)/.config 
$(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE)
-       # See if we need to munge config to enable PAE
-       $(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk 
config-update-pae
-       echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest
+       if [ -r 
$(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) ] ; then \
+         cp 
$(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION$(EXTRAVERSION) 
$(CONFIG_FILE) ; \
+        elif [ -e $(LINUX_SRCDIR)/buildconfigs/create_config.sh ] ; then \
+         cd $(LINUX_SRCDIR) && sh buildconfigs/create_config.sh \
+               $(CONFIG_FILE) $(EXTRAVERSION) $(XEN_TARGET_ARCH) 
$(XEN_SYSTYPE) ; \
+          echo "Configured $(LINUX_DIR) using create_config.sh" ; \
+       elif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) defconfig 
O=$$(/bin/pwd)/$(LINUX_DIR) ; then \
+         echo "Configured $(LINUX_DIR) using defconfig" ; \
+       else \
+          echo "No configuration method found for this kernel" ; \
+       fi
+ifeq ($(XEN_TARGET_ARCH),x86_32)
+ifeq ($(pae),y)
+       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)
+else
+       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
+endif
+endif
+ifneq ($(EXTRAVERSION),)
+       echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen
+endif
        $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig 
O=$$(/bin/pwd)/$(LINUX_DIR)
+       @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \
+           echo "***********************************"; \
+           echo "oldconfig did not create a Makefile"; \
+           echo "Generating $(LINUX_DIR)/Makefile   "; \
+           echo "***********************************"; \
+           ( echo "# Automatically generated: don't edit"; \
+             echo ""; \
+             echo "VERSION = 2"; \
+             echo "PATCHLEVEL = 6"; \
+             echo ""; \
+             echo "KERNELSRC    := $(PWD)/$(LINUX_SRCDIR)"; \
+             echo "KERNELOUTPUT := $(PWD)/$(LINUX_DIR)"; \
+             echo ""; \
+             echo "MAKEFLAGS += --no-print-directory"; \
+             echo ""; \
+             echo ".PHONY: all \$$(MAKECMDGOALS)"; \
+             echo ""; \
+             echo "all:"; \
+             echo "    \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT)"; \
+             echo ""; \
+             echo "Makefile:;"; \
+             echo ""; \
+             echo "\$$(filter-out all Makefile,\$$(MAKECMDGOALS)) %/:"; \
+             echo "    \$$(MAKE) -C \$$(KERNELSRC) O=\$$(KERNELOUTPUT) \$$@"; \
+           ) > $(LINUX_DIR)/Makefile ; \
+       fi
 
 .PHONY: prep
 prep: $(LINUX_DIR)/include/linux/autoconf.h
@@ -67,12 +106,11 @@ clean::
        [ ! -d $(LINUX_DIR) ] || \
                $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
 
-
 .PHONY: delete
 delete: 
        rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR) 
 
-.PHONY: mrpropper
-mrpropper:
+.PHONY: mrproper
+mrproper:
        rm -rf $(LINUX_SRCDIR)
        rm -f linux-$(LINUX_VER).tar.bz2
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6-xen0
--- a/buildconfigs/mk.linux-2.6-xen0    Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/mk.linux-2.6-xen0    Fri May 25 11:03:40 2007 +0100
@@ -1,2 +1,2 @@ EXTRAVERSION = xen0
-EXTRAVERSION = xen0
+EXTRAVERSION = -xen0
 include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6-xenU
--- a/buildconfigs/mk.linux-2.6-xenU    Fri May 25 10:53:07 2007 +0100
+++ b/buildconfigs/mk.linux-2.6-xenU    Fri May 25 11:03:40 2007 +0100
@@ -1,2 +1,2 @@ EXTRAVERSION = xenU
-EXTRAVERSION = xenU
+EXTRAVERSION = -xenU
 include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6.5-SLES-xen
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/mk.linux-2.6.5-SLES-xen      Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,12 @@
+# This tree only supports PAE
+XEN_TARGET_ARCH = x86_32
+XEN_TARGET_X86_PAE = y
+
+EXTRAVERSION = -xen
+LINUX_VER = 2.6.5-SLES
+
+XEN_LINUX_SOURCE = hg-clone
+XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/sles9x.hg
+XEN_LINUX_HGREV  ?= tip
+
+include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/mk.linux-2.6.9-RHEL-xen
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/mk.linux-2.6.9-RHEL-xen      Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,12 @@
+# This tree only supports PAE
+XEN_TARGET_ARCH = x86_32
+XEN_TARGET_X86_PAE = y
+
+EXTRAVERSION = -xen
+LINUX_VER = 2.6.9-RHEL
+
+XEN_LINUX_SOURCE = hg-clone
+XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/kernels/rhel4x.hg
+XEN_LINUX_HGREV  ?= tip
+
+include buildconfigs/mk.linux-2.6-xen
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/src.hg-clone
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/src.hg-clone Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,26 @@
+# Main repository to clone.
+XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/linux-$(LINUX_VER)-xen.hg
+
+# Set this to pull additional changesets from a second source.
+
+# This can be useful if you use a local mirror for XEN_LINUX_HGREPO
+# (to reduce time spent cloning) but still want to pull the very
+# latest changesets from xenbits.
+XEN_LINUX_HGUPDATES ?=
+
+# Set this to update to a particlar revision.
+XEN_LINUX_HGREV  ?=
+
+LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
+
+$(LINUX_SRCDIR)/.valid-src:
+       if [ ! -d $(LINUX_SRCDIR) ] ; then \
+           hg clone $(XEN_LINUX_HGREPO) $(LINUX_SRCDIR) ; \
+       fi
+       if [ -n "$(XEN_LINUX_HGUPDATES)" ] ; then \
+           hg pull -R $(LINUX_SRCDIR) $(XEN_LINUX_HGUPDATES) ; \
+       fi
+       if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
+           hg update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
+       fi
+       touch $@
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/src.sparse
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/src.sparse   Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,76 @@
+# Choose the best mirror to download linux kernel
+KERNEL_REPO = http://www.kernel.org
+
+LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen
+
+# Setup pristine search path
+PRISTINE_SRC_PATH      ?= .:..
+vpath pristine-% $(PRISTINE_SRC_PATH)
+
+# Setup Linux search path
+LINUX_SRC_PATH ?= .:..
+vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
+vpath patch-%.bz2 $(LINUX_SRC_PATH)
+
+# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
+linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 
2,$(subst ., ,$*))
+linux-%.tar.bz2:
+       @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
+       wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
+
+patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 
2,$(subst ., ,$(*F)))
+patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, 
,$(*F))),snapshots,testing)
+patch-%.bz2:
+       @echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
+       wget 
$(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
+
+pristine-%: pristine-%/.valid-pristine
+       @true
+
+pristine-%/.valid-pristine: %.tar.bz2
+       rm -rf tmp-pristine-$* $(@D)
+       mkdir -p tmp-pristine-$*
+       tar -C tmp-pristine-$* -jxf $<
+       -@rm -f tmp-pristine-$*/pax_global_header
+       mv tmp-pristine-$*/* $(@D)
+       @rm -rf tmp-pristine-$*
+       touch $(@D)/.hgskip
+       touch $@ # update timestamp to avoid rebuild
+
+PATCHDIRS := $(wildcard patches/*-*)
+
+ifneq ($(PATCHDIRS),)
+-include $(patsubst %,%/.makedep,$(PATCHDIRS))
+
+$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
+       @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
+
+ref-%/.valid-ref: pristine-%/.valid-pristine
+       set -e
+       rm -rf $(@D)
+       cp -al $(<D) $(@D)
+       if [ -d patches/$* ] ; then                                    \
+           echo Applying patches from patches/$*... ;                 \
+           for i in $$(cat patches/$*/series) ; do                    \
+               echo ... $$i ;                                         \
+               patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
+            done ;                                                    \
+       fi
+       touch $@ # update timestamp to avoid rebuild
+endif
+
+$(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
+       rm -rf $(LINUX_SRCDIR)
+       cp -al $(<D) $(LINUX_SRCDIR)
+       # Apply arch-xen patches
+       ( cd linux-$(LINUX_SERIES)-xen-sparse && \
+          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
+       ( cd $(LINUX_SRCDIR) && [ -e buildconfigs ] || ln -s 
$(PWD)/buildconfigs buildconfigs )
+       touch $@
+
+linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
+       rm -rf tmp-$@
+       cp -al $(<D) tmp-$@
+       ( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
+       diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
+       rm -rf tmp-$@
diff -r a717cb2fac90 -r 3fcd0b9fd083 buildconfigs/src.tarball
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/buildconfigs/src.tarball  Fri May 25 11:03:40 2007 +0100
@@ -0,0 +1,25 @@
+XEN_LINUX_MIRROR ?= http://www.kernel.org/pub/linux/kernel/v2.6/
+XEN_LINUX_TARBALL ?= linux-$(LINUX_VER)-xen.tar.bz2
+
+LINUX_SRCDIR ?= linux-$(LINUX_VER)
+
+# Setup Linux search path
+LINUX_SRC_PATH ?= .:..
+vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
+
+# download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
+linux-%.tar.bz2:
+       @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
+       wget $(XEN_LINUX_MIRROR)/$@ -O./$@
+
+# XXX create a pristine tree for diff -Nurp convenience
+
+%/.valid-src: %.tar.bz2
+       rm -rf tmp-linux-$* $(@D)
+       mkdir -p tmp-linux-$*
+       tar -C tmp-linux-$* -jxf $<
+       -@rm -f tmp-linux-$*/pax_global_header
+       mv tmp-linux-$*/* $(@D)
+       @rm -rf tmp-linux-$*
+       touch $(@D)/.hgskip
+       touch $@ # update timestamp to avoid rebuild
diff -r a717cb2fac90 -r 3fcd0b9fd083 linux-2.6-xen-sparse/arch/i386/Makefile
--- a/linux-2.6-xen-sparse/arch/i386/Makefile   Fri May 25 10:53:07 2007 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/Makefile   Fri May 25 11:03:40 2007 +0100
@@ -125,7 +125,7 @@ vmlinuz: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) $@
 
 install:
-       $(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
+       $(Q)$(MAKE) $(build)=$(boot) $@
 else
 all: bzImage
 
diff -r a717cb2fac90 -r 3fcd0b9fd083 
linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile
--- a/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile  Fri May 25 10:53:07 
2007 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/boot-xen/Makefile  Fri May 25 11:03:40 
2007 +0100
@@ -12,10 +12,8 @@ XINSTALL_NAME ?= $(KERNELRELEASE)
 XINSTALL_NAME ?= $(KERNELRELEASE)
 install:
        mkdir -p $(INSTALL_ROOT)/boot
-       ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) 
$(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
-       rm -f $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        install -m0644 vmlinuz 
$(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        install -m0644 vmlinux 
$(INSTALL_ROOT)/boot/vmlinux-syms-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        install -m0664 .config 
$(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
        install -m0664 System.map 
$(INSTALL_ROOT)/boot/System.map-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
-       ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) 
$(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(XENGUEST)$(INSTALL_SUFFIX)
+       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)
diff -r a717cb2fac90 -r 3fcd0b9fd083 linux-2.6-xen-sparse/arch/x86_64/Makefile
--- a/linux-2.6-xen-sparse/arch/x86_64/Makefile Fri May 25 10:53:07 2007 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/Makefile Fri May 25 11:03:40 2007 +0100
@@ -91,7 +91,7 @@ vmlinuz: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) $@
 
 install:
-       $(Q)$(MAKE) $(build)=$(boot) XENGUEST=$(XENGUEST) $@
+       $(Q)$(MAKE) $(build)=$(boot) $@
 else
 #Default target when executing "make"
 all: bzImage

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.