From: Ian Campbell Subject: External Linux build system updates Date: Tue, 12 Feb 2008 14:52:05 +0000 Message-ID: <1202827925.16760.55.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-f0IZu1JZ0yfOLlHcL1tD" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org --=-f0IZu1JZ0yfOLlHcL1tD Content-Type: text/plain Content-Transfer-Encoding: 7bit Keir, These three patches fix the build system support for building alternative upstream Linux trees (i.e. 2.6, 2.6-git, 2.6-mm etc) which has rotted a bit. If possible it would be useful to "chmod +x buildconfigs/select-*" between applying and committing #02. Not strictly necessary since the Makefile explicitly calls them with a shell but it's nicer if the perms are correct anyway. Ian. --=-f0IZu1JZ0yfOLlHcL1tD Content-Disposition: attachment; filename=01-non-interactive-kernel-build.patch Content-Type: text/x-patch; name=01-non-interactive-kernel-build.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Ian Campbell # Date 1202827355 0 # Node ID da211005c595feee693f12a23bdbea2b3e06eb84 # Parent a905c582a406f60cf44a8884843129c085b18a30 [BUILD] Add option to ensure kernel build is non-interactive. This is useful for the non 2.6.18-xen builds where the defconfig at any particular momement may require additional questions to be answered. Signed-off-by: Ian Campbell diff -r a905c582a406 -r da211005c595 buildconfigs/mk.linux-2.6-common --- a/buildconfigs/mk.linux-2.6-common Tue Feb 12 14:35:39 2008 +0000 +++ b/buildconfigs/mk.linux-2.6-common Tue Feb 12 14:42:35 2008 +0000 @@ -12,6 +12,12 @@ __XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.fo __XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update else __XEN_LINUX_UPDATE = +endif + +ifeq ($(XEN_LINUX_NONINTERACTIVE_CONFIG),y) +__NONINT_CONFIG = yes $$'\n' | +else +__NONINT_CONFIG = endif # Let XEN_TARGET_ARCH override ARCH. @@ -102,7 +108,7 @@ ifneq ($(EXTRAVERSION),) ifneq ($(EXTRAVERSION),) echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen endif - $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR) + $(__NONINT_CONFIG) $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR) @set -e ; if [ ! -f $(LINUX_DIR)/Makefile ] ; then \ echo "***********************************"; \ echo "oldconfig did not create a Makefile"; \ --=-f0IZu1JZ0yfOLlHcL1tD Content-Disposition: attachment; filename=02-fix-upstream-kernel-build.patch Content-Type: text/x-patch; name=02-fix-upstream-kernel-build.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Ian Campbell # Date 1202827357 0 # Node ID c4a757ebb662e3cfee7b56ce632eeb3e169e7dbf # Parent da211005c595feee693f12a23bdbea2b3e06eb84 [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 diff -r da211005c595 -r c4a757ebb662 buildconfigs/enable-xen-config --- a/buildconfigs/enable-xen-config Tue Feb 12 14:42:35 2008 +0000 +++ b/buildconfigs/enable-xen-config Tue Feb 12 14:42:37 2008 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -set -ex +set -e if [ $# -ne 1 ] ; then echo "Usage $(basename $0) " 1>&2 @@ -26,6 +26,7 @@ setopt() } setopt CONFIG_PARAVIRT y +setopt CONFIG_PARAVIRT_GUEST y setopt CONFIG_XEN y setopt CONFIG_VMI y setopt CONFIG_KVM y @@ -37,4 +38,10 @@ setopt CONFIG_HVC_XEN y setopt CONFIG_HVC_XEN y setopt CONFIG_NUMA n +case ${XEN_TARGET_ARCH} in + x86_32) setopt CONFIG_64BIT n ;; + x86_64) setopt CONFIG_64BIT y ;; + *) ;; +esac + exit 0 diff -r da211005c595 -r c4a757ebb662 buildconfigs/mk.linux-2.6-common --- a/buildconfigs/mk.linux-2.6-common Tue Feb 12 14:42:35 2008 +0000 +++ b/buildconfigs/mk.linux-2.6-common Tue Feb 12 14:42:37 2008 +0000 @@ -20,22 +20,9 @@ __NONINT_CONFIG = __NONINT_CONFIG = endif -# 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 -ifneq ($(XEN_TARGET_ARCH),ia64) -IMAGE_PATH ?= arch/$(LINUX_ARCH)/boot/$(firstword $(IMAGE_TARGET)) -else -IMAGE_PATH ?= arch/ia64/hp/sim/boot/vmlinux.gz -endif -INSTALL_BOOT_PATH := $(DESTDIR)/boot LINUX_VER3 := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER))) @@ -43,6 +30,11 @@ _build: build _build: build include buildconfigs/src.$(XEN_LINUX_SOURCE) + +LINUX_ARCH = $$(sh buildconfigs/select-linux-arch $(LINUX_SRCDIR)) +IMAGE_PATH = $$(sh buildconfigs/select-linux-image $(LINUX_DIR) $(LINUX_ARCH) $(IMAGE_TARGET)) + +INSTALL_BOOT_PATH := $(DESTDIR)/boot # Default to allowing interface mismatch ifndef XEN_LINUX_ALLOW_INTERFACE_MISMATCH @@ -70,9 +62,9 @@ endif fi $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET) mkdir -p $(INSTALL_BOOT_PATH) - cp $(LINUX_DIR)/$(IMAGE_PATH) $(INSTALL_BOOT_PATH)/vmlinuz-$(KERNELRELEASE) - cp $(LINUX_DIR)/.config $(INSTALL_BOOT_PATH)/config-$(KERNELRELEASE) - cp $(LINUX_DIR)/System.map $(INSTALL_BOOT_PATH)/System.map-$(KERNELRELEASE) + @cp -v $(IMAGE_PATH) $(INSTALL_BOOT_PATH)/vmlinuz-$(KERNELRELEASE) + @cp -v $(LINUX_DIR)/.config $(INSTALL_BOOT_PATH)/config-$(KERNELRELEASE) + @cp -v $(LINUX_DIR)/System.map $(INSTALL_BOOT_PATH)/System.map-$(KERNELRELEASE) $(LINUX_DIR)/include/linux/autoconf.h: CONFIG_FILE=$(CURDIR)/$(LINUX_DIR)/.config $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src diff -r da211005c595 -r c4a757ebb662 buildconfigs/select-linux-arch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildconfigs/select-linux-arch Tue Feb 12 14:42:37 2008 +0000 @@ -0,0 +1,30 @@ +#!/bin/sh + +ME=$(basename $0) + +if [ $# -lt 1 ] || [ $# -gt 2 ] ; then + echo "usage: $ME " 1>&2 + exit 1; +fi + +LINUX_DIR=$1 + +case ${XEN_TARGET_ARCH} in + x86_32|x86_64) + if [ -d ${LINUX_DIR}/arch/x86 ] ; then + ARCH=x86 + elif [ "${XEN_TARGET_ARCH}" = "x86_32" ] ; then + ARCH=i386 + else + ARCH=x86_64 + fi + ;; + *) + ARCH=${XEN_TARGET_ARCH} + ;; +esac + +echo "$ME: ${ARCH}" 1>&2 +echo ${ARCH} + +exit 0 diff -r da211005c595 -r c4a757ebb662 buildconfigs/select-linux-image --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildconfigs/select-linux-image Tue Feb 12 14:42:37 2008 +0000 @@ -0,0 +1,33 @@ +#!/bin/sh + +ME=$(basename $0) + +if [ $# -lt 3 ] ; then + echo "usage: $ME " 1>&2 + exit 1; +fi + +LINUX_DIR=$1 +LINUX_ARCH=$2 +LINUX_TARGET=$3 # We don't care about second and subsequent targets + +case ${XEN_TARGET_ARCH} in + ia64) + IMAGE=${LINUX_DIR}/arch/ia64/hp/sim/boot/vmlinux.gz + ;; + *) + if [ -f ${LINUX_DIR}/arch/${LINUX_ARCH}/boot/${LINUX_TARGET} ] ; then + IMAGE=${LINUX_DIR}/arch/${LINUX_ARCH}/boot/${LINUX_TARGET} + elif [ -f ${LINUX_DIR}/${LINUX_TARGET} ] ; then + IMAGE=${LINUX_DIR}/${LINUX_TARGET} + else + echo "$ME: cannot determine Linux image to use for ${LINUX_ARCH} in ${LINUX_DIR}" 1>&2 + exit 1 + fi + ;; +esac + +echo "$ME: ${IMAGE}" 1>&2 +echo ${IMAGE} + +exit 0 --=-f0IZu1JZ0yfOLlHcL1tD Content-Disposition: attachment; filename=03-disable-localversion-auto.patch Content-Type: text/x-patch; name=03-disable-localversion-auto.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Ian Campbell # Date 1202827358 0 # Node ID b9563433dd465a298e45eddcc886f201f099ff7f # Parent c4a757ebb662e3cfee7b56ce632eeb3e169e7dbf [BUILD] Disable LOCALVERSION_AUTO in upstream Linux builds. If this option is enabled then the Xen mercurial version ID gets tacked onto the kernel version (e.g. 2.6.24-git22-hg2593b69b183b) which is unlikely to be useful or desirable. All the trees which we build using this method already have uniquely identifying versions (e.g. 2.6.24-git22 or 2.6.24-mm1). Signed-off-by: Ian Campbell diff -r c4a757ebb662 -r b9563433dd46 buildconfigs/enable-xen-config --- a/buildconfigs/enable-xen-config Tue Feb 12 14:42:37 2008 +0000 +++ b/buildconfigs/enable-xen-config Tue Feb 12 14:42:38 2008 +0000 @@ -37,6 +37,7 @@ setopt CONFIG_XEN_NETDEV_FRONTEND y setopt CONFIG_XEN_NETDEV_FRONTEND y setopt CONFIG_HVC_XEN y setopt CONFIG_NUMA n +setopt CONFIG_LOCALVERSION_AUTO n case ${XEN_TARGET_ARCH} in x86_32) setopt CONFIG_64BIT n ;; --=-f0IZu1JZ0yfOLlHcL1tD Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-f0IZu1JZ0yfOLlHcL1tD--