summaryrefslogtreecommitdiffstats
path: root/ci/build.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.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.sh')
-rwxr-xr-xci/build.sh48
1 files changed, 37 insertions, 11 deletions
diff --git a/ci/build.sh b/ci/build.sh
index b313291e..012aaef0 100755
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -2,8 +2,19 @@
CONTAINERS="ubuntu1604 fedora27"
-while getopts ":ab:hp:c:r" opt; do
+
+SDK_ONLY=0
+
+while getopts ":ab:hp:c:rs:S" opt; do
case $opt in
+ s)
+ echo "SDK Cache dir"
+ SDK_CACHE="$OPTARG"
+ ;;
+ S)
+ echo "Build SDK Only"
+ SDK_ONLY=1
+ ;;
a)
echo "Build firmware images for all the platforms"
PLATFORMS=""
@@ -26,6 +37,8 @@ while getopts ":ab:hp:c:r" opt; do
echo "-a Build firmware images for all the platform defconfig's."
echo "-b DIR Bind DIR to container."
echo "-p List of comma separated platform names to build images for particular platforms."
+ echo "-s DIR SDK cache dir."
+ echo "-S Build SDK only"
echo "-c Container to run in"
echo "Example:DOCKER_PREFIX=sudo ./ci/build.sh -a"
echo -e "\tDOCKER_PREFIX=sudo ./ci/build.sh -p firestone"
@@ -62,12 +75,12 @@ function run_docker
-t $1 $2
}
-env
+function toolchain_hash
+{
+ echo -n 'toolchain-'$((git submodule ; cd openpower/configs/; cat `ls -1 |grep '_defconfig$'|sort`)|sha1sum |sed -e 's/ .*//')
+}
-if [ -d output-images ]; then
- echo 'output-images already exists!';
- exit 1;
-fi
+env
for distro in $CONTAINERS;
do
@@ -108,13 +121,26 @@ ${HTTPS_PROXY_ENV}
${DL_DIR_ENV}
${CCACHE_DIR_ENV}
EOF
-)
+ )
$DOCKER_PREFIX docker build --network=host -t openpower/op-build-$distro - <<< "${Dockerfile}"
- mkdir -p output-images/$distro
- run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh -o output-images/$distro -p $PLATFORMS ${release_args}"
- if [ $? = 0 ]; then
- mv *-images output-$distro/
+ if [ -d "$SDK_CACHE" ]; then
+ SDK_DIR=$SDK_CACHE/$(toolchain_hash)-$distro
+ if [ ! -d "$SDK_DIR" ]; then
+ chmod +x ci/build-sdk.sh
+ run_docker openpower/op-build-$distro "./ci/build-sdk.sh $distro witherspoon_defconfig"
+ mv output-$distro-witherspoon_defconfig $SDK_DIR
+ $SDK_DIR/host/relocate-sdk.sh
+ fi
+ sdk_args="-s $SDK_DIR/host"
else
+ sdk_args=""
+ fi
+
+ if [ $SDK_ONLY == 0 ]; then
+ run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh -o `pwd`/output-$distro -p $PLATFORMS ${release_args} ${sdk_args}"
+ fi
+
+ if [ $? != 0 ]; then
exit $?;
fi
done;
OpenPOWER on IntegriCloud