From owner-svn-src-user@FreeBSD.ORG Fri Jan 24 22:13:00 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42EBE853; Fri, 24 Jan 2014 22:13:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2445E1E9F; Fri, 24 Jan 2014 22:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0OMD06t055086; Fri, 24 Jan 2014 22:13:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0OMCx8d055076; Fri, 24 Jan 2014 22:12:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201401242212.s0OMCx8d055076@svn.freebsd.org> From: Glen Barber Date: Fri, 24 Jan 2014 22:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r261139 - in user/gjb/hacking/release-embedded/release: arm tools/arm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2014 22:13:00 -0000 Author: gjb Date: Fri Jan 24 22:12:59 2014 New Revision: 261139 URL: http://svnweb.freebsd.org/changeset/base/261139 Log: Add initial support for building arm BEAGLEBONE images. - In arm/release.sh: - Move crochet work directory creation to occur earlier, since its parent directory is needed to store a fetched u-boot version. - Add a before_build() function as a quick hack to run board-specific (kernel configuration specific, really) commands, if any. - For the BEAGLEBONE kernel, a specific version of u-boot source is needed. Fetch the source in before_build() for this case. Unfortunately, there are no checksums available (that I can find) for these sources. For a quick solution, add the hard-coded sha256 of the tarball, and fetch from my public_html/ directory. A more permanent solution for this needs to be found. Add initial release.sh and crochet configuration files for the BEAGLEBONE build. Sponsored by: The FreeBSD Foundation Added: user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf (contents, props changed) user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf (contents, props changed) Modified: user/gjb/hacking/release-embedded/release/arm/release.sh Added: user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/release/arm/BEAGLEBONE.conf Fri Jan 24 22:12:59 2014 (r261139) @@ -0,0 +1,36 @@ +# +# $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" +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 +CHROOTDIR="/scratch" +EMBEDDEDBUILD=1 +EMBEDDEDPORTS="lang/python textproc/gsed" +XDEV="arm" +XDEV_ARCH="arm" +KERNEL="BEAGLEBONE" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + Modified: user/gjb/hacking/release-embedded/release/arm/release.sh ============================================================================== --- user/gjb/hacking/release-embedded/release/arm/release.sh Fri Jan 24 21:05:07 2014 (r261138) +++ user/gjb/hacking/release-embedded/release/arm/release.sh Fri Jan 24 22:12:59 2014 (r261139) @@ -10,6 +10,26 @@ set -e +before_build() { + case ${KERNEL} in + BEAGLEBONE) + KNOWNHASH="4150e5a4480707c55a8d5b4570262e43af68d8ed3bdc0a433d8e7df47989a69e" + chroot ${CHROOTDIR} fetch -o /tmp/crochet/u-boot-2013.04.tar.bz2 \ + http://people.freebsd.org/~gjb/u-boot-2013.04.tar.bz2 + UBOOT_HASH="$(sha256 -q ${CHROOTDIR}/tmp/crochet/u-boot-2013.04.tar.bz2)" + if [ "${UBOOT_HASH}" != "${KNOWNHASH}" ]; then + echo "Checksum mismatch! Exiting now." + exit 1 + fi + chroot ${CHROOTDIR} tar xf /tmp/crochet/u-boot-2013.04.tar.bz2 \ + -C /tmp/crochet/ + ;; + *) + # Fallthrough. + ;; + esac +} + install_crochet() { chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \ /tmp/crochet @@ -46,9 +66,10 @@ 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 /tmp/external/${XDEV}/crochet-${KERNEL}.conf } Added: user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/release/tools/arm/crochet-BEAGLEBONE.conf Fri Jan 24 22:12:59 2014 (r261139) @@ -0,0 +1,27 @@ +# +# $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 +FREEBSD_BUILDWORLD_EXTRA_ARGS="" +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