External Linux build system updates
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.
# HG changeset patch
# User Ian Campbell <[email protected]>
# 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.
buildconfigs/mk.linux-2.6-common +7 -1
@@ -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"; \
# HG changeset patch
# User Ian Campbell <[email protected]> # 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.
buildconfigs/enable-xen-config +8 -1
@@ -1,6 +1,6 @@ #!/bin/sh -set -ex +set -e if [ $# -ne 1 ] ; then echo "Usage $(basename $0) <config-file>" 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
buildconfigs/mk.linux-2.6-common +8 -16
@@ -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
buildconfigs/select-linux-arch new file +30 -0
@@ -0,0 +1,30 @@ +#!/bin/sh + +ME=$(basename $0) + +if [ $# -lt 1 ] || [ $# -gt 2 ] ; then + echo "usage: $ME <linux-build-directory>" 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
buildconfigs/select-linux-image new file +33 -0
@@ -0,0 +1,33 @@ +#!/bin/sh + +ME=$(basename $0) + +if [ $# -lt 3 ] ; then + echo "usage: $ME <linux-build-directory> <linux-arch> <linux-targets...>" 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
# HG changeset patch
# User Ian Campbell <[email protected]>
# 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).
buildconfigs/enable-xen-config +1 -0
@@ -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 ;;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel