Add initial support for building RPI2 images.
In release.sh, allow overriding buildenv_setup() before the handoff to arm/release.sh. Copy arm/RPI-B.conf -> arm/RPI2.conf, set UBOOT_PORT and the correct KERNEL, and add the buildenv_setup() override to install the sysutils/u-boot-rpi2 port/package. Copy tools/arm/crochet-RPI-B.conf -> tools/arm/crochet-RPI2.conf, and set the correct entries for the RaspberryPi2 board. Thanks to: loos@ Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
65c3de4e62
commit
20a67b0520
53
release/arm/RPI2.conf
Normal file
53
release/arm/RPI2.conf
Normal file
@ -0,0 +1,53 @@
|
||||
#!/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 UBOOT_PORT="sysutils/u-boot-rpi2"
|
||||
|
||||
# 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="RPI2"
|
||||
export CROCHETSRC="https://github.com/freebsd/crochet"
|
||||
export CROCHETBRANCH="trunk@rHEAD"
|
||||
}
|
||||
|
||||
# Build environment setup
|
||||
buildenv_setup() {
|
||||
if [ ! -d ${CHROOTDIR}/usr/ports/${UBOOT_PORT} ]; then
|
||||
chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
|
||||
/usr/sbin/pkg bootstrap -y
|
||||
chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
|
||||
/usr/sbin/pkg install -y ${UBOOT_PORT}
|
||||
else
|
||||
chroot ${CHROOTDIR} env BATCH=1 \
|
||||
make -C /usr/ports/${UBOOT_PORT} \
|
||||
all install clean
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -238,6 +238,7 @@ fi
|
||||
|
||||
# Embedded builds do not use the 'make release' target.
|
||||
if [ -n "${EMBEDDEDBUILD}" ]; then
|
||||
buildenv_setup
|
||||
# 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
|
||||
|
29
release/tools/arm/crochet-RPI2.conf
Normal file
29
release/tools/arm/crochet-RPI2.conf
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
# This is the configuration file for use with crochet to produce
|
||||
# FreeBSD Raspberry Pi 2 images.
|
||||
|
||||
board_setup RaspberryPi2
|
||||
option ImageSize 1gb
|
||||
option Growfs
|
||||
|
||||
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=RPI2
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user