aboutsummaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-08-06 19:04:05 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-08-06 19:04:05 +0000
commit95d901dba926d7cb2e9e4f2e2e81aeea5d2a7cc8 (patch)
tree32ebebd324b34b659770ed92712b3e9cb5be8ae7 /release
parent8f5074017e0a8c7b80451d8bf53d79c0f1946139 (diff)
downloadsrc-95d901dba926d7cb2e9e4f2e2e81aeea5d2a7cc8.tar.gz
src-95d901dba926d7cb2e9e4f2e2e81aeea5d2a7cc8.zip
Merge the following from ^/projects/release-noxdev:
r269549, r269551, r269552, r269553, r269554, r269555, r269558, r269559, r269560, r269561, r269628, r269629, r269630, r269635, r269637: r269549: Create a new project branch, release-noxdev, for a sandbox workspace outside of head/ to update the release bits for arm builds since the deprecation of the XDEV and XDEV_ARCH make(1) variables. r269551: Define load_chroot_env() and load_target_env() prototypes. r269552: Call load_chroot_env() and load_target_env() where they can be mutually conflicting with regard to TARGET, TARGET_ARCH, XDEV, and XDEV_ARCH. r269553: Add shebang line to arm/*.conf files since these should be considered to be executable (albeit not on their own) shell scripts. r269554: Redefine load_chroot_env() and load_target_env() in the arm/*.conf files, and reindent. r269555: Simplify where load_chroot_env() and load_target_env() are called. r269558: Provide example in release.conf.sample for overriding the load_chroot_env() and load_target_env() prototypes. r269559: Remove a gratuitous newline. r269560: Unset potentially conflicting variables in load_chroot_env() and load_target_env(). r269561: Make global variables global, and accessible outside of the functions within which they were once defined. r269628: Remove XDEV/XDEV_ARCH evaluation if EMBEDDEDBUILD is set. r269629: In arm/release.sh, switch TARGET/TARGET_ARCH back to the original XDEV/XDEV_ARCH make(1) variables. In theory, this should have been a no-op, but the TARGET and TARGET_ARCH are now unset in load_target_env() to avoid collision with the chroot userland. r269630: Export variables in the arm/*.conf files because they need to be passed through release.sh to arm/release.sh. Set MK_TESTS=no for the xdev target. r269635: As part of the XDEV/XDEV_ARCH deprecation, the 'xdev-links' target was intentionally no longer invoked automatically. Invoke the xdev-links target after xdev, which creates, for example, /usr/bin/armv6-freebsd-cc symlink to /usr/armv6-freebsd/usr/bin/cc. r269637: Set TARGET and TARGET_ARCH to the XDEV and XDEV_ARCH counterparts for the xdev and xdev-links make(1) targets. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=269639
Diffstat (limited to 'release')
-rw-r--r--release/arm/BEAGLEBONE.conf53
-rw-r--r--release/arm/PANDABOARD.conf53
-rw-r--r--release/arm/RPI-B.conf58
-rw-r--r--release/arm/WANDBOARD-QUAD.conf53
-rw-r--r--release/arm/ZEDBOARD.conf51
-rwxr-xr-xrelease/arm/release.sh10
-rw-r--r--release/release.conf.sample5
-rwxr-xr-xrelease/release.sh11
8 files changed, 173 insertions, 121 deletions
diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf
index 49c02249dc4f..025bcb7725c8 100644
--- a/release/arm/BEAGLEBONE.conf
+++ b/release/arm/BEAGLEBONE.conf
@@ -1,30 +1,37 @@
+#!/bin/sh
#
# $FreeBSD$
#
+# Global variables.
+export SVNROOT="svn://svn.FreeBSD.org/"
+export SRCBRANCH="base/head@rHEAD"
+export DOCBRANCH="doc/head@rHEAD"
+export PORTBRANCH="ports/head@rHEAD"
+export NODOC=yes
+export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
+export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
+export CHROOTDIR="/scratch"
+export EMBEDDEDBUILD=1
+
# Build chroot configuration
-TARGET="amd64"
-TARGET_ARCH="amd64"
-SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head@rHEAD"
-DOCBRANCH="doc/head@rHEAD"
-PORTBRANCH="ports/head@rHEAD"
-NODOC=yes
+load_chroot_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset XDEV XDEV_ARCH KERNEL
+ export TARGET="amd64"
+ export TARGET_ARCH="amd64"
+}
# Build target configuration
-# Since this file is sourced by a script that runs another
-# script, these must be exported.
-set -a
-WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-CHROOTDIR="/scratch"
-EMBEDDEDBUILD=1
-EMBEDDEDPORTS="lang/python textproc/gsed"
-XDEV="arm"
-XDEV_ARCH="armv6"
-XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
-KERNEL="BEAGLEBONE"
-CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
-CROCHETBRANCH="trunk"
-set +a
-
+load_target_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset TARGET TARGET_ARCH
+ export EMBEDDEDPORTS="lang/python textproc/gsed"
+ export XDEV="arm"
+ export XDEV_ARCH="armv6"
+ export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
+ export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
+ export KERNEL="BEAGLEBONE"
+ export CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
+ export CROCHETBRANCH="trunk"
+}
diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf
index d932dac9c849..afc53d56f18d 100644
--- a/release/arm/PANDABOARD.conf
+++ b/release/arm/PANDABOARD.conf
@@ -1,30 +1,37 @@
+#!/bin/sh
#
# $FreeBSD$
#
+# Global variables.
+export SVNROOT="svn://svn.FreeBSD.org/"
+export SRCBRANCH="base/head@rHEAD"
+export DOCBRANCH="doc/head@rHEAD"
+export PORTBRANCH="ports/head@rHEAD"
+export NODOC=yes
+export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
+export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
+export CHROOTDIR="/scratch"
+export EMBEDDEDBUILD=1
+export EMBEDDEDPORTS="lang/python textproc/gsed"
+
# Build chroot configuration
-TARGET="amd64"
-TARGET_ARCH="amd64"
-SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head@rHEAD"
-DOCBRANCH="doc/head@rHEAD"
-PORTBRANCH="ports/head@rHEAD"
-NODOC=yes
+load_chroot_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset XDEV XDEV_ARCH KERNEL
+ export TARGET="amd64"
+ export TARGET_ARCH="amd64"
+}
# Build target configuration
-# Since this file is sourced by a script that runs another
-# script, these must be exported.
-set -a
-WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-CHROOTDIR="/scratch"
-EMBEDDEDBUILD=1
-EMBEDDEDPORTS="lang/python textproc/gsed"
-XDEV="arm"
-XDEV_ARCH="armv6"
-XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
-KERNEL="PANDABOARD"
-CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
-CROCHETBRANCH="trunk"
-set +a
-
+load_target_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset TARGET TARGET_ARCH
+ export XDEV="arm"
+ export XDEV_ARCH="armv6"
+ export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
+ export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
+ export KERNEL="PANDABOARD"
+ export CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
+ export CROCHETBRANCH="trunk"
+}
diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf
index 01137c06244d..22ffb2b10a1a 100644
--- a/release/arm/RPI-B.conf
+++ b/release/arm/RPI-B.conf
@@ -1,32 +1,40 @@
+#!/bin/sh
#
# $FreeBSD$
#
+# Global variables.
+export SVNROOT="svn://svn.FreeBSD.org/"
+export SRCBRANCH="base/head@rHEAD"
+export DOCBRANCH="doc/head@rHEAD"
+export PORTBRANCH="ports/head@rHEAD"
+export NODOC=yes
+export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
+export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
+export CHROOTDIR="/scratch"
+export EMBEDDEDBUILD=1
+export EMBEDDEDPORTS="lang/python textproc/gsed"
+
# Build chroot configuration
-TARGET="amd64"
-TARGET_ARCH="amd64"
-SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head@rHEAD"
-DOCBRANCH="doc/head@rHEAD"
-PORTBRANCH="ports/head@rHEAD"
-NODOC=yes
+load_chroot_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset XDEV XDEV_ARCH KERNEL
+ export TARGET="amd64"
+ export TARGET_ARCH="amd64"
+}
# Build target configuration
-# Since this file is sourced by a script that runs another
-# script, these must be exported.
-set -a
-WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-CHROOTDIR="/scratch"
-EMBEDDEDBUILD=1
-EMBEDDEDPORTS="lang/python textproc/gsed"
-XDEV="arm"
-XDEV_ARCH="armv6"
-XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
-KERNEL="RPI-B"
-CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
-CROCHETBRANCH="trunk"
-UBOOTSRC="https://github.com/gonzoua/u-boot-pi"
-UBOOTBRANCH="trunk"
-UBOOTDIR="/tmp/crochet/u-boot-rpi"
-set +a
+load_target_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset TARGET TARGET_ARCH
+ export XDEV="arm"
+ export XDEV_ARCH="armv6"
+ export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
+ export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
+ export KERNEL="RPI-B"
+ export CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
+ export CROCHETBRANCH="trunk"
+ export UBOOTSRC="https://github.com/gonzoua/u-boot-pi"
+ export UBOOTBRANCH="trunk"
+ export UBOOTDIR="/tmp/crochet/u-boot-rpi"
+}
diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf
index 15c257f4ea4c..67933df57aed 100644
--- a/release/arm/WANDBOARD-QUAD.conf
+++ b/release/arm/WANDBOARD-QUAD.conf
@@ -1,30 +1,37 @@
+#!/bin/sh
#
# $FreeBSD$
#
+# Global variables.
+export SVNROOT="svn://svn.FreeBSD.org/"
+export SRCBRANCH="base/head@rHEAD"
+export DOCBRANCH="doc/head@rHEAD"
+export PORTBRANCH="ports/head@rHEAD"
+export NODOC=yes
+export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
+export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
+export CHROOTDIR="/scratch"
+export EMBEDDEDBUILD=1
+export EMBEDDEDPORTS="lang/python textproc/gsed"
+
# Build chroot configuration
-TARGET="amd64"
-TARGET_ARCH="amd64"
-SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head@rHEAD"
-DOCBRANCH="doc/head@rHEAD"
-PORTBRANCH="ports/head@rHEAD"
-NODOC=yes
+load_chroot_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset XDEV XDEV_ARCH KERNEL
+ export TARGET="amd64"
+ export TARGET_ARCH="amd64"
+}
# Build target configuration
-# Since this file is sourced by a script that runs another
-# script, these must be exported.
-set -a
-WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-CHROOTDIR="/scratch"
-EMBEDDEDBUILD=1
-EMBEDDEDPORTS="lang/python textproc/gsed"
-XDEV="arm"
-XDEV_ARCH="armv6"
-XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
-KERNEL="WANDBOARD-QUAD"
-CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
-CROCHETBRANCH="trunk"
-set +a
-
+load_target_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset TARGET TARGET_ARCH
+ export XDEV="arm"
+ export XDEV_ARCH="armv6"
+ export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
+ export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
+ export KERNEL="WANDBOARD-QUAD"
+ export CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
+ export CROCHETBRANCH="trunk"
+}
diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf
index a1b8ebf3d18a..c35d692d346e 100644
--- a/release/arm/ZEDBOARD.conf
+++ b/release/arm/ZEDBOARD.conf
@@ -1,29 +1,36 @@
+#!/bin/sh
#
# $FreeBSD$
#
+# Global variables.
+export SVNROOT="svn://svn.FreeBSD.org/"
+export SRCBRANCH="base/head@rHEAD"
+export DOCBRANCH="doc/head@rHEAD"
+export PORTBRANCH="ports/head@rHEAD"
+export NODOC=yes
+export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
+export export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
+export CHROOTDIR="/scratch"
+export EMBEDDEDBUILD=1
+
# Build chroot configuration
-TARGET="amd64"
-TARGET_ARCH="amd64"
-SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head@rHEAD"
-DOCBRANCH="doc/head@rHEAD"
-PORTBRANCH="ports/head@rHEAD"
-NODOC=yes
+load_chroot_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset XDEV XDEV_ARCH KERNEL
+ export TARGET="amd64"
+ export TARGET_ARCH="amd64"
+}
# Build target configuration
-# Since this file is sourced by a script that runs another
-# script, these must be exported.
-set -a
-WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-CHROOTDIR="/scratch"
-EMBEDDEDBUILD=1
-XDEV="arm"
-XDEV_ARCH="armv6"
-XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
-KERNEL="ZEDBOARD"
-CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
-CROCHETBRANCH="trunk"
-set +a
-
+load_target_env() {
+ # Avoid collision with TARGET and XDEV.
+ unset TARGET TARGET_ARCH
+ export XDEV="arm"
+ export XDEV_ARCH="armv6"
+ export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
+ export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
+ export KERNEL="ZEDBOARD"
+ export CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
+ export CROCHETBRANCH="trunk"
+}
diff --git a/release/arm/release.sh b/release/arm/release.sh
index 479b8e53d048..cd7633a54f0b 100755
--- a/release/arm/release.sh
+++ b/release/arm/release.sh
@@ -94,9 +94,17 @@ install_uboot() {
main() {
# Build the 'xdev' target for crochet.
eval chroot ${CHROOTDIR} make -C /usr/src \
- ${XDEV_FLAGS} TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
+ ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \
+ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
${WORLD_FLAGS} xdev
+ # Install the cross-build symlinks to /usr/bin to make crochet
+ # happy.
+ eval chroot ${CHROOTDIR} make -C /usr/src \
+ ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \
+ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
+ ${WORLD_FLAGS} xdev-links
+
# Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints
# is created.
eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart
diff --git a/release/release.conf.sample b/release/release.conf.sample
index 66f0cf99cfd8..32d44688bfaf 100644
--- a/release/release.conf.sample
+++ b/release/release.conf.sample
@@ -3,6 +3,11 @@
# $FreeBSD$
#
+# Redefine environment variables here to override prototypes
+# defined in release.sh.
+load_chroot_env() { }
+load_target_env() { }
+
## Set the directory within which the release will be built.
CHROOTDIR="/scratch"
diff --git a/release/release.sh b/release/release.sh
index 73b706e223f1..9d345a0d7a92 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -39,6 +39,10 @@
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
export PATH
+# Prototypes that can be redefined per-chroot or per-target.
+load_chroot_env() { }
+load_target_env() { }
+
# The directory within which the release will be built.
CHROOTDIR="/scratch"
RELENGDIR="$(realpath $(dirname $(basename ${0})))"
@@ -124,10 +128,6 @@ DOCBRANCH="${SVNROOT}${DOCBRANCH}"
PORTBRANCH="${SVNROOT}${PORTBRANCH}"
if [ -n "${EMBEDDEDBUILD}" ]; then
- if [ -z "${XDEV}" ] || [ -z "${XDEV_ARCH}" ]; then
- echo "ERROR: XDEV and XDEV_ARCH must be set in ${RELEASECONF}."
- exit 1
- fi
WITH_DVD=
WITH_COMPRESSED_IMAGES=
NODOC=yes
@@ -161,6 +161,7 @@ if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then
else
ARCH_FLAGS=
fi
+load_chroot_env
CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
CHROOT_IMAKEFLAGS="${CONF_FILES}"
@@ -229,6 +230,7 @@ if [ -n "${EMBEDDEDBUILD}" ]; then
# release/, copy it to the /tmp/external directory within the chroot.
# This allows building embedded releases without relying on updated
# scripts and/or configurations to exist in the branch being built.
+ load_target_env
if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \
[ -e ${RELENGDIR}/${XDEV}/release.sh ]; then
mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/
@@ -261,6 +263,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then
fi
fi
+load_target_env
eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld
eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel
eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \