From 08234c3a961deb98702ce35e1addfcfad631cdbd Mon Sep 17 00:00:00 2001 From: gjb Date: Fri, 4 Apr 2014 22:20:33 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.freebsd.org/base/stable/9@264141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- release/arm/BEAGLEBONE.conf | 29 ++++ release/arm/PANDABOARD.conf | 29 ++++ release/arm/RPI-B.conf | 31 ++++ release/arm/WANDBOARD-QUAD.conf | 29 ++++ release/arm/ZEDBOARD.conf | 28 ++++ release/arm/release.sh | 133 ++++++++++++++++++ release/release.conf.sample | 14 +- release/release.sh | 88 +++++++++--- release/tools/arm/crochet-BEAGLEBONE.conf | 29 ++++ release/tools/arm/crochet-PANDABOARD.conf | 29 ++++ release/tools/arm/crochet-RPI-B.conf | 29 ++++ release/tools/arm/crochet-WANDBOARD-QUAD.conf | 29 ++++ release/tools/arm/crochet-ZEDBOARD.conf | 29 ++++ share/man/man7/release.7 | 73 +++++++++- 14 files changed, 575 insertions(+), 24 deletions(-) create mode 100644 release/arm/BEAGLEBONE.conf create mode 100644 release/arm/PANDABOARD.conf create mode 100644 release/arm/RPI-B.conf create mode 100644 release/arm/WANDBOARD-QUAD.conf create mode 100644 release/arm/ZEDBOARD.conf create mode 100755 release/arm/release.sh create mode 100644 release/tools/arm/crochet-BEAGLEBONE.conf create mode 100644 release/tools/arm/crochet-PANDABOARD.conf create mode 100644 release/tools/arm/crochet-RPI-B.conf create mode 100644 release/tools/arm/crochet-WANDBOARD-QUAD.conf create mode 100644 release/tools/arm/crochet-ZEDBOARD.conf diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf new file mode 100644 index 000000000..5a6f79cc2 --- /dev/null +++ b/release/arm/BEAGLEBONE.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/stable/9@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# 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" +KERNEL="BEAGLEBONE" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf new file mode 100644 index 000000000..8cd435fef --- /dev/null +++ b/release/arm/PANDABOARD.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/stable/9@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# 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" +KERNEL="PANDABOARD" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf new file mode 100644 index 000000000..c40330ddc --- /dev/null +++ b/release/arm/RPI-B.conf @@ -0,0 +1,31 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/stable/9@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# 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" +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 diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf new file mode 100644 index 000000000..d8cc9cc25 --- /dev/null +++ b/release/arm/WANDBOARD-QUAD.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/stable/9@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# 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" +KERNEL="WANDBOARD-QUAD" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf new file mode 100644 index 000000000..e71a83010 --- /dev/null +++ b/release/arm/ZEDBOARD.conf @@ -0,0 +1,28 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/stable/9@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# 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" +KERNEL="ZEDBOARD" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + diff --git a/release/arm/release.sh b/release/arm/release.sh new file mode 100755 index 000000000..2ab5cad03 --- /dev/null +++ b/release/arm/release.sh @@ -0,0 +1,133 @@ +#!/bin/sh +#- +# Copyright (c) 2013, 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# This script is intended to be called by release/release.sh to build ARM +# images for release. It is not intended to be run directly. This sets up +# the software needed within a build chroot, then runs crochet to provide +# downloadable images for embedded devices. + +set -e + +before_build() { + WANT_UBOOT= + KNOWNHASH= + UBOOT_VERSION= + case ${KERNEL} in + BEAGLEBONE) + WANT_UBOOT=1 + KNOWNHASH="4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e" + UBOOT_VERSION="u-boot-2013.04" + ;; + PANDABOARD) + WANT_UBOOT=1 + KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496" + UBOOT_VERSION="u-boot-2012.07" + ;; + WANDBOARD-QUAD) + WANT_UBOOT=1 + KNOWNHASH="0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55" + UBOOT_VERSION="u-boot-2013.10" + ;; + *) + # Fallthrough. + ;; + esac + if [ ! -z ${WANT_UBOOT} ]; then + chroot ${CHROOTDIR} fetch -o /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \ + http://people.freebsd.org/~gjb/${UBOOT_VERSION}.tar.bz2 + UBOOT_HASH="$(sha256 -q ${CHROOTDIR}/tmp/crochet/${UBOOT_VERSION}.tar.bz2)" + if [ "${UBOOT_HASH}" != "${KNOWNHASH}" ]; then + echo "Checksum mismatch! Exiting now." + exit 1 + fi + chroot ${CHROOTDIR} tar xf /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \ + -C /tmp/crochet/ + fi +} + +install_crochet() { + chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \ + /tmp/crochet +} + +install_uboot() { + # Only fetch u-boot sources if UBOOTSRC is set; otherwise it is + # not needed. + if [ -n "${UBOOTSRC}" ]; then + continue + else + return 0 + fi + chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \ + /${UBOOTDIR} +} + +main() { + # Build gcc for use in the chroot for arm builds. + # This is not '-j'-safe, so force '-j1' to allow using + # additional, non-'-j' options specified in WORLD_FLAGS. + eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ + WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install + # Build the 'xdev' target for crochet. + eval chroot ${CHROOTDIR} make -C /usr/src \ + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 \ + ${WORLD_FLAGS} xdev + + # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints + # is created. + eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + # Install security/ca_root_nss since we need to check the https + # certificate of github. + eval chroot ${CHROOTDIR} make -C /usr/ports/security/ca_root_nss \ + OPTIONS_SET="ETCSYMLINK" BATCH=1 FORCE_PKG_REGISTER=1 \ + install clean distclean + EMBEDDEDPORTS="${EMBEDDEDPORTS} devel/subversion" + for _PORT in ${EMBEDDEDPORTS}; do + eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ + BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + done + + mkdir -p ${CHROOTDIR}/tmp/crochet/work + before_build + install_crochet + install_uboot + eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \ + -c /tmp/external/${XDEV}/crochet-${KERNEL}.conf + mkdir -p ${CHROOTDIR}/R/ + cp -p ${CHROOTDIR}/usr/obj/*.img ${CHROOTDIR}/R/ + bzip2 ${CHROOTDIR}/R/FreeBSD*.img + cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.bz2 > CHECKSUM.SHA256 + cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.bz2 > CHECKSUM.MD5 +} + +main "$@" +exit 0 diff --git a/release/release.conf.sample b/release/release.conf.sample index a4e65aa3c..56ca79551 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -45,5 +45,17 @@ PORTBRANCH="ports/head@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= + diff --git a/release/release.sh b/release/release.sh index 9ca711ed3..b7428298f 100755 --- a/release/release.sh +++ b/release/release.sh @@ -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@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@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} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ # 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_CONF} ]; then 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 diff --git a/release/tools/arm/crochet-BEAGLEBONE.conf b/release/tools/arm/crochet-BEAGLEBONE.conf new file mode 100644 index 000000000..b261fc9c4 --- /dev/null +++ b/release/tools/arm/crochet-BEAGLEBONE.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD BeagleBone images. + +board_setup BeagleBone +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=BEAGLEBONE +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 diff --git a/release/tools/arm/crochet-PANDABOARD.conf b/release/tools/arm/crochet-PANDABOARD.conf new file mode 100644 index 000000000..f1924ba52 --- /dev/null +++ b/release/tools/arm/crochet-PANDABOARD.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD PandaBoard images. + +board_setup PandaBoard +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=PANDABOARD +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 diff --git a/release/tools/arm/crochet-RPI-B.conf b/release/tools/arm/crochet-RPI-B.conf new file mode 100644 index 000000000..76c50ea99 --- /dev/null +++ b/release/tools/arm/crochet-RPI-B.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD Raspberry Pi images. + +board_setup RaspberryPi +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=RPI-B +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 diff --git a/release/tools/arm/crochet-WANDBOARD-QUAD.conf b/release/tools/arm/crochet-WANDBOARD-QUAD.conf new file mode 100644 index 000000000..1790e6045 --- /dev/null +++ b/release/tools/arm/crochet-WANDBOARD-QUAD.conf @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD WandboardQuad images. + +board_setup WandboardQuad +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=WANDBOARD-QUAD +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 diff --git a/release/tools/arm/crochet-ZEDBOARD.conf b/release/tools/arm/crochet-ZEDBOARD.conf new file mode 100644 index 000000000..5b9caf18f --- /dev/null +++ b/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 diff --git a/share/man/man7/release.7 b/share/man/man7/release.7 index 952e61fc8..ed7fc2f70 100644 --- a/share/man/man7/release.7 +++ b/share/man/man7/release.7 @@ -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 following variables: .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 -- 2.45.0