> Various build clean-ups
>
> This is a fairly chunky patch to clean up the build a bit.
> Please let me know if you would like any portions ommited, or
> broken out.
This is generally good stuff, but build system changes this close to a
release are just asking for trouble. Could you split out any actual
fixes and repost the rest in a week or so?
Thanks,
Ian
> Also, I am left with two questions
> 1. Should buildconfigs/{mk.linux-2.6-xen0,mk.linux-2.6-xenU}
> be removed?
> 2. Should the NETBSD portions (of buildconfigs/Rules.mk) be removed?
>
> Changes
> -------
>
> Python
> * Make sure that DESTDIR is set, otherwise, if
> XEN_PYTHON_NATIVE_INSTALL then python installs go into a relative
> directory, rather then under the default prefix (usually /usr)
> This is done by setting it if unset in Config.mk
>
> .PHONY
> * Move .PHONY directives next to targets, this makes them a lot easier
> to miss
> * Add missing .PHONY directives
>
> Dependency installation targets
> * Expand out install-iptables and install-logging into
> build-, install-, dist-, clean- and distclean-
> to make them consistent with other targets
> * Call distclean-iptables and distclean-logging from distclean,
> so distclean really cleans the tree, even if the logging or
> iptables targets have been used
>
> Iptables
> * Upgrade iptables from 1.2.11 to 1.3.5, as the
> former does not seem to compile with linux-2.6.16
> * Update iptables download URL from http://www.netfilter.org/files to
> http://www.netfilter.org/projects/iptables/files/
> * Make iptables targets depend on prep-kernels,
> as the kernel needs to be there for some components of iptables
> It will still build without the kernel, however, the build
> will differ depending on if prep-kernels had previously been
> called or not
> * Update domU kernel dir from linux-$(LINUX_VER)-xenU to
> linux-$(LINUX_VER)-xen
>
> Documentation
> * Tidy up output of make help
> * Document the use of the XEN_PYTHON_NATIVE_INSTALL
> environment variable
>
> Kernels
> * Don''t delete non-existent %.tar.bz2 in
> buildconfigs/Rules.mk''s %-mrproper
> * Add a mrpropper target to buildconfigs/mk.linux-2.6-xen, and
> have this delete the local patch and tarball
> * Make distclean depend on kclean, rather than calling clean
> target by hand
> * Stop kclean from erroring out if the kernel directory doesn''t
exist
> * Remove patches/*/.makedep in top level Makefile rather than in
> buildconfigs/Rules.mk, as calling rules in the latter causes
> patches/*/.make to be created
> (Magnus)
>
> Tar
> * Use --bzip2 instead of -j with tar, as its backwards compatible
>
> Download
> * Allow LINUX_REPO, NETBSD_REPO, PYTHON_LOGGING_REPO and IPTABLES_REPO
> to specify the URL of the repository for the linux kernel,
> netbsd kernel, python logging package and iptables
> - Defaults are:
> LINUX_REPO http://www.kernel.org/pub/linux/kernel/
> NETBSD_REPO
> http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads
> PYTHON_LOGGING_REPO http://www.red-dove.com
> IPTABLES_REPO
> http://www.netfilter.org/projects/iptables/files
> * Allow each of these variables to be overridden in the environment
> * With the exception of LINUX_REPO, the URL should be the full
> path to the tarball.
> * For LINUX_REPO it should be the path, trimmed to give a structure
> equivalent to http://www.kernel.org/pub/linux/kernel/
> - The kernel tarball will be downloaded from
> $(LINUX_REPO)/v$(KERNEL_MAJOR).$(KERNEL_MINOR)/
> e.g. http://www.kernel.org/pub/linux/kernel/v2.6
> Where KERNEL_MAJOR and KERNEL_MINOR are calculated at runtime
> - The path of the tarball can be overridden using
> LINUX_REPO_KERNEL_PATH
> in the environment, in which case the tarball will be
> downloaded from
> $(LINUX_REPO)/v$(LINUX_REPO_KERNEL_PATH)/
> - If needed kernel patches will be downloaded from
> $(LINUX_REPO)/v$(KERNEL_MAJOR).$(KERNEL_MINOR)/snapshots
> if present, else
> $(LINUX_REPO)/v$(KERNEL_MAJOR).$(KERNEL_MINOR)/testing
> This will depend on the version of the patch
> - The path of the tarball can be overridden using
> LINUX_REPO_KERNEL_PATH
> in the environment, in which case the patch will be downloaded from
> $(LINUX_REPO)/v$(LINUX_REPO_PATCH_PATH)/
> - The intention of LINUX_REPO_KERNEL_PATH and LINUX_REPO_PATCH_PATH
> is to allow for sites that don''t follow the directory
hierarchy of
> kernel.org, while simplifying the presumably common case
> where they do
> * Previously KERNEL_REPO had similar properties to LINUX_REPO, but
> it was not as flexible, had a somewhat presumptuous name and could
> not be overridden in the environment. It has been removed
> * Allow DOWNLOAD_PATH to set a search path for previously
> downloaded files
> - Use the first element of the path as the directory to save
> downloaded files
> - Default is LINUX_SRC_PATH if set in environment, else .:..
> - Note that kclean-tarball, makedistlcean-* and friends
> intentionally only remove tarballs in the top level xen directory,
> regardless of the value of this variable. This is to allow
> more persistent storage of tarballs in a specified location,
> which cam be manually cleaned if desired.
>
> mkbuildtree
> * Don''t assume mkbuiltree scripts are executable
>
> pygryb
> * clean a.out
> (Magnus)
>
> Signed-Off-By: Horms <horms@verge.net.au>
> Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
>
> Config.mk | 15 +
> Makefile | 199
> +++++++++++++++++++++----
> buildconfigs/Rules.mk | 34 ++--
> buildconfigs/mk.linux-2.6-xen | 18 +-
> linux-2.6-xen-sparse/drivers/xen/Makefile | 26 +--
> linux-2.6-xen-sparse/drivers/xen/core/Makefile | 21 ++
> linux-2.6-xen-sparse/mkbuildtree | 8 -
> tools/debugger/gdb/gdbbuild | 2
> tools/misc/xen-clone | 2
> tools/pygrub/Makefile | 2
> 10 files changed, 256 insertions(+), 71 deletions(-)
>
> diff -r 40c23921e729 Config.mk
> --- a/Config.mk Mon Mar 27 18:03:03 2006 +0100
> +++ b/Config.mk Tue Mar 28 18:49:58 2006 +0900
> @@ -24,6 +24,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
> OBJDUMP = $(CROSS_COMPILE)objdump
>
> DISTDIR ?= $(XEN_ROOT)/dist
> +DESTDIR ?= /
>
> INSTALL = install
> INSTALL_DIR = $(INSTALL) -d -m0755
> @@ -68,7 +69,19 @@ CFLAGS += $(foreach i, $(EXTRA_INCLUDES)
> CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
>
> # Choose the best mirror to download linux kernel
> -KERNEL_REPO = http://www.kernel.org
> +DOWNLOAD_PATH_DEFAULT := .:..
> +ifdef LINUX_SRC_PATH
> +DOWNLOAD_PATH ?= $(LINUX_SRC_PATH) # Compatibility else
> DOWNLOAD_PATH
> +?= $(DOWNLOAD_PATH_DEFAULT) endif
> +DOWNLOAD_DIR := $(firstword $(subst :, ,$(DOWNLOAD_PATH)))
> +# LINUX_REPO_KERNEL_PATH Set in buildconfigs/Rules.mk, if not in
> +environment # LINUX_REPO_PATCH_PATH Set in
> buildconfigs/Rules.mk, if not in environment
> +LINUX_REPO ?= http://www.kernel.org/pub/linux/kernel/
> +NETBSD_REPO ?=
> http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads
> +PYTHON_LOGGING_REPO ?= http://www.red-dove.com IPTABLES_REPO ?=
> +http://www.netfilter.org/projects/iptables/files
>
> # If ACM_SECURITY = y, then the access control module is
> compiled # into Xen and the policy type can be set by the
> boot policy file diff -r 40c23921e729 Makefile
> --- a/Makefile Mon Mar 27 18:03:03 2006 +0100
> +++ b/Makefile Tue Mar 28 18:49:58 2006 +0900
> @@ -14,6 +14,7 @@ endif
> endif
>
> # Default target must appear before any include lines
> +.PHONY: all
> all: dist
>
> XEN_ROOT=$(CURDIR)
> @@ -24,12 +25,10 @@ export pae=y
> export pae=y
> endif
>
> -.PHONY: all dist install xen kernels tools dev-docs
> docs world clean
> -.PHONY: mkpatches mrproper kbuild kdelete kclean
> -
> # build and install everything into the standard system directories
> install: install-xen install-kernels install-tools install-docs
>
> +.PHONY: build
> build: kernels
> $(MAKE) -C xen build
> $(MAKE) -C tools build
> @@ -38,10 +37,12 @@ build: kernels
> # The test target is for unit tests that can run without an
> installation. Of # course, many tests require a machine
> running Xen itself, and these are # handled elsewhere.
> +.PHONY: test
> test:
> $(MAKE) -C tools/python test
>
> # build and install everything into local dist directory
> +.PHONY: dist
> dist: DESTDIR=$(DISTDIR)/install
> dist: dist-xen dist-kernels dist-tools dist-docs
> $(INSTALL_DIR) $(DISTDIR)/check
> @@ -54,79 +55,165 @@ dist-%: install-%
> @: # do nothing
>
> # Legacy dist targets
> +.PHONY: xen tools kernels docs
> xen: dist-xen
> tools: dist-tools
> kernels: dist-kernels
> docs: dist-docs
>
> +.PHONY: prep-kernels
> prep-kernels:
> for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
>
> +.PHONY: install-xen
> install-xen:
> $(MAKE) -C xen install
>
> +.PHONY: install-tools
> install-tools:
> $(MAKE) -C tools install
>
> +.PHONY: install-kernels
> install-kernels:
> for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
>
> +.PHONY: install-docs
> install-docs:
> sh ./docs/check_pkgs && $(MAKE) -C docs install || true
>
> +.PHONY: dev-docs
> dev-docs:
> $(MAKE) -C docs dev-docs
>
> # Build all the various kernels and modules
> +.PHONY: kbuild
> kbuild: kernels
>
> # Delete the kernel build trees entirely
> +.PHONY: kdelete
> kdelete:
> for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
>
> # Clean the kernel build trees
> +.PHONY: kclean
> kclean:
> for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
>
> # Make patches from kernel sparse trees
> +.PHONY: mkpatches
> mkpatches:
> for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch; done
>
> # build xen, the tools, and a domain 0 plus unprivileged
> linux-xen images, # and place them in the install directory.
> ''make install'' should then # copy them to the normal
system
> directories
> +.PHONY: world
> world:
> $(MAKE) clean
> $(MAKE) kdelete
> $(MAKE) dist
>
> # clean doesn''t do a kclean
> +.PHONY: clean
> clean::
> $(MAKE) -C xen clean
> $(MAKE) -C tools clean
> $(MAKE) -C docs clean
>
> -# clean, but blow away kernel build tree plus tarballs
> -distclean: clean
> +# clean, but blow away kernel build tree plus tarballs in the xen
> +source tree
> +.PHONY: distclean
> +distclean: clean kdelete distclean-logging distclean-iptables
> rm -rf dist patches/tmp
> - for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
> for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
> + rm -rf patches/*/.makedep
>
> # Linux name for GNU distclean
> +.PHONY: mrproper
> mrproper: distclean
>
> -install-logging: LOGGING=logging-0.4.9.2
> -install-logging:
> - [ -f $(LOGGING).tar.gz ] || wget
> http://www.red-dove.com/$(LOGGING).tar.gz
> - tar -zxf $(LOGGING).tar.gz
> - cd $(LOGGING) && python setup.py install
> -
> -# handy target to upgrade iptables (use rpm or apt-get in preference)
> -install-iptables:
> - wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2
> - tar -jxf iptables-1.2.11.tar.bz2
> - $(MAKE) -C iptables-1.2.11 PREFIX=
> KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install
> -
> +# handy targets to upgrade loging (use rpm or apt-get in preference)
> +LOGGING=logging-0.4.9.2
> +
> +vpath $(LOGGING).tar.gz $(DOWNLOAD_PATH)
> +$(LOGGING).tar.gz:
> + wget $(IPTABLES_REPO)/$@ -O$(DOWNLOAD_DIR)/$@ \
> + || { rm -f $(DOWNLOAD_DIR)/$@; false; }
> +
> +# N.B: Not .PHONY
> +prep-stamp-logging:
> + [ -d $(LOGGING) ] || tar -zxf $<
> + touch $@
> +
> +.PHONY: prep-logging
> +prep-logging: prep-stamp-logging
> +
> +.PHONY: build-logging
> +build-logging: prep-logging
> + cd $(LOGGING) && python setup.py build
> +
> +.PHONY: install-logging
> +install-logging: build-logging
> +ifndef XEN_PYTHON_NATIVE_INSTALL
> + cd $(LOGGING) && python setup.py install
--home="$(DESTDIR)/usr"
> +else
> + cd $(LOGGING) && python setup.py install
--root="$(DESTDIR)"
> +endif
> +
> +.PHONY: dist-logging
> +dist-logging: DESTDIR=$(DISTDIR)/install
> +dist-logging: install-logging
> + @: # do nothing
> +
> +.PHONY: clean-logging
> +clean-logging:
> + [ ! -d $(LOGGING) ] || ( cd $(LOGGING) && python
> setup.py clean; )
> +
> +.PHONY: distclean-logging
> +distclean-logging: clean-logging
> + rm -f prep-stamp-logging $(LOGGING).tar.gz
> + rm -rf $(LOGGING)
> +
> +# handy targets to upgrade iptables (use rpm or apt-get in
> preference)
> +IPTABLES=iptables-1.3.5
> +
> +vpath $(IPTABLES).tar.bz2 $(DOWNLOAD_PATH)
> +$(IPTABLES).tar.bz2:
> + wget $(IPTABLES_REPO)/$@ -O$(DOWNLOAD_DIR)/$@ \
> + || { rm -f $(DOWNLOAD_DIR)/$@; false; }
> +
> +# N.B: Not .PHONY
> +prep-stamp-iptables: $(IPTABLES).tar.bz2
> + [ -d $(IPTABLES) ] || tar --bzip2 -xf $<
> + touch $@
> +
> +.PHONY: prep-iptables
> +prep-iptables: prep-stamp-iptables
> +
> +.PHONY: build-iptables
> +build-iptables: prep-iptables prep-kernels
> + $(MAKE) -C $(IPTABLES) PREFIX=
> KERNEL_DIR=../linux-$(LINUX_VER)-xen
> +
> +.PHONY: install-iptables
> +install-iptables: build-iptables
> + $(MAKE) -C $(IPTABLES) PREFIX=
> KERNEL_DIR=../linux-$(LINUX_VER)-xen \
> + install
> +
> +.PHONY: dist-iptables
> +dist-iptables: DESTDIR=$(DISTDIR)/install
> +dist-iptables: install-iptables
> + @: # do nothing
> +
> +.PHONY: clean-iptables
> +clean-iptables:
> + [ ! -d $(IPTABLES) ] || $(MAKE) -C $(IPTABLES) PREFIX= \
> + KERNEL_DIR=../linux-$(LINUX_VER)-xen clean
> +
> +.PHONY: distclean-iptables
> +distclean-iptables: clean-iptables
> + rm -f prep-stamp-iptables $(IPTABLES).tar.bz2
> + rm -rf $(IPTABLES)
> +
> +.PHONY: help
> help:
> @echo ''Installation targets:''
> @echo '' install - build and install
everything''
> @@ -137,8 +224,8 @@ help:
> @echo ''''
> @echo ''Building targets:''
> @echo '' dist - build and install
> everything into local dist directory''
> - @echo '' world - clean everything, delete
> guest kernel build''
> - @echo '' trees then make dist''
> + @echo '' world - clean everything, delete
> guest kernel build trees''
> + @echo '' then make dist''
> @echo '' xen - build and install Xen
hypervisor''
> @echo '' tools - build and install tools''
> @echo '' kernels - build and install guest
kernels''
> @@ -147,25 +234,80 @@ help:
> @echo '' dev-docs - build developer-only
documentation''
> @echo ''''
> @echo ''Cleaning targets:''
> - @echo '' clean - clean the Xen, tools and
> docs (but not''
> - @echo '' guest kernel) trees''
> - @echo '' distclean - clean plus delete kernel
> tarballs and kernel''
> - @echo '' build trees''
> + @echo '' clean - clean the Xen, tools and
> docs (but not guest kernel trees)''
> + @echo '' distclean - clean plus delete kernel
> build trees and''
> + @echo '' local downloaded files''
> @echo '' kdelete - delete guest kernel build
trees''
> @echo '' kclean - clean guest kernel build
trees''
> @echo ''''
> - @echo ''Dependency installation targets:''
> - @echo '' install-logging - install the Python Logging
package''
> + @echo ''Dependency installation targets (Python Logging
> package):''
> + @echo '' build-logging - build logging''
> + @echo '' install-logging - install logging tools''
> + @echo '' dist-logging - install logging tools into
> local directory''
> + @echo '' clean-logging - clean logging''
> + @echo '' distclean-logging''
> + @echo '' - clean logging plus''
> + @echo '' delete logging tree and
> local tarball''
> + @echo '' * distclean-logging is called by distclean,''
> + @echo '' but other targets are indepenent of
> non-logging targets''
> + @echo ''''
> + @echo ''Dependency installation targets (iptables):''
> + @echo '' build-iptables - build iptables''
> @echo '' install-iptables - install iptables tools''
> + @echo '' dist-iptables - install iptables tools into
> local directory''
> + @echo '' clean-iptables - clean iptables''
> + @echo '' distclean-iptables''
> + @echo '' - clean iptables plus''
> + @echo '' delete iptables tree and
> local tarball''
> + @echo '' * distclean-iptables is called by distclean,''
> + @echo '' but other targets are indepenent of
> non-iptables targets''
> @echo ''''
> @echo ''Miscellaneous targets:''
> @echo '' prep-kernels - prepares kernel
> directories, does not build''
> @echo '' mkpatches - make patches against
> vanilla kernels from''
> @echo '' sparse trees''
> - @echo '' uninstall - attempt to remove installed
> Xen tools (use''
> - @echo '' with extreme care!)''
> + @echo '' uninstall - attempt to remove installed
> Xen tools''
> + @echo '' (use with extreme care!)''
> + @echo
> + @echo ''Environment:''
> + @echo '' XEN_PYTHON_NATIVE_INSTALL=y''
> + @echo '' - native python install or
dist''
> + @echo '' install into
> prefix/lib/python<VERSION>''
> + @echo '' instead of
<PREFIX>/lib/python''
> + @echo '' true if set to non-empty
> value, false otherwise''
> + @echo '' LINUX_REPO=URL - Base URL to download linux
> kernel from''
> + @echo '' Default: $(LINUX_REPO)''
> + @echo '' LINUX_REPO_KERNEL_PATH=DIRECTORY''
> + @echo '' - LINUX_REPO assumes that the
> URL has the same directory''
> + @echo '' structure as
> http://www.kernel.org/pub/linux/kernel/''
> + @echo '' and the rest of the path to
> the tarball is derived.''
> + @echo '' If set, override the
derivation.''
> + @echo '' Default: $(LINUX_REPO)''
> + @echo '' LINUX_REPO_PATCHL_PATH=DIRECTORY''
> + @echo '' - LINUX_REPO assumes that the
> URL has the same directory''
> + @echo '' structure as
> http://www.kernel.org/pub/linux/kernel/''
> + @echo '' and the rest of the path to
> the patches is derived.''
> + @echo '' If set, override the
derivation.''
> + @echo '' Default: $(LINUX_REPO)''
> + @echo '' NETBSD_REPO=URL - Base URL to download netbsd
> kernel from''
> + @echo '' Default: $(NETBSD_REPO)''
> + @echo '' PYTHON_LOGGING_REPO=URL''
> + @echo '' - Base URL to download python
> loging package from''
> + @echo '' Default:
$(PYTHON_LOGGING_REPO)''
> + @echo '' IPTABLES_REPO=URL''
> + @echo '' - Base URL to download iptables
from''
> + @echo '' Default: $(IPTABLES_REPO)''
> + @echo '' DOWNLOAD_PATH=PATH''
> + @echo '' - Directory to search for
> downloadable files''
> + @echo '' ":" delimited''
> + @echo '' First element will be used
> as the directory''
> + @echo '' to store any downloaded files
in''
> + @echo '' Default: LINUX_SRC_PATH if
> set, else $(DOWNLOAD_PATH_DEFAULT)''
> +
> +
>
> # Use this target with extreme care!
> +.PHONY: uninstall
> uninstall: D=$(DESTDIR)
> uninstall:
> [ -d $(D)/etc/xen ] && mv -f $(D)/etc/xen
> $(D)/etc/xen.old-`date +%s` || true @@ -199,5 +341,6 @@ uninstall:
> rm -rf $(D)/usr/share/man/man8/xen*
>
> # Legacy targets for compatibility
> +.PHONY: linux26
> linux26:
> $(MAKE) ''KERNELS=linux-2.6*'' kernels
> diff -r 40c23921e729 buildconfigs/Rules.mk
> --- a/buildconfigs/Rules.mk Mon Mar 27 18:03:03 2006 +0100
> +++ b/buildconfigs/Rules.mk Tue Mar 28 18:49:58 2006 +0900
> @@ -24,21 +24,28 @@ LINUX_VER ?= $(shell grep "^LINUX_VER" b
> 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)
> +vpath linux-%.tar.bz2 $(DOWNLOAD_PATH)
> +vpath patch-%.bz2 $(DOWNLOAD_PATH)
>
> # download a pristine Linux kernel tarball if there isn''t
> one in LINUX_SRC_PATH
> +ifndef LINUX_REPO_KERNEL_PATH
> linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst .,
> ,$*)).$(word 2,$(subst ., ,$*))
> +linux-%.tar.bz2: LINUX_REPO_KERNEL_PATH = v$(_LINUX_VDIR) endif
> linux-%.tar.bz2:
> @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
> - wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
> + wget $(LINUX_REPO)/$(LINUX_REPO_KERNEL_PATH)/$@
> -O$(DOWNLOAD_DIR)/$@ \\
> + || { rm -f $(DOWNLOAD_DIR)/$@; false; }
>
> +ifndef LINUX_REPO_PATCH_PATH
> 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: LINUX_REPO_PATCH_PATH = v$(_LINUX_VDIR)/$(_LINUX_XDIR)
> +endif
> patch-%.bz2:
> @echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
> - wget
> $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)
> /$(@F) -O./$@
> + wget $(LINUX_REPO)/$(LINUX_REPO_PATCH_PATH)/$(@F) \
> + -O$(DOWNLOAD_DIR)/$@ || { rm -f
> $(DOWNLOAD_DIR)/$@; false; }
>
> # Expand NetBSD release to NetBSD version NETBSD_RELEASE
> ?= 2.0 @@ -52,7 +59,8 @@ vpath netbsd-%.tar.bz2
> $(NETBSD_SRC_PATH # download a pristine NetBSD tarball if
> there isn''t one in NETBSD_SRC_PATH
> netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2:
> @echo "Cannot find $@ in path $(NETBSD_SRC_PATH)"
> - wget
> http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/$@ -O./$@
> + wget $(NETBSD_REPO)/$@ -O$(DOWNLOAD_DIR)/$@ || \
> + || { rm -f $(DOWNLOAD_DIR)/$@; false; }
>
> netbsd-%.tar.bz2: netbsd-%-xen-kernel-$(NETBSD_CVSSNAP).tar.bz2
> ln -fs $< $@
> @@ -67,9 +75,10 @@ pristine-%: pristine-%/.valid-pristine
> @true
>
> pristine-%/.valid-pristine: %.tar.bz2
> + @ echo pristing-target: $@
> rm -rf tmp-pristine-$* $(@D)
> mkdir -p tmp-pristine-$*
> - tar -C tmp-pristine-$* -jxf $<
> + tar -C tmp-pristine-$* --bzip2 -xf $<
> -@rm -f tmp-pristine-$*/pax_global_header
> mv tmp-pristine-$*/* $(@D)
> @rm -rf tmp-pristine-$*
> @@ -83,9 +92,6 @@ ifneq ($(PATCHDIRS),)
>
> $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)):
> patches/%/.makedep:
> @echo ''ref-$*/.valid-ref: $$(wildcard
patches/$*/*.patch)'' >$@
> -
> -clean::
> - rm -f patches/*/.makedep
>
> ref-%/.valid-ref: pristine-%/.valid-pristine
> set -e
> @@ -113,6 +119,7 @@ endif
>
> %-delete:
> $(MAKE) -f buildconfigs/mk.$* delete
> + rm -f %
>
> %-clean:
> $(MAKE) -f buildconfigs/mk.$* clean
> @@ -123,19 +130,20 @@ linux-2.6-xen.patch: ref-linux-$(LINUX_V
> linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
> rm -rf tmp-$@
> cp -al $(<D) tmp-$@
> - ( cd linux-2.6-xen-sparse && ./mkbuildtree ../tmp-$@ )
> + ( cd linux-2.6-xen-sparse && sh ./mkbuildtree ../tmp-$@ )
> diff -Nurp $(<D) tmp-$@ > $@ || true
> rm -rf tmp-$@
>
> %-xen.patch: ref-%/.valid-ref
> rm -rf tmp-$@
> cp -al $(<D) tmp-$@
> - ( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )
> + ( cd $*-xen-sparse && sh ./mkbuildtree ../tmp-$@ )
> diff -Nurp $(<D) tmp-$@ > $@ || true
> rm -rf tmp-$@
>
> %-mrproper: %-mrproper-extra
> - rm -rf pristine-$(*)* ref-$(*)* $*.tar.bz2
> + $(MAKE) -f buildconfigs/mk.$*-xen mrpropper
> + rm -rf pristine-$(*)* ref-$(*)*
> rm -rf $*-xen.patch
>
> netbsd-%-mrproper-extra:
> diff -r 40c23921e729 buildconfigs/mk.linux-2.6-xen
> --- a/buildconfigs/mk.linux-2.6-xen Mon Mar 27 18:03:03 2006 +0100
> +++ b/buildconfigs/mk.linux-2.6-xen Tue Mar 28 18:49:58 2006 +0900
> @@ -11,9 +11,8 @@ LINUX_DIR = $(OS)-$(LINUX_VER)-$(EXTR
>
> include buildconfigs/Rules.mk
>
> -.PHONY: build clean delete
> -
> # The real action starts here!
> +.PHONY: build
> build: $(LINUX_DIR)/include/linux/autoconf.h
> if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
> $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules
> ; \ @@ -26,8 +25,8 @@ build: $(LINUX_DIR)/include/linux/autoco
> rm -rf $(LINUX_DIR)
> cp -al $(<D) $(LINUX_DIR)
> # Apply arch-xen patches
> - ( cd linux-$(LINUX_SERIES)-xen-sparse ; \
> - LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_DIR) )
> + ( cd linux-$(LINUX_SERIES)-xen-sparse && \
> + LINUX_ARCH=$(LINUX_ARCH) sh ./mkbuildtree ../$(LINUX_DIR) )
> # Re-use config from install dir if one exits else use
> default config
> CONFIG_VERSION=$$(sed -ne ''s/^EXTRAVERSION = //p''
> $(LINUX_DIR)/Makefile); \
> [ -r
> $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVER
> SION) ] && \ @@ -42,14 +41,23 @@ build:
> $(LINUX_DIR)/include/linux/autoco
> rm -f Makefile ; mv Mk.tmp Makefile )
> $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) oldconfig
>
> +.PHONY: prep
> prep: $(LINUX_DIR)/include/linux/autoconf.h
>
> +.PHONY: config
> config: CONFIGMODE = menuconfig
> config: $(LINUX_DIR)/include/linux/autoconf.h
> $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
>
> +.PHONY: clean
> clean::
> - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
> + [ ! -d $(LINUX_DIR) ] || \
> + $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
>
> +.PHONY: delete
> delete:
> rm -rf tmp-$(OS)-$(LINUX_VER) $(LINUX_DIR)
> +
> +.PHONY: mrpropper
> +mrpropper:
> + rm -f $(LINUX_SRCS)
> diff -r 40c23921e729 linux-2.6-xen-sparse/drivers/xen/Makefile
> --- a/linux-2.6-xen-sparse/drivers/xen/Makefile Mon Mar
> 27 18:03:03 2006 +0100
> +++ b/linux-2.6-xen-sparse/drivers/xen/Makefile Tue Mar
> 28 18:49:58 2006 +0900
> @@ -1,22 +1,20 @@
>
> -obj-y += net_driver_util.o
> -obj-y += util.o
> +obj-y += util.o
>
> obj-y += core/
> -obj-y += char/
> obj-y += console/
> obj-y += evtchn/
> -obj-y += balloon/
> +#obj-y += balloon/
> obj-y += privcmd/
> +obj-y += blkback/
> +#obj-y += netback/
> +obj-y += blkfront/
> obj-y += xenbus/
> +#obj-y += netfront/
> +#obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += privcmd/
> +#obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
> +#obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
> +#obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += blkfront/
> +#obj-$(CONFIG_XEN_NETDEV_FRONTEND) += netfront/
> +#obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
>
> -obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
> -obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
> -obj-$(CONFIG_XEN_TPMDEV_BACKEND) += tpmback/
> -obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += blkfront/
> -obj-$(CONFIG_XEN_NETDEV_FRONTEND) += netfront/
> -obj-$(CONFIG_XEN_BLKDEV_TAP) += blktap/
> -obj-$(CONFIG_XEN_TPMDEV_FRONTEND) += tpmfront/
> -obj-$(CONFIG_XEN_PCIDEV_BACKEND) += pciback/
> -obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += pcifront/
> -
> diff -r 40c23921e729 linux-2.6-xen-sparse/drivers/xen/core/Makefile
> --- a/linux-2.6-xen-sparse/drivers/xen/core/Makefile Mon Mar
> 27 18:03:03 2006 +0100
> +++ b/linux-2.6-xen-sparse/drivers/xen/core/Makefile Tue Mar
> 28 18:49:58 2006 +0900
> @@ -2,10 +2,25 @@
> # Makefile for the linux kernel.
> #
>
> -obj-y := evtchn.o reboot.o gnttab.o features.o
> +XENARCH := $(subst ",,$(CONFIG_XENARCH))
>
> +CPPFLAGS_vmlinux.lds += -U$(XENARCH)
> +
> +$(obj)/vmlinux.lds.S:
> + @ln -fsn $(srctree)/arch/$(XENARCH)/kernel/vmlinux.lds.S $@
> +
> +
> +obj-y := gnttab.o
> obj-$(CONFIG_PROC_FS) += xen_proc.o
> -obj-$(CONFIG_NET) += skbuff.o
> -obj-$(CONFIG_SMP) += smpboot.o
> +
> +ifeq ($(ARCH),ia64)
> +obj-y += evtchn_ia64.o
> +obj-y += xenia64_init.o
> +else
> +extra-y += vmlinux.lds
> +obj-y += reboot.o evtchn.o fixup.o
> +obj-$(CONFIG_SMP) += smp.o #
> setup_profiling_timer def''d in ia64
> +obj-$(CONFIG_NET) += skbuff.o # until networking is up on ia64
> +endif
> obj-$(CONFIG_SYSFS) += hypervisor_sysfs.o
> obj-$(CONFIG_XEN_SYSFS) += xen_sysfs.o
> diff -r 40c23921e729 linux-2.6-xen-sparse/mkbuildtree
> --- a/linux-2.6-xen-sparse/mkbuildtree Mon Mar 27
> 18:03:03 2006 +0100
> +++ b/linux-2.6-xen-sparse/mkbuildtree Tue Mar 28
> 18:49:58 2006 +0900
> @@ -90,8 +90,8 @@ RS=$DESTPATH
> RS=$DESTPATH
>
> # Arch-specific pre-processing
> -if [ -x arch/${LINUX_ARCH}/xen-mkbuildtree-pre ]; then
> - arch/${LINUX_ARCH}/xen-mkbuildtree-pre
> +if [ -e arch/${LINUX_ARCH}/xen-mkbuildtree-pre ]; then
> + sh arch/${LINUX_ARCH}/xen-mkbuildtree-pre
> fi
>
> # Remove old copies of files and directories at the
> destination @@ -115,6 +115,6 @@ relative_lndir
> ../../../${RS}/../xen/inc
>
> # Arch-specific post-processing
> cd ${AD}
> -if [ -x arch/${LINUX_ARCH}/xen-mkbuildtree-post ]; then
> - arch/${LINUX_ARCH}/xen-mkbuildtree-post
> +if [ -e arch/${LINUX_ARCH}/xen-mkbuildtree-post ]; then
> + sh arch/${LINUX_ARCH}/xen-mkbuildtree-post
> fi
> diff -r 40c23921e729 tools/debugger/gdb/gdbbuild
> --- a/tools/debugger/gdb/gdbbuild Mon Mar 27 18:03:03 2006 +0100
> +++ b/tools/debugger/gdb/gdbbuild Tue Mar 28 18:49:58 2006 +0900
> @@ -7,7 +7,7 @@ tar xjf gdb-6.2.1.tar.bz2 tar xjf gdb-6.2.1.tar.bz2
>
> cd gdb-6.2.1-xen-sparse
> -./mkbuildtree ../gdb-6.2.1
> +sh ./mkbuildtree ../gdb-6.2.1
>
> cd ..
> mkdir gdb-6.2.1-linux-i386-xen
> diff -r 40c23921e729 tools/misc/xen-clone
> --- a/tools/misc/xen-clone Mon Mar 27 18:03:03 2006 +0100
> +++ b/tools/misc/xen-clone Tue Mar 28 18:49:58 2006 +0900
> @@ -113,7 +113,7 @@ else
>
> # Turn linux into xenolinux then build it
> cd xenolinux-${LINUX_VER}-sparse
> - ./mkbuildtree ../../linux-${LINUX_VER}
> + sh ./mkbuildtree ../../linux-${LINUX_VER}
> cd ../..
> mv linux-${LINUX_VER} xenolinux-${LINUX_VER}
> cd xenolinux-${LINUX_VER}
> diff -r 40c23921e729 tools/pygrub/Makefile
> --- a/tools/pygrub/Makefile Mon Mar 27 18:03:03 2006 +0100
> +++ b/tools/pygrub/Makefile Tue Mar 28 18:49:58 2006 +0900
> @@ -15,4 +15,4 @@ endif
> endif
>
> clean:
> - rm -rf build tmp *.pyc *.pyo *.o *.a *~
> + rm -rf build tmp *.pyc *.pyo *.o *.a *~ a.out
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel