3 # Copyright (c) 2013, 2014 The FreeBSD Foundation
6 # This software was developed by Glen Barber
7 # under sponsorship from the FreeBSD Foundation.
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
12 # 1. Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 # notice, this list of conditions and the following disclaimer in the
16 # documentation and/or other materials provided with the distribution.
18 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 # This script is intended to be called by release/release.sh to build ARM
34 # images for release. It is not intended to be run directly. This sets up
35 # the software needed within a build chroot, then runs crochet to provide
36 # downloadable images for embedded devices.
47 KNOWNHASH="7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31"
48 UBOOT_VERSION="u-boot-2014.04"
52 KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496"
53 UBOOT_VERSION="u-boot-2012.07"
57 KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56"
58 UBOOT_VERSION="u-boot-2014.07"
64 if [ ! -z ${WANT_UBOOT} ]; then
65 chroot ${CHROOTDIR} fetch -o /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \
66 http://people.freebsd.org/~gjb/${UBOOT_VERSION}.tar.bz2
67 UBOOT_HASH="$(sha256 -q ${CHROOTDIR}/tmp/crochet/${UBOOT_VERSION}.tar.bz2)"
68 if [ "${UBOOT_HASH}" != "${KNOWNHASH}" ]; then
69 echo "Checksum mismatch! Exiting now."
72 chroot ${CHROOTDIR} tar xf /tmp/crochet/${UBOOT_VERSION}.tar.bz2 \
78 chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \
83 # Only fetch u-boot sources if UBOOTSRC is set; otherwise it is
85 if [ -n "${UBOOTSRC}" ]; then
90 chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \
95 # Fix broken ports that use kern.osreldate.
96 OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
98 REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION)
99 BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
100 UNAME_r=${REVISION}-${BRANCH}
103 # Build the 'xdev' target for crochet.
104 eval chroot ${CHROOTDIR} make -C /usr/src \
105 ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \
108 # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints
110 eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart
111 # Install security/ca_root_nss since we need to check the https
112 # certificate of github.
113 eval chroot ${CHROOTDIR} make -C /usr/ports/security/ca_root_nss \
114 OPTIONS_SET="ETCSYMLINK" BATCH=1 FORCE_PKG_REGISTER=1 \
115 install clean distclean
116 EMBEDDEDPORTS="${EMBEDDEDPORTS} devel/subversion"
117 for _PORT in ${EMBEDDEDPORTS}; do
118 eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \
119 BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean
122 eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \
123 WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install
125 mkdir -p ${CHROOTDIR}/tmp/crochet/work
129 eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \
130 -c /tmp/external/${XDEV}/crochet-${KERNEL}.conf
131 mkdir -p ${CHROOTDIR}/R/
132 cp -p ${CHROOTDIR}/usr/obj/*.img ${CHROOTDIR}/R/
133 bzip2 ${CHROOTDIR}/R/FreeBSD*.img
134 cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.bz2 > CHECKSUM.SHA256
135 cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.bz2 > CHECKSUM.MD5