aboutsummaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-02-21 23:18:35 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-02-21 23:18:35 +0000
commit2175208978a0472fd44303d9e3fc95c2085fca98 (patch)
treef97ec9870f850da3a64093d8ca1ce5cd109924a7 /release
parent4258c52e294267e96462f4007b0670bc9fd73540 (diff)
parentd91104f02e4a69f32f82a10ed9dc3b5e95800efd (diff)
downloadsrc-2175208978a0472fd44303d9e3fc95c2085fca98.tar.gz
src-2175208978a0472fd44303d9e3fc95c2085fca98.zip
Merge the following:
^/user/gjb/hacking/release-embedded: 259994,260000,260895-260896,261139,261152, 261174,261176,261210,261221,261237,261239, 261448,261489 ^/user/gjb/release-embedded: 262305,262307 svn:mergeinfo is intentionally not included in the commit, so it does not propagate to head/. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-embedded/; revision=262314
Diffstat (limited to 'release')
-rw-r--r--release/arm/BEAGLEBONE.conf37
-rw-r--r--release/arm/PANDABOARD.conf37
-rw-r--r--release/arm/RPI-B.conf39
-rw-r--r--release/arm/WANDBOARD-QUAD.conf37
-rwxr-xr-xrelease/arm/release.sh106
-rw-r--r--release/release.conf.sample8
-rwxr-xr-xrelease/release.sh32
-rw-r--r--release/tools/arm/crochet-BEAGLEBONE.conf29
-rw-r--r--release/tools/arm/crochet-PANDABOARD.conf29
-rw-r--r--release/tools/arm/crochet-RPI-B.conf29
-rw-r--r--release/tools/arm/crochet-WANDBOARD-QUAD.conf29
11 files changed, 412 insertions, 0 deletions
diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf
new file mode 100644
index 000000000000..6d9927c0542b
--- /dev/null
+++ b/release/arm/BEAGLEBONE.conf
@@ -0,0 +1,37 @@
+#
+# $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@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 $(expr \( $(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 000000000000..1e2b7a3fd181
--- /dev/null
+++ b/release/arm/PANDABOARD.conf
@@ -0,0 +1,37 @@
+#
+# $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@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 $(expr \( $(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 000000000000..417af4ed8df4
--- /dev/null
+++ b/release/arm/RPI-B.conf
@@ -0,0 +1,39 @@
+#
+# $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@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 $(expr \( $(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 000000000000..b901b3d317ce
--- /dev/null
+++ b/release/arm/WANDBOARD-QUAD.conf
@@ -0,0 +1,37 @@
+#
+# $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@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 $(expr \( $(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/release.sh b/release/arm/release.sh
new file mode 100755
index 000000000000..9124e9f34ff0
--- /dev/null
+++ b/release/arm/release.sh
@@ -0,0 +1,106 @@
+#!/bin/sh
+#
+# $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 [ "X${UBOOTSRC}" != "X" ]; 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 882f911b31fd..870d6169cf67 100644
--- a/release/release.conf.sample
+++ b/release/release.conf.sample
@@ -40,3 +40,11 @@ PORTBRANCH="ports/head@rHEAD"
#NOPORTS=
#RELSTRING=
#WITH_DVD=
+
+## Set when building embedded images.
+#EMBEDDEDBUILD=
+
+## Set to specify userland-specific make(1) flags that affect the
+## build chroot environment.
+#EMBEDDED_WORLD_FLAGS=""
+
diff --git a/release/release.sh b/release/release.sh
index 79419c4feb5e..3fc264f86cc3 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -37,6 +37,7 @@ export PATH
# The directory within which the release will be built.
CHROOTDIR="/scratch"
+RELENGDIR="$(realpath $(dirname $(basename ${0})))"
# The default svn checkout server, and svn branches for src/, doc/,
# and ports/.
@@ -45,6 +46,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=
@@ -98,6 +102,11 @@ while getopts c: opt; do
done
shift $(($OPTIND - 1))
+if [ "x${EMBEDDEDBUILD}" != "x" ]; then
+ 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
@@ -184,6 +193,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 [ "X${EMBEDDEDBUILD}" != "X" ]; 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.
diff --git a/release/tools/arm/crochet-BEAGLEBONE.conf b/release/tools/arm/crochet-BEAGLEBONE.conf
new file mode 100644
index 000000000000..b261fc9c4dfc
--- /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 000000000000..f1924ba522fa
--- /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 000000000000..76c50ea99358
--- /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 000000000000..1790e60455f2
--- /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