svn commit: r262314 - in projects/release-embedded/release: . arm tools tools/arm
Glen Barber
gjb at FreeBSD.org
Fri Feb 21 23:18:38 UTC 2014
Author: gjb
Date: Fri Feb 21 23:18:35 2014
New Revision: 262314
URL: http://svnweb.freebsd.org/changeset/base/262314
Log:
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
Added:
projects/release-embedded/release/arm/
- copied from r259994, user/gjb/hacking/release-embedded/release/arm/
projects/release-embedded/release/arm/BEAGLEBONE.conf
- copied, changed from r261139, user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf
projects/release-embedded/release/arm/PANDABOARD.conf
- copied, changed from r261221, user/gjb/hacking/release-embedded/release/arm/PANDABOARD.conf
projects/release-embedded/release/arm/WANDBOARD-QUAD.conf
- copied unchanged from r262305, user/gjb/release-embedded/release/arm/WANDBOARD-QUAD.conf
projects/release-embedded/release/tools/
- copied from r260895, user/gjb/hacking/release-embedded/release/tools/
projects/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf
- copied, changed from r261139, user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf
projects/release-embedded/release/tools/arm/crochet-PANDABOARD.conf
- copied, changed from r261221, user/gjb/hacking/release-embedded/release/tools/arm/crochet-PANDABOARD.conf
projects/release-embedded/release/tools/arm/crochet-WANDBOARD-QUAD.conf
- copied unchanged from r262305, user/gjb/release-embedded/release/tools/arm/crochet-WANDBOARD-QUAD.conf
Modified:
projects/release-embedded/release/arm/RPI-B.conf
projects/release-embedded/release/arm/release.sh
projects/release-embedded/release/release.conf.sample
projects/release-embedded/release/release.sh
projects/release-embedded/release/tools/arm/crochet-RPI-B.conf
Copied and modified: projects/release-embedded/release/arm/BEAGLEBONE.conf (from r261139, user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf)
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf Fri Jan 24 22:12:59 2014 (r261139, copy source)
+++ projects/release-embedded/release/arm/BEAGLEBONE.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -17,18 +17,19 @@ SVNROOT="svn://svn.FreeBSD.org"
SRCBRANCH="base/head at rHEAD"
DOCBRANCH="doc/head at rHEAD"
PORTBRANCH="ports/head at rHEAD"
-EMBEDDED_WORLD_FLAGS="WITH_GCC=1"
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="arm"
+XDEV_ARCH="armv6"
KERNEL="BEAGLEBONE"
CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
CROCHETBRANCH="trunk"
Copied and modified: projects/release-embedded/release/arm/PANDABOARD.conf (from r261221, user/gjb/hacking/release-embedded/release/arm/PANDABOARD.conf)
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/PANDABOARD.conf Tue Jan 28 03:09:57 2014 (r261221, copy source)
+++ projects/release-embedded/release/arm/PANDABOARD.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -23,6 +23,8 @@ NODOC=yes
# 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"
Modified: projects/release-embedded/release/arm/RPI-B.conf
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/RPI-B.conf Sat Dec 28 02:27:06 2013 (r259994)
+++ projects/release-embedded/release/arm/RPI-B.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -23,11 +23,13 @@ NODOC=yes
# 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="arm"
+XDEV_ARCH="armv6"
KERNEL="RPI-B"
CROCHETSRC="https://github.com/kientzle/crochet-freebsd"
CROCHETBRANCH="trunk"
Copied: projects/release-embedded/release/arm/WANDBOARD-QUAD.conf (from r262305, user/gjb/release-embedded/release/arm/WANDBOARD-QUAD.conf)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/release-embedded/release/arm/WANDBOARD-QUAD.conf Fri Feb 21 23:18:35 2014 (r262314, copy of r262305, user/gjb/release-embedded/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 at rHEAD"
+DOCBRANCH="doc/head at rHEAD"
+PORTBRANCH="ports/head at 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
+
Modified: projects/release-embedded/release/arm/release.sh
==============================================================================
--- user/gjb/hacking/release-embedded/release/arm/release.sh Sat Dec 28 02:27:06 2013 (r259994)
+++ projects/release-embedded/release/arm/release.sh Fri Feb 21 23:18:35 2014 (r262314)
@@ -10,6 +10,43 @@
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
@@ -28,9 +65,15 @@ install_uboot() {
}
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 xdev
+ 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.
@@ -46,11 +89,17 @@ main() {
BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean
done
+ mkdir -p ${CHROOTDIR}/tmp/crochet/work
+ before_build
install_crochet
install_uboot
- mkdir -p ${CHROOTDIR}/tmp/crochet/work
eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \
- -c /usr/src/tools/release/${XDEV}/crochet-${KERNEL}.conf
+ -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 "$@"
Modified: projects/release-embedded/release/release.conf.sample
==============================================================================
--- projects/release-embedded/release/release.conf.sample Fri Feb 21 23:12:07 2014 (r262313)
+++ projects/release-embedded/release/release.conf.sample Fri Feb 21 23:18:35 2014 (r262314)
@@ -40,3 +40,11 @@ PORTBRANCH="ports/head at 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=""
+
Modified: projects/release-embedded/release/release.sh
==============================================================================
--- projects/release-embedded/release/release.sh Fri Feb 21 23:12:07 2014 (r262313)
+++ projects/release-embedded/release/release.sh Fri Feb 21 23:18:35 2014 (r262314)
@@ -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 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=
@@ -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_CO
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.
Copied and modified: projects/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf (from r261139, user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf)
==============================================================================
--- user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf Fri Jan 24 22:12:59 2014 (r261139, copy source)
+++ projects/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -17,11 +17,13 @@ WORKDIR=/usr/obj
_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH)
_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION)
KERNCONF=BEAGLEBONE
-FREEBSD_BUILDWORLD_EXTRA_ARGS=""
+TARGET=arm
+TARGET_ARCH=armv6
+FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}"
+FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}"
FREEBSD_INSTALLWORLD_EXTRA_ARGS=""
-FREEBSD_BUILDKERNEL_EXTRA_ARGS=""
FREEBSD_INSTALLKERNEL_EXTRA_ARGS=""
FREEBSD_WORLD_EXTRA_ARGS=""
FREEBSD_KERNEL_EXTRA_ARGS=""
FREEBSD_EXTRA_ARGS=""
-IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${KERNCONF}.img
+IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img
Copied and modified: projects/release-embedded/release/tools/arm/crochet-PANDABOARD.conf (from r261221, user/gjb/hacking/release-embedded/release/tools/arm/crochet-PANDABOARD.conf)
==============================================================================
--- user/gjb/hacking/release-embedded/release/tools/arm/crochet-PANDABOARD.conf Tue Jan 28 03:09:57 2014 (r261221, copy source)
+++ projects/release-embedded/release/tools/arm/crochet-PANDABOARD.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -19,11 +19,11 @@ _REVISION=$(make -C ${FREEBSD_SRC}/relea
KERNCONF=PANDABOARD
TARGET=arm
TARGET_ARCH=armv6
-FREEBSD_BUILDWORLD_EXTRA_ARGS=""
+FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}"
+FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}"
FREEBSD_INSTALLWORLD_EXTRA_ARGS=""
-FREEBSD_BUILDKERNEL_EXTRA_ARGS=""
FREEBSD_INSTALLKERNEL_EXTRA_ARGS=""
FREEBSD_WORLD_EXTRA_ARGS=""
FREEBSD_KERNEL_EXTRA_ARGS=""
FREEBSD_EXTRA_ARGS=""
-IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${KERNCONF}.img
+IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img
Modified: projects/release-embedded/release/tools/arm/crochet-RPI-B.conf
==============================================================================
--- user/gjb/hacking/release-embedded/release/tools/arm/crochet-RPI-B.conf Sun Jan 19 22:01:08 2014 (r260895)
+++ projects/release-embedded/release/tools/arm/crochet-RPI-B.conf Fri Feb 21 23:18:35 2014 (r262314)
@@ -17,11 +17,13 @@ WORKDIR=/usr/obj
_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH)
_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION)
KERNCONF=RPI-B
-FREEBSD_BUILDWORLD_EXTRA_ARGS=""
+TARGET=arm
+TARGET_ARCH=armv6
+FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}"
+FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}"
FREEBSD_INSTALLWORLD_EXTRA_ARGS=""
-FREEBSD_BUILDKERNEL_EXTRA_ARGS=""
FREEBSD_INSTALLKERNEL_EXTRA_ARGS=""
FREEBSD_WORLD_EXTRA_ARGS=""
FREEBSD_KERNEL_EXTRA_ARGS=""
FREEBSD_EXTRA_ARGS=""
-IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${KERNCONF}.img
+IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img
Copied: projects/release-embedded/release/tools/arm/crochet-WANDBOARD-QUAD.conf (from r262305, user/gjb/release-embedded/release/tools/arm/crochet-WANDBOARD-QUAD.conf)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/release-embedded/release/tools/arm/crochet-WANDBOARD-QUAD.conf Fri Feb 21 23:18:35 2014 (r262314, copy of r262305, user/gjb/release-embedded/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
More information about the svn-src-projects
mailing list