svn commit: r264141 - in stable/9: release release/arm release/tools release/tools/arm share/man/man7
Glen Barber
gjb at FreeBSD.org
Fri Apr 4 22:20:35 UTC 2014
Author: gjb
Date: Fri Apr 4 22:20:33 2014
New Revision: 264141
URL: http://svnweb.freebsd.org/changeset/base/264141
Log:
MFC r262810, r262862, r264105, r264107:
r262810:
Merge enabling building FreeBSD/arm images as part of the
release build process.
r262862:
Provide backwards-compatibility with release.conf SVNROOT
entries that do not have a trailing '/'.
r264105:
Add ZEDBOARD support for release builds.
r264107:
Remove only-works-on-amd64 restriction.
* Local modifications to stable/9:
- Set SRCBRANCH from head/ to stable/9/.
Sponsored by: The FreeBSD Foundation
Added:
stable/9/release/arm/
- copied from r262810, head/release/arm/
stable/9/release/arm/ZEDBOARD.conf
- copied, changed from r264105, head/release/arm/ZEDBOARD.conf
stable/9/release/tools/
- copied from r262810, head/release/tools/
stable/9/release/tools/arm/crochet-ZEDBOARD.conf
- copied unchanged from r264105, head/release/tools/arm/crochet-ZEDBOARD.conf
Modified:
stable/9/release/arm/BEAGLEBONE.conf
stable/9/release/arm/PANDABOARD.conf
stable/9/release/arm/RPI-B.conf
stable/9/release/arm/WANDBOARD-QUAD.conf
stable/9/release/release.conf.sample
stable/9/release/release.sh
stable/9/share/man/man7/release.7
Directory Properties:
stable/9/release/ (props changed)
stable/9/share/man/man7/ (props changed)
Modified: stable/9/release/arm/BEAGLEBONE.conf
==============================================================================
--- head/release/arm/BEAGLEBONE.conf Wed Mar 5 23:17:53 2014 (r262810)
+++ stable/9/release/arm/BEAGLEBONE.conf Fri Apr 4 22:20:33 2014 (r264141)
@@ -2,19 +2,11 @@
# $FreeBSD$
#
-# This is only supported on amd64 right now. It may work on
-# i386, but I do not have the hardware to test, so until I get
-# a VM set up to make sure, be cautious and assume it will not.
-if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then
- echo "This is only supported on amd64 right now."
- exit 0
-fi
-
# Build chroot configuration
TARGET="amd64"
TARGET_ARCH="amd64"
SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head at rHEAD"
+SRCBRANCH="base/stable/9 at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
NODOC=yes
Modified: stable/9/release/arm/PANDABOARD.conf
==============================================================================
--- head/release/arm/PANDABOARD.conf Wed Mar 5 23:17:53 2014 (r262810)
+++ stable/9/release/arm/PANDABOARD.conf Fri Apr 4 22:20:33 2014 (r264141)
@@ -2,19 +2,11 @@
# $FreeBSD$
#
-# This is only supported on amd64 right now. It may work on
-# i386, but I do not have the hardware to test, so until I get
-# a VM set up to make sure, be cautious and assume it will not.
-if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then
- echo "This is only supported on amd64 right now."
- exit 0
-fi
-
# Build chroot configuration
TARGET="amd64"
TARGET_ARCH="amd64"
SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head at rHEAD"
+SRCBRANCH="base/stable/9 at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
NODOC=yes
Modified: stable/9/release/arm/RPI-B.conf
==============================================================================
--- head/release/arm/RPI-B.conf Wed Mar 5 23:17:53 2014 (r262810)
+++ stable/9/release/arm/RPI-B.conf Fri Apr 4 22:20:33 2014 (r264141)
@@ -2,19 +2,11 @@
# $FreeBSD$
#
-# This is only supported on amd64 right now. It may work on
-# i386, but I do not have the hardware to test, so until I get
-# a VM set up to make sure, be cautious and assume it will not.
-if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then
- echo "This is only supported on amd64 right now."
- exit 0
-fi
-
# Build chroot configuration
TARGET="amd64"
TARGET_ARCH="amd64"
SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head at rHEAD"
+SRCBRANCH="base/stable/9 at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
NODOC=yes
Modified: stable/9/release/arm/WANDBOARD-QUAD.conf
==============================================================================
--- head/release/arm/WANDBOARD-QUAD.conf Wed Mar 5 23:17:53 2014 (r262810)
+++ stable/9/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 22:20:33 2014 (r264141)
@@ -2,19 +2,11 @@
# $FreeBSD$
#
-# This is only supported on amd64 right now. It may work on
-# i386, but I do not have the hardware to test, so until I get
-# a VM set up to make sure, be cautious and assume it will not.
-if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then
- echo "This is only supported on amd64 right now."
- exit 0
-fi
-
# Build chroot configuration
TARGET="amd64"
TARGET_ARCH="amd64"
SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head at rHEAD"
+SRCBRANCH="base/stable/9 at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
NODOC=yes
Copied and modified: stable/9/release/arm/ZEDBOARD.conf (from r264105, head/release/arm/ZEDBOARD.conf)
==============================================================================
--- head/release/arm/ZEDBOARD.conf Fri Apr 4 07:02:38 2014 (r264105, copy source)
+++ stable/9/release/arm/ZEDBOARD.conf Fri Apr 4 22:20:33 2014 (r264141)
@@ -6,7 +6,7 @@
TARGET="amd64"
TARGET_ARCH="amd64"
SVNROOT="svn://svn.FreeBSD.org/"
-SRCBRANCH="base/head at rHEAD"
+SRCBRANCH="base/stable/9 at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
NODOC=yes
Modified: stable/9/release/release.conf.sample
==============================================================================
--- stable/9/release/release.conf.sample Fri Apr 4 21:35:17 2014 (r264140)
+++ stable/9/release/release.conf.sample Fri Apr 4 22:20:33 2014 (r264141)
@@ -45,5 +45,17 @@ PORTBRANCH="ports/head at rHEAD"
## Set miscellaneous 'make release' settings.
#NODOC=
#NOPORTS=
-#RELSTRING=
#WITH_DVD=
+
+## Set when building embedded images.
+#EMBEDDEDBUILD=
+
+## Set to skip the chroot environment buildworld/installworld/distribution
+## step if it is expected the build environment will exist via alternate
+## means.
+#CHROOTBUILD_SKIP=
+
+## Set to pass additional flags to make(1) for the build chroot setup, such
+## as TARGET/TARGET_ARCH.
+#CHROOT_MAKEENV=
+
Modified: stable/9/release/release.sh
==============================================================================
--- stable/9/release/release.sh Fri Apr 4 21:35:17 2014 (r264140)
+++ stable/9/release/release.sh Fri Apr 4 22:20:33 2014 (r264141)
@@ -41,6 +41,7 @@ export PATH
# The directory within which the release will be built.
CHROOTDIR="/scratch"
+RELENGDIR="$(realpath $(dirname $(basename ${0})))"
# The default version control system command to obtain the sources.
VCSCMD="svn checkout"
@@ -52,6 +53,9 @@ SRCBRANCH="base/head at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
+# Set for embedded device builds.
+EMBEDDEDBUILD=
+
# Sometimes one needs to checkout src with --force svn option.
# If custom kernel configs copied to src tree before checkout, e.g.
SRC_FORCE_CHECKOUT=
@@ -103,14 +107,33 @@ while getopts c: opt; do
done
shift $(($OPTIND - 1))
+# Fix for backwards-compatibility with release.conf that does not have the
+# trailing '/'.
+case ${SVNROOT} in
+ *svn*)
+ SVNROOT="${SVNROOT}/"
+ ;;
+ *)
+ ;;
+esac
+
# Prefix the branches with the SVNROOT for the full checkout URL.
SRCBRANCH="${SVNROOT}${SRCBRANCH}"
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=
+ NODOC=yes
+fi
+
# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree
# is required to build the documentation set.
-if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then
+if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then
echo "*** NOTICE: Setting NODOC=1 since ports tree is required"
echo " and NOPORTS is set."
NODOC=yes
@@ -120,10 +143,10 @@ fi
# The release makefile verifies definedness of NOPORTS/NODOC variables
# instead of their values.
DOCPORTS=
-if [ "x${NOPORTS}" != "x" ]; then
+if [ -n "${NOPORTS}" ]; then
DOCPORTS="NOPORTS=yes "
fi
-if [ "x${NODOC}" != "x" ]; then
+if [ -n "${NODOC}" ]; then
DOCPORTS="${DOCPORTS}NODOC=yes"
fi
@@ -131,12 +154,12 @@ fi
# this file, unless overridden by release.conf. In most cases, these
# will not need to be changed.
CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}"
-if [ "x${TARGET}" != "x" ] && [ "x${TARGET_ARCH}" != "x" ]; then
+if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then
ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}"
else
ARCH_FLAGS=
fi
-CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
+CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj"
CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}"
CHROOT_IMAKEFLAGS="${CONF_FILES}"
CHROOT_DMAKEFLAGS="${CONF_FILES}"
@@ -147,11 +170,11 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO
# Force src checkout if configured
FORCE_SRC_KEY=
-if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then
+if [ -n "${SRC_FORCE_CHECKOUT}" ]; then
FORCE_SRC_KEY="--force"
fi
-if [ ! ${CHROOTDIR} ]; then
+if [ -z "${CHROOTDIR}" ]; then
echo "Please set CHROOTDIR."
exit 1
fi
@@ -166,19 +189,21 @@ set -e # Everything must succeed
mkdir -p ${CHROOTDIR}/usr
${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src
-if [ "x${NODOC}" = "x" ]; then
+if [ -z "${NODOC}" ]; then
${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc
fi
-if [ "x${NOPORTS}" = "x" ]; then
+if [ -z "${NOPORTS}" ]; then
${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports
fi
-cd ${CHROOTDIR}/usr/src
-env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld
-env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \
- DESTDIR=${CHROOTDIR}
-env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \
- DESTDIR=${CHROOTDIR}
+if [ -z "${CHROOTBUILD_SKIP}" ]; then
+ cd ${CHROOTDIR}/usr/src
+ env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld
+ env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \
+ DESTDIR=${CHROOTDIR}
+ env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \
+ DESTDIR=${CHROOTDIR}
+fi
mount -t devfs devfs ${CHROOTDIR}/dev
cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf
trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit
@@ -194,6 +219,29 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO
cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF}
fi
+# Embedded builds do not use the 'make release' target.
+if [ -n "${EMBEDDEDBUILD}" ]; then
+ # If a crochet configuration file exists in *this* checkout of
+ # 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.
+ if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \
+ [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then
+ mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/
+ cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \
+ ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf
+ /bin/sh ${RELENGDIR}/${XDEV}/release.sh
+ fi
+ # If the script does not exist for this architecture, exit.
+ # This probably should be checked earlier, but allowing the rest
+ # of the build process to get this far will at least set up the
+ # chroot environment for testing.
+ exit 0
+else
+ # Not embedded.
+ continue
+fi
+
if [ -d ${CHROOTDIR}/usr/ports ]; then
# Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints
# is created. This is needed by ports-mgmt/pkg.
@@ -201,7 +249,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then
## Trick the ports 'run-autotools-fixup' target to do the right thing.
_OSVERSION=$(sysctl -n kern.osreldate)
- if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then
+ if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then
PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes"
PBUILD_FLAGS="${PBUILD_FLAGS}"
chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \
@@ -209,13 +257,9 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then
fi
fi
-if [ "x${RELSTRING}" = "x" ]; then
- RELSTRING="$(chroot ${CHROOTDIR} uname -s)-${OSRELEASE}-${TARGET_ARCH}"
-fi
-
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} \
- release RELSTRING=${RELSTRING}
+ release
eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
- install DESTDIR=/R RELSTRING=${RELSTRING}
+ install DESTDIR=/R
Copied: stable/9/release/tools/arm/crochet-ZEDBOARD.conf (from r264105, head/release/tools/arm/crochet-ZEDBOARD.conf)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/9/release/tools/arm/crochet-ZEDBOARD.conf Fri Apr 4 22:20:33 2014 (r264141, copy of r264105, head/release/tools/arm/crochet-ZEDBOARD.conf)
@@ -0,0 +1,29 @@
+#
+# $FreeBSD$
+#
+
+# This is the configuration file for use with crochet to produce
+# FreeBSD ZedBoard images.
+
+board_setup ZedBoard
+option ImageSize 1gb
+option AutoSize
+
+export MAKEOBJDIRPREFIX=/usr/obj
+FREEBSD_SRC=/usr/src
+__MAKE_CONF=/dev/null
+SRCCONF=/dev/null
+WORKDIR=/usr/obj
+_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH)
+_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION)
+KERNCONF=ZEDBOARD
+TARGET=arm
+TARGET_ARCH=armv6
+FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}"
+FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}"
+FREEBSD_INSTALLWORLD_EXTRA_ARGS=""
+FREEBSD_INSTALLKERNEL_EXTRA_ARGS=""
+FREEBSD_WORLD_EXTRA_ARGS=""
+FREEBSD_KERNEL_EXTRA_ARGS=""
+FREEBSD_EXTRA_ARGS=""
+IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img
Modified: stable/9/share/man/man7/release.7
==============================================================================
--- stable/9/share/man/man7/release.7 Fri Apr 4 21:35:17 2014 (r264140)
+++ stable/9/share/man/man7/release.7 Fri Apr 4 22:20:33 2014 (r264141)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 25, 2014
+.Dd March 5, 2014
.Dt RELEASE 7
.Os
.Sh NAME
@@ -138,6 +138,11 @@ configuration file supports the followin
.Bl -tag -width Ev
.It Va CHROOTDIR
The directory within which the release will be built.
+.It Va CHROOT_MAKEENV
+Additional
+.Xr make 1
+arguments to pass through, which directly affect the
+tuning of the build chroot.
.It Va SVNROOT
The
.Xr svn 1
@@ -249,6 +254,72 @@ target.
The command run to obtain the source trees.
Defaults to
.Qq Cm svn checkout .
+.It Va CHROOTBUILD_SKIP
+If defined, the
+.Li buildworld ,
+.Li installworld ,
+and
+.Li distribution
+stages of the
+.Xr chroot 8
+build environment setup are skipped.
+This is intended solely for cases where the
+.Xr chroot 8
+userland are provided by alternate means.
+.El
+.Sh EMBEDDED BUILDS
+The following
+.Fa release.conf
+variables are relevant only to release builds for embedded systems:
+.Bl -tag -width Ev
+.It Va EMBEDDEDBUILD
+Set to a non-null value to enable functionality for embedded device
+release builds.
+.Pq This option is considered highly experimental.
+.Pp
+When set,
+.Va WITH_DVD
+is unset, and
+.Va NODOC
+is defined.
+Additionally,
+.Va XDEV
+and
+.Va XDEV_ARCH
+must also be defined.
+When the build environment is created,
+.Fa release.sh
+runs a separate build script located in an architecture-specific
+directory in
+.Pa src/release/${XDEV}/ .
+.It Va EMBEDDEDPORTS
+Set to the list of any ports that are required for the target device
+in the format of
+.Fa category/port .
+The
+.Fa devel/subversion
+port is built by default.
+.It Va CROCHETSRC
+Set to the source URL for the Crochet build tool.
+.It Va CROCHETBRANCH
+Set to the subversion branch from
+.Va ${CROCHETSRC}
+to use.
+Defaults to
+.Pa trunk .
+.It Va UBOOTSRC
+Set to the source URL of u-boot, if required.
+.It Va UBOOTBRANCH
+Set to the subversion branch from
+.Va ${UBOOTSRC}
+to use.
+Defaults to
+.Pa trunk .
+.It Va UBOOTDIR
+Set to the target directory within
+.Va ${CHROOTDIR}
+to check out
+.Va ${UBOOTSRC}/${UBOOTBRANCH} .
.El
.Sh MAKEFILE TARGETS
The release makefile
More information about the svn-src-stable-9
mailing list