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
This commit is contained in:
Glen Barber 2014-02-21 23:18:35 +00:00
commit 2175208978
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/release-embedded/; revision=262314
11 changed files with 412 additions and 0 deletions

View File

@ -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

View File

@ -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

39
release/arm/RPI-B.conf Normal file
View File

@ -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

View File

@ -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

106
release/arm/release.sh Executable file
View File

@ -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

View File

@ -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=""

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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