ia64/xen-unstable

changeset 17044:419a141ca16d

[BUILD] Fixup support for building upstream kernels.

In particular:
- support merged x86 architecture. To facilitate this it made sense
to encode some existing logic in shell scripts rather than
increasing complicated make conditionals.
- set CONFIG_PARAVIRT_GUEST=y which is required for newer kernels.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 12 14:59:01 2008 +0000 (2008-02-12)
parents 319a54d5c804
children 761604c6136d
files buildconfigs/enable-xen-config buildconfigs/mk.linux-2.6-common buildconfigs/select-linux-arch buildconfigs/select-linux-image
line diff
     1.1 --- a/buildconfigs/enable-xen-config	Tue Feb 12 14:57:36 2008 +0000
     1.2 +++ b/buildconfigs/enable-xen-config	Tue Feb 12 14:59:01 2008 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  #!/bin/sh
     1.5  
     1.6 -set -ex
     1.7 +set -e
     1.8  
     1.9  if [ $# -ne 1 ] ; then
    1.10  	echo "Usage $(basename $0) <config-file>" 1>&2
    1.11 @@ -26,6 +26,7 @@ setopt()
    1.12  }
    1.13  
    1.14  setopt CONFIG_PARAVIRT y
    1.15 +setopt CONFIG_PARAVIRT_GUEST y
    1.16  setopt CONFIG_XEN y
    1.17  setopt CONFIG_VMI y
    1.18  setopt CONFIG_KVM y
    1.19 @@ -37,4 +38,10 @@ setopt CONFIG_XEN_NETDEV_FRONTEND y
    1.20  setopt CONFIG_HVC_XEN y
    1.21  setopt CONFIG_NUMA n
    1.22  
    1.23 +case ${XEN_TARGET_ARCH} in
    1.24 +    x86_32) setopt CONFIG_64BIT n ;;
    1.25 +    x86_64) setopt CONFIG_64BIT y ;;
    1.26 +    *) ;;
    1.27 +esac
    1.28 +
    1.29  exit 0
     2.1 --- a/buildconfigs/mk.linux-2.6-common	Tue Feb 12 14:57:36 2008 +0000
     2.2 +++ b/buildconfigs/mk.linux-2.6-common	Tue Feb 12 14:59:01 2008 +0000
     2.3 @@ -20,22 +20,9 @@ else
     2.4  __NONINT_CONFIG =
     2.5  endif
     2.6  
     2.7 -# Let XEN_TARGET_ARCH override ARCH.
     2.8 -ifeq ($(XEN_TARGET_ARCH),x86_32)
     2.9 -LINUX_ARCH	?= i386
    2.10 -else
    2.11 -LINUX_ARCH	?= $(XEN_TARGET_ARCH)
    2.12 -endif
    2.13 -
    2.14  LINUX_DIR     = build-linux-$(LINUX_VER)$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
    2.15  
    2.16  IMAGE_TARGET ?= vmlinuz
    2.17 -ifneq ($(XEN_TARGET_ARCH),ia64)
    2.18 -IMAGE_PATH ?= arch/$(LINUX_ARCH)/boot/$(firstword $(IMAGE_TARGET))
    2.19 -else
    2.20 -IMAGE_PATH ?= arch/ia64/hp/sim/boot/vmlinux.gz
    2.21 -endif
    2.22 -INSTALL_BOOT_PATH := $(DESTDIR)/boot
    2.23  
    2.24  LINUX_VER3  := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
    2.25  
    2.26 @@ -44,6 +31,11 @@ LINUX_VER3  := $(LINUX_SERIES).$(word 3,
    2.27  
    2.28  include buildconfigs/src.$(XEN_LINUX_SOURCE)
    2.29  
    2.30 +LINUX_ARCH = $$(sh buildconfigs/select-linux-arch $(LINUX_SRCDIR))
    2.31 +IMAGE_PATH = $$(sh buildconfigs/select-linux-image $(LINUX_DIR) $(LINUX_ARCH) $(IMAGE_TARGET))
    2.32 +
    2.33 +INSTALL_BOOT_PATH := $(DESTDIR)/boot
    2.34 +
    2.35  # Default to allowing interface mismatch
    2.36  ifndef XEN_LINUX_ALLOW_INTERFACE_MISMATCH
    2.37  XEN_LINUX_ALLOW_INTERFACE_MISMATCH := y
    2.38 @@ -70,9 +62,9 @@ endif
    2.39  	fi
    2.40  	$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET)
    2.41  	mkdir -p $(INSTALL_BOOT_PATH)
    2.42 -	cp $(LINUX_DIR)/$(IMAGE_PATH) $(INSTALL_BOOT_PATH)/vmlinuz-$(KERNELRELEASE)
    2.43 -	cp $(LINUX_DIR)/.config $(INSTALL_BOOT_PATH)/config-$(KERNELRELEASE)
    2.44 -	cp $(LINUX_DIR)/System.map $(INSTALL_BOOT_PATH)/System.map-$(KERNELRELEASE)
    2.45 +	@cp -v $(IMAGE_PATH) $(INSTALL_BOOT_PATH)/vmlinuz-$(KERNELRELEASE)
    2.46 +	@cp -v $(LINUX_DIR)/.config $(INSTALL_BOOT_PATH)/config-$(KERNELRELEASE)
    2.47 +	@cp -v $(LINUX_DIR)/System.map $(INSTALL_BOOT_PATH)/System.map-$(KERNELRELEASE)
    2.48  
    2.49  $(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(CURDIR)/$(LINUX_DIR)/.config
    2.50  $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/buildconfigs/select-linux-arch	Tue Feb 12 14:59:01 2008 +0000
     3.3 @@ -0,0 +1,30 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +ME=$(basename $0)
     3.7 +
     3.8 +if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
     3.9 +    echo "usage: $ME <linux-build-directory>" 1>&2
    3.10 +    exit 1;
    3.11 +fi
    3.12 +
    3.13 +LINUX_DIR=$1
    3.14 +
    3.15 +case ${XEN_TARGET_ARCH} in
    3.16 +    x86_32|x86_64)
    3.17 +	if [ -d ${LINUX_DIR}/arch/x86 ] ; then
    3.18 +	    ARCH=x86
    3.19 +	elif [ "${XEN_TARGET_ARCH}" = "x86_32" ] ; then
    3.20 +	    ARCH=i386
    3.21 +	else
    3.22 +	    ARCH=x86_64
    3.23 +	fi
    3.24 +	;;
    3.25 +    *)
    3.26 +	ARCH=${XEN_TARGET_ARCH}
    3.27 +	;;
    3.28 +esac
    3.29 +
    3.30 +echo "$ME: ${ARCH}" 1>&2
    3.31 +echo ${ARCH}
    3.32 +
    3.33 +exit 0
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/buildconfigs/select-linux-image	Tue Feb 12 14:59:01 2008 +0000
     4.3 @@ -0,0 +1,33 @@
     4.4 +#!/bin/sh
     4.5 +
     4.6 +ME=$(basename $0)
     4.7 +
     4.8 +if [ $# -lt 3 ] ; then
     4.9 +    echo "usage: $ME <linux-build-directory> <linux-arch> <linux-targets...>" 1>&2
    4.10 +    exit 1;
    4.11 +fi
    4.12 +
    4.13 +LINUX_DIR=$1
    4.14 +LINUX_ARCH=$2
    4.15 +LINUX_TARGET=$3 # We don't care about second and subsequent targets
    4.16 +
    4.17 +case ${XEN_TARGET_ARCH} in
    4.18 +    ia64)
    4.19 +	IMAGE=${LINUX_DIR}/arch/ia64/hp/sim/boot/vmlinux.gz
    4.20 +	;;
    4.21 +    *)
    4.22 +	if [ -f ${LINUX_DIR}/arch/${LINUX_ARCH}/boot/${LINUX_TARGET} ] ; then
    4.23 +	    IMAGE=${LINUX_DIR}/arch/${LINUX_ARCH}/boot/${LINUX_TARGET}
    4.24 +	elif [ -f ${LINUX_DIR}/${LINUX_TARGET} ] ; then
    4.25 +	    IMAGE=${LINUX_DIR}/${LINUX_TARGET}
    4.26 +	else
    4.27 +	    echo "$ME: cannot determine Linux image to use for ${LINUX_ARCH} in ${LINUX_DIR}" 1>&2
    4.28 +	    exit 1
    4.29 +	fi
    4.30 +	;;
    4.31 +esac
    4.32 +
    4.33 +echo "$ME: ${IMAGE}" 1>&2
    4.34 +echo ${IMAGE}
    4.35 +
    4.36 +exit 0