direct-io.hg

changeset 15196:f6ff5d42164f

Updates for XEN_LINUX_SOURCE=hg-clone.

By default search for mercurial repositories in $(LINUX_SRC_PATH)
followed by a location derived from the current Xen repository's
default parent. e.g. A clone of
http://xenbits.xensource.com/xen-unstable.hg will derive
http://xenbits.xensource.com/linux-2.6.18-xen.hg. A specific
repository can be specified by giving XEN_LINUX_HGREPO=<URL or path>
on the make command line.

Add capability to put XEN_LINUX_UPDATE=y on the make command line to
update the Linux repository. Disabled by default since we don't want
to touch a developers repository without permission.

Dropped XEN_LINUX_HGUPDATES since it was unecessary and confusing.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Thu May 31 14:51:09 2007 +0100 (2007-05-31)
parents e2ba95ed2b09
children 2d3034d0b36b
files buildconfigs/mk.linux-2.6-xen buildconfigs/select-repository buildconfigs/src.hg-clone buildconfigs/src.sparse buildconfigs/src.tarball
line diff
     1.1 --- a/buildconfigs/mk.linux-2.6-xen	Thu May 31 10:58:22 2007 +0100
     1.2 +++ b/buildconfigs/mk.linux-2.6-xen	Thu May 31 14:51:09 2007 +0100
     1.3 @@ -3,6 +3,10 @@ LINUX_VER    ?= 2.6.18
     1.4  
     1.5  EXTRAVERSION ?= -xen
     1.6  
     1.7 +# Linux search path, will be searched for tarballs and mercurial
     1.8 +# repositories.
     1.9 +LINUX_SRC_PATH ?= .:..
    1.10 +
    1.11  XEN_LINUX_SOURCE ?= sparse
    1.12  
    1.13  # Let XEN_TARGET_ARCH override ARCH.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/buildconfigs/select-repository	Thu May 31 14:51:09 2007 +0100
     2.3 @@ -0,0 +1,49 @@
     2.4 +#!/bin/bash
     2.5 +
     2.6 +ME=$(basename $0)
     2.7 +
     2.8 +if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
     2.9 +    echo "usage: $ME <repository-name> [search-path]" 1>&2
    2.10 +    exit 1;
    2.11 +fi
    2.12 +
    2.13 +REPO=$1
    2.14 +LINUX_SRC_PATH=$2
    2.15 +
    2.16 +if [ X"${LINUX_SRC_PATH}" != X ] ; then
    2.17 +    echo "$ME: Searching \`${LINUX_SRC_PATH}' for $REPO" 1>&2
    2.18 +    IFS_saved="$IFS"
    2.19 +    IFS=:
    2.20 +    for i in $LINUX_SRC_PATH ; do
    2.21 +	# Ignore current directory since we will almost certainly find
    2.22 +	# the target directory there which breaks updating (there's no
    2.23 +	# point updating from yourself!).
    2.24 +	if [ X"." = X"${i}" ] ; then
    2.25 +	    echo "$ME: Ignoring \`.'" 1>&2
    2.26 +	    continue
    2.27 +	fi
    2.28 +
    2.29 +	if [ -d "$i/$REPO/.hg" ] ; then
    2.30 +	    echo "$ME: Found $i/$REPO" 1>&2
    2.31 +	    echo "$i/$REPO"
    2.32 +	    exit 0
    2.33 +	fi
    2.34 +    done
    2.35 +    IFS="$IFS_saved"
    2.36 +fi
    2.37 +
    2.38 +XEN=$(hg -R ${XEN_ROOT} path default)
    2.39 +if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
    2.40 +    echo "$ME: Unable to determine Xen repository parent." 1>&2
    2.41 +    exit 1;
    2.42 +fi
    2.43 +
    2.44 +BASE=$(dirname ${XEN})
    2.45 +if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
    2.46 +    echo "$ME: Unable to determine Xen repository parent." 1>&2
    2.47 +    exit 1;
    2.48 +fi
    2.49 +
    2.50 +echo "$ME: Found ${BASE}/${REPO}" 1>&2
    2.51 +echo ${BASE}/${REPO}
    2.52 +exit 0
     3.1 --- a/buildconfigs/src.hg-clone	Thu May 31 10:58:22 2007 +0100
     3.2 +++ b/buildconfigs/src.hg-clone	Thu May 31 14:51:09 2007 +0100
     3.3 @@ -1,26 +1,39 @@
     3.4 -# Main repository to clone.
     3.5 -XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/linux-$(LINUX_VER)-xen.hg
     3.6 -
     3.7 -# Set this to pull additional changesets from a second source.
     3.8 -
     3.9 -# This can be useful if you use a local mirror for XEN_LINUX_HGREPO
    3.10 -# (to reduce time spent cloning) but still want to pull the very
    3.11 -# latest changesets from xenbits.
    3.12 -XEN_LINUX_HGUPDATES ?=
    3.13 -
    3.14 -# Set this to update to a particlar revision.
    3.15 -XEN_LINUX_HGREV  ?=
    3.16 +# Mercurial
    3.17 +HG ?= hg
    3.18  
    3.19  LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
    3.20  
    3.21 -$(LINUX_SRCDIR)/.valid-src:
    3.22 +# Repository to clone.
    3.23 +XEN_LINUX_HGREPO ?= $$(sh buildconfigs/select-repository $(LINUX_SRCDIR) $(LINUX_SRC_PATH))
    3.24 +
    3.25 +# The source directory is not automatically updated to avoid blowing
    3.26 +# away developer's changes. If you want to automatically pull a new
    3.27 +# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
    3.28 +# command line.
    3.29 +ifeq ($(XEN_LINUX_UPDATE),y)
    3.30 +__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
    3.31 +else
    3.32 +__XEN_LINUX_UPDATE =
    3.33 +endif
    3.34 +
    3.35 +# Set XEN_LINUX_HGREV to update to a particlar revision.
    3.36 +XEN_LINUX_HGREV  ?= tip
    3.37 +
    3.38 +$(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
    3.39 +	set -e ; __repo=$(XEN_LINUX_HGREPO) ; \
    3.40  	if [ ! -d $(LINUX_SRCDIR) ] ; then \
    3.41 -	    hg clone $(XEN_LINUX_HGREPO) $(LINUX_SRCDIR) ; \
    3.42 -	fi
    3.43 -	if [ -n "$(XEN_LINUX_HGUPDATES)" ] ; then \
    3.44 -	    hg pull -R $(LINUX_SRCDIR) $(XEN_LINUX_HGUPDATES) ; \
    3.45 +	    echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
    3.46 +	    $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
    3.47 +	else \
    3.48 +	    echo "Pulling changes from $${__repo} into $(LINUX_SRCDIR)." ; \
    3.49 +	    $(HG) -R $(LINUX_SRCDIR) pull $${__repo} ; \
    3.50  	fi
    3.51  	if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
    3.52 -	    hg update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
    3.53 +	    echo "Updating $(LINUX_SRCDIR) to revision $(XEN_LINUX_HGREV)." ; \
    3.54 +	    $(HG) update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
    3.55  	fi
    3.56  	touch $@
    3.57 +
    3.58 +.PHONY: $(LINUX_SRCDIR)/.force-update
    3.59 +$(LINUX_SRCDIR)/.force-update:
    3.60 +	@ :
     4.1 --- a/buildconfigs/src.sparse	Thu May 31 10:58:22 2007 +0100
     4.2 +++ b/buildconfigs/src.sparse	Thu May 31 14:51:09 2007 +0100
     4.3 @@ -7,8 +7,6 @@ LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen
     4.4  PRISTINE_SRC_PATH	?= .:..
     4.5  vpath pristine-% $(PRISTINE_SRC_PATH)
     4.6  
     4.7 -# Setup Linux search path
     4.8 -LINUX_SRC_PATH	?= .:..
     4.9  vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    4.10  vpath patch-%.bz2 $(LINUX_SRC_PATH)
    4.11  
     5.1 --- a/buildconfigs/src.tarball	Thu May 31 10:58:22 2007 +0100
     5.2 +++ b/buildconfigs/src.tarball	Thu May 31 14:51:09 2007 +0100
     5.3 @@ -3,8 +3,6 @@ XEN_LINUX_TARBALL ?= linux-$(LINUX_VER)-
     5.4  
     5.5  LINUX_SRCDIR ?= linux-$(LINUX_VER)
     5.6  
     5.7 -# Setup Linux search path
     5.8 -LINUX_SRC_PATH	?= .:..
     5.9  vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
    5.10  
    5.11  # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH