summaryrefslogtreecommitdiffstats
path: root/ci/build-all-defconfigs.sh
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.ibm.com>2018-08-24 13:30:15 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-08-30 17:29:00 +1000
commitc4b9bf64b047fff3aec6773fd3397268773062e4 (patch)
tree7a47d58f41afcec74b113bd5c1dd125bf2a85196 /ci/build-all-defconfigs.sh
parentfb432100e9473c6bc96e9d7edbd578e70465c285 (diff)
downloadblackbird-op-build-c4b9bf64b047fff3aec6773fd3397268773062e4.tar.gz
blackbird-op-build-c4b9bf64b047fff3aec6773fd3397268773062e4.zip
ci: Build more targets, cache SDKs, eatmydata
Build graph-depends and legal-info along with firmware images Also, use proper O=/foo for telling buildroot where to build images. Also, use the magic buildroot config script rather than hacky hacks. Support building and caching an SDK, meaning you can build simple defconfigs in dozens of minutes, and greatly reduce the total time for building all configurations. Eatmydata will save us a *lot* of fsync() activity when you don't have infinite IOPS. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'ci/build-all-defconfigs.sh')
-rwxr-xr-xci/build-all-defconfigs.sh55
1 files changed, 35 insertions, 20 deletions
diff --git a/ci/build-all-defconfigs.sh b/ci/build-all-defconfigs.sh
index 839d30a5..0ab53bff 100755
--- a/ci/build-all-defconfigs.sh
+++ b/ci/build-all-defconfigs.sh
@@ -8,18 +8,24 @@ CONFIGTAG="_defconfig"
DEFCONFIGS=();
-while getopts "o:p:r" opt; do
+SDK_DIR=""
+
+while getopts "o:p:rs:" opt; do
case $opt in
o)
echo "Output directory: $OPTARG"
OUTDIR="$OPTARG"
;;
+ s)
+ echo "SDK is in: $OPTARG"
+ SDK_DIR=$OPTARG
+ ;;
p)
echo "Platforms to build: $OPTARG"
PLATFORM_LIST="$OPTARG"
;;
r)
- echo "Build legal-info for release"
+ echo "Build legal-info etc for release"
BUILD_INFO=1
;;
\?)
@@ -61,26 +67,35 @@ if [ -n "$DL_DIR" ]; then
export BR2_DL_DIR=${DL_DIR}
fi
-for i in ${DEFCONFIGS[@]}; do
- rm -rf output/*
- op-build $i
- echo 'BR2_CCACHE=y' >> output/.config
- echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config
- echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config
+if [ -f $(ldconfig -p | grep libeatmydata.so | tr ' ' '\n' | grep /|head -n1) ]; then
+ export LD_PRELOAD=${LD_PRELOAD:+"$LD_PRELOAD "}libeatmydata.so
+fi
- op-build olddefconfig
- op-build
+for i in ${DEFCONFIGS[@]}; do
+ export O=${OUTDIR}-$i
+ rm -rf $O
+ op-build O=$O $i
+ ./buildroot/utils/config --file $O/.config --set-val BR2_CCACHE y
+ ./buildroot/utils/config --file $O/.config --set-str BR2_CCACHE_DIR $CCACHE_DIR
+ if [ -d "$SDK_DIR" ]; then
+ ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL y
+ ./buildroot/utils/config --file $O/.config --set-str BR2_TOOLCHAIN_EXTERNAL_PATH $SDK_DIR
+ ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC y
+ ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_CXX y
+ # FIXME: How do we work this out programatically?
+ ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_GCC_6 y
+ ./buildroot/utils/config --file $O/.config --set-val BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_18 y
+ fi
+ op-build O=$O olddefconfig
+ op-build O=$O
r=$?
-
- if [ ${BUILD_INFO} = 1 ] && [ $r = 0 ]; then
- op-build legal-info
- mv output/legal-info ${OUTDIR}/$i-legal-info
- fi
-
- mkdir ${OUTDIR}/$i-images
- mv output/images/* ${OUTDIR}/$i-images/
- mv output/.config ${OUTDIR}/$i-images/.config
- lsb_release -a > ${OUTDIR}/$i-images/lsb_release
+ if [ ${BUILD_INFO} = 1 ] && [ $r = 0 ]; then
+ op-build O=$O legal-info
+ op-build O=$O graph-build
+ op-build O=$O graph-size
+ op-build O=$O graph-depends
+ fi
+ lsb_release -a > $O/lsb_release
if [ $r -ne 0 ]; then
exit $r
fi
OpenPOWER on IntegriCloud