From a999844f367599fca642745efc2baf426a2d3e37 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 13 Feb 2019 21:39:48 +0100 Subject: [PATCH] device: bpi.conf and cross-build docs #113 --- README.md | 12 ++++++------ build/base.sh | 4 +--- build/common.sh | 5 +++++ build/kernel.sh | 3 ++- config/19.1/SMP-BPI | 3 +++ device/bpi.conf | 8 ++++++++ 6 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 device/bpi.conf diff --git a/README.md b/README.md index f189943..ebc592c 100644 --- a/README.md +++ b/README.md @@ -133,25 +133,25 @@ Cross-building for other architecures This feature is currently experimental and tailored for use with the Banana Pi. It requires installation -of the qemu package for user mode emulation: +of packages for cross building / user mode emulation: - # pkg install qemu-user-static + # pkg install arm-gnueabi-binutils qemu-user-static A cross-build on the operating system sources is executed by specifying the target architecture and custom kernel: - # make base kernel ARCH=arm:armv6 KERNEL=SMP-BPI + # make base kernel ARCH=arm:armv6 DEVICE=bpi In order to speed up building of using an emulated packages build, the xtools set can be created like so: - # make xtools ARCH=arm:armv6 + # make xtools ARCH=arm:armv6 DEVICE=bpi The xtools set is then used during the packages build similar to the distfiles set. - # make packages ARCH=arm:armv6 + # make packages ARCH=arm:armv6 DEVICE=bpi The image will also require a matching u-boot package: @@ -159,7 +159,7 @@ The image will also require a matching u-boot package: The final image is built using: - # make arm- ARCH=arm:armv6 + # make arm- ARCH=arm:armv6 DEVICE=bpi About other scripts and tweaks ============================== diff --git a/build/base.sh b/build/base.sh index bbe737f..32798c8 100644 --- a/build/base.sh +++ b/build/base.sh @@ -46,11 +46,9 @@ TARGET_ARCH=${PRODUCT_ARCH} TARGET=${PRODUCT_TARGET} SRCCONF=${CONFIGDIR}/src.conf __MAKE_CONF= +${MAKE_ARGS_DEV} " -# XXX for our BPI builds, needs a better place in the long run -MAKE_ARGS="${MAKE_ARGS} UBLDR_LOADADDR=0x42000000" - ${ENV_FILTER} make -s -C${SRCDIR} -j${CPUS} buildworld ${MAKE_ARGS} NO_CLEAN=yes ${ENV_FILTER} make -s -C${SRCDIR}/release obj ${MAKE_ARGS} diff --git a/build/common.sh b/build/common.sh index 8a7158f..d46ab39 100644 --- a/build/common.sh +++ b/build/common.sh @@ -242,6 +242,11 @@ export PRODUCT_CORE="${PRODUCT_TYPE}${PRODUCT_SUFFIX}" export PRODUCT_PLUGINS="os-*" export PRODUCT_PLUGIN="os-*${PRODUCT_SUFFIX}" +# load device-specific environment +if [ -f ${DEVICEDIR}/${PRODUCT_DEVICE}.conf ]; then + . ${DEVICEDIR}/${PRODUCT_DEVICE}.conf +fi + case "${SELF}" in confirm|info|print) ;; diff --git a/build/kernel.sh b/build/kernel.sh index 308fa5f..07030f4 100644 --- a/build/kernel.sh +++ b/build/kernel.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2014-2018 Franco Fichtner +# Copyright (c) 2014-2019 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -55,6 +55,7 @@ TARGET=${PRODUCT_TARGET} KERNCONF=${PRODUCT_KERNEL} SRCCONF=${CONFIGDIR}/src.conf __MAKE_CONF= +${MAKE_ARGS_DEV} " ${ENV_FILTER} make -s -C${SRCDIR} -j${CPUS} buildkernel ${MAKE_ARGS} NO_KERNELCLEAN=yes diff --git a/config/19.1/SMP-BPI b/config/19.1/SMP-BPI index 665ce99..cb3572f 100644 --- a/config/19.1/SMP-BPI +++ b/config/19.1/SMP-BPI @@ -21,6 +21,9 @@ options TCP_SIGNATURE device wlan_acl device wlan_xauth +# XXX build error +nodevice re + # Not all architectures have a consistent GENERIC device netmap diff --git a/device/bpi.conf b/device/bpi.conf new file mode 100644 index 0000000..eda193f --- /dev/null +++ b/device/bpi.conf @@ -0,0 +1,8 @@ +# http://www.banana-pi.org/ + +export MAKE_ARGS_DEV=" +CROSS_BINUTILS_PREFIX=/usr/local/arm-gnueabi-freebsd11.2/bin +UBLDR_LOADADDR=0x42000000 +" + +export PRODUCT_KERNEL=SMP-BPI