aboutsummaryrefslogtreecommitdiff
path: root/release/arm
diff options
context:
space:
mode:
Diffstat (limited to 'release/arm')
-rw-r--r--release/arm/BEAGLEBONE.conf61
-rw-r--r--release/arm/PANDABOARD.conf60
-rw-r--r--release/arm/RPI-B.conf69
-rw-r--r--release/arm/RPI2.conf67
-rw-r--r--release/arm/WANDBOARD-QUAD.conf37
-rw-r--r--release/arm/WANDBOARD.conf41
-rw-r--r--release/arm/ZEDBOARD.conf36
-rwxr-xr-xrelease/arm/release.sh151
8 files changed, 173 insertions, 349 deletions
diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf
index 72337f831cc3..3ae48714fc33 100644
--- a/release/arm/BEAGLEBONE.conf
+++ b/release/arm/BEAGLEBONE.conf
@@ -3,36 +3,35 @@
# $FreeBSD$
#
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-export EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-beaglebone"
+KERNEL="BEAGLEBONE"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="2m"
+FAT_TYPE="12"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
-}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export EMBEDDEDPORTS="lang/python textproc/gsed"
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="BEAGLEBONE"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
}
diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf
index dc8952d333b4..b5a120e9041b 100644
--- a/release/arm/PANDABOARD.conf
+++ b/release/arm/PANDABOARD.conf
@@ -3,35 +3,35 @@
# $FreeBSD$
#
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-export EMBEDDEDPORTS="lang/python textproc/gsed"
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-pandaboard"
+KERNEL="PANDABOARD"
+NODOC=1
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="2m"
+FAT_TYPE="12"
+MD_ARGS="-x 63 -y 255"
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
-}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="PANDABOARD"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
}
diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf
index aae60c9831a9..e5abaab9fd18 100644
--- a/release/arm/RPI-B.conf
+++ b/release/arm/RPI-B.conf
@@ -3,38 +3,41 @@
# $FreeBSD$
#
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-export EMBEDDEDPORTS="lang/python textproc/gsed"
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-rpi"
+KERNEL="RPI-B"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="17m"
+FAT_TYPE="16"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
-}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="RPI-B"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
- export UBOOTSRC="https://github.com/gonzoua/u-boot-pi"
- export UBOOTBRANCH="trunk"
- export UBOOTDIR="/tmp/crochet/u-boot-rpi"
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi"
+ UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \
+ start.elf start_cd.elf u-boot.img"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ for _UF in ${UBOOT_FILES}; do
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
+ ${FATMOUNT}/${_UF}
+ done
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \
+ ${FATMOUNT}/rpi.dtb
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
}
diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf
index bb8ebe998ca9..e1d15d124425 100644
--- a/release/arm/RPI2.conf
+++ b/release/arm/RPI2.conf
@@ -3,36 +3,41 @@
# $FreeBSD$
#
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-export EMBEDDEDPORTS="sysutils/u-boot-rpi2"
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-rpi2"
+KERNEL="RPI2"
+NODOC=1
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="50m"
+FAT_TYPE="16"
+MD_ARGS="-x 63 -y 255"
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2"
+ UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \
+ fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ for _UF in ${UBOOT_FILES}; do
+ chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \
+ ${FATMOUNT}/${_UF}
+ done
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \
+ ${FATMOUNT}/rpi2.dtb
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="RPI2"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
-}
-
diff --git a/release/arm/WANDBOARD-QUAD.conf b/release/arm/WANDBOARD-QUAD.conf
deleted file mode 100644
index c3fff91694ae..000000000000
--- a/release/arm/WANDBOARD-QUAD.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-export EMBEDDEDPORTS="lang/python textproc/gsed"
-
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
-}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="WANDBOARD-QUAD"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
-}
diff --git a/release/arm/WANDBOARD.conf b/release/arm/WANDBOARD.conf
new file mode 100644
index 000000000000..42b452310a16
--- /dev/null
+++ b/release/arm/WANDBOARD.conf
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+EMBEDDEDBUILD=1
+EMBEDDED_TARGET="arm"
+EMBEDDED_TARGET_ARCH="armv6"
+EMBEDDEDPORTS="sysutils/u-boot-wandboard"
+KERNEL="IMX6"
+WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x11000000"
+IMAGE_SIZE="1G"
+PART_SCHEME="MBR"
+FAT_SIZE="50m -b 16384"
+FAT_TYPE="16"
+MD_ARGS="-x 63 -y 255"
+NODOC=1
+
+arm_install_uboot() {
+ UBOOT_DIR="/usr/local/share/u-boot/u-boot-wandboard"
+ UBOOT_FILES="u-boot.imx"
+ FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+ UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
+ chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
+ of=/dev/${mddev} bs=512 seek=2
+ chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
+ chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+ chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
+ chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
+ chroot ${CHROOTDIR} /bin/sh -c 'echo \
+ setenv fdt_file wandboard-quad.dtb\; fatload mmc 0:1 11000000 ubldr\; bootelf 11000000\; \
+ > ${FATMOUNT}/boot.txt'
+ chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
+ sync
+ umount_loop ${CHROOTDIR}/${FATMOUNT}
+ umount_loop ${CHROOTDIR}/${UFSMOUNT}
+ chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+ chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
+
+ return 0
+}
diff --git a/release/arm/ZEDBOARD.conf b/release/arm/ZEDBOARD.conf
deleted file mode 100644
index 4d0a4615ba6b..000000000000
--- a/release/arm/ZEDBOARD.conf
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# Global variables.
-export SVNROOT="svn://svn.FreeBSD.org/"
-export SRCBRANCH="base/head@rHEAD"
-export DOCBRANCH="doc/head@rHEAD"
-export PORTBRANCH="ports/head@rHEAD"
-export NODOC=yes
-export WORLD_FLAGS="-j $(sysctl -n hw.ncpu)"
-export export KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))"
-export CHROOTDIR="/scratch"
-export EMBEDDEDBUILD=1
-
-# Build chroot configuration
-load_chroot_env() {
- # Avoid collision with TARGET and XDEV.
- unset XDEV XDEV_ARCH KERNEL
- export TARGET="amd64"
- export TARGET_ARCH="amd64"
-}
-
-# Build target configuration
-load_target_env() {
- # Avoid collision with TARGET and XDEV.
- unset TARGET TARGET_ARCH
- export XDEV="arm"
- export XDEV_ARCH="armv6"
- export XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1"
- export XDEV_FLAGS="${XDEV_FLAGS} MK_TESTS=no"
- export KERNEL="ZEDBOARD"
- export CROCHETSRC="https://github.com/freebsd/crochet"
- export CROCHETBRANCH="trunk@rHEAD"
-}
diff --git a/release/arm/release.sh b/release/arm/release.sh
deleted file mode 100755
index c68f812c7043..000000000000
--- a/release/arm/release.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-#-
-# Copyright (c) 2013, 2014 The FreeBSD Foundation
-# All rights reserved.
-#
-# This software was developed by Glen Barber
-# under sponsorship from the FreeBSD Foundation.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $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
- PANDABOARD)
- WANT_UBOOT=1
- KNOWNHASH="e08e20a6979bfca6eebb9a2b0e42aa4416af3d796332fd63a3470495a089d496"
- UBOOT_VERSION="u-boot-2012.07"
- ;;
- WANDBOARD-QUAD)
- WANT_UBOOT=1
- KNOWNHASH="b4f83b8db325c21671a997198ec3a373e2e00dde2fcf17be9b9afd7cfd727f56"
- UBOOT_VERSION="u-boot-2014.07"
- ;;
- *)
- # 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 [ -n "${UBOOTSRC}" ]; then
- continue
- else
- return 0
- fi
- chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \
- /${UBOOTDIR}
-}
-
-main() {
- # Fix broken ports that use kern.osreldate.
- OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
- export OSVERSION
- REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION)
- BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
- UNAME_r=${REVISION}-${BRANCH}
- export UNAME_r
- export XZ_CMD=$(chroot ${CHROOTDIR} make -C /usr/src/release -V XZ_CMD)
-
- # Build the 'xdev' target for crochet.
- eval chroot ${CHROOTDIR} make -C /usr/src \
- ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \
- TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
- ${WORLD_FLAGS} xdev
-
- # Install the cross-build symlinks to /usr/bin to make crochet
- # happy.
- eval chroot ${CHROOTDIR} make -C /usr/src \
- ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \
- TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
- ${WORLD_FLAGS} xdev-links || true
-
- # 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
-
- # Certain u-boot versions hardcode the use of a host gcc, and gcc's
- # build relies on having gperf installed.
- eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
- WITH_GCC=1 ${WORLD_FLAGS} obj
- eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
- WITH_GCC=1 ${WORLD_FLAGS} -j1 depend all
- eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/gperf \
- WITH_GCC=1 ${WORLD_FLAGS} -j1 install
- eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \
- WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install
-
- 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/
- ${XZ_CMD} ${CHROOTDIR}/R/FreeBSD*.img
- cd ${CHROOTDIR}/R/ && sha256 FreeBSD*.img.xz > CHECKSUM.SHA256
- cd ${CHROOTDIR}/R/ && md5 FreeBSD*.img.xz > CHECKSUM.MD5
-}
-
-main "$@"
-exit 0