blob: f8b1cd4a28e98697e1498b1541fc5c14c643fbab [file] [log] [blame]
Stewart Smith098d03e2016-03-01 13:59:42 +11001#!/bin/bash
2
3set -ex
4set -eo pipefail
5
Pridhiviraj Paidipeddi24d94a22016-08-15 16:51:31 +05306CONFIGTAG="_defconfig"
7
8DEFCONFIGS=();
9
10if [ -z "$2" ]; then
11 echo "Using all the defconfigs for all the platforms"
12 DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)`
13else
14 IFS=', '
15 for p in $2;
16 do
17 DEFCONFIGS+=($p$CONFIGTAG)
18 done
19fi
Stewart Smith098d03e2016-03-01 13:59:42 +110020
21if [ -z "$1" or ! -d "$1" ]; then
22 echo "No output directory specified"
23 exit 1;
24fi
25
26if [ -z "$CCACHE_DIR" ]; then
27 CCACHE_DIR=`pwd`/.op-build_ccache
28fi
29
30shopt -s expand_aliases
31source op-build-env
32
Pridhiviraj Paidipeddi24d94a22016-08-15 16:51:31 +053033for i in ${DEFCONFIGS[@]}; do
Stewart Smith098d03e2016-03-01 13:59:42 +110034 op-build $i
35 echo 'BR2_CCACHE=y' >> output/.config
36 echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config
37 echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config
38
39 op-build olddefconfig
40 op-build
41 r=$?
42 mkdir $1/$i-images
43 mv output/images/* $1/$i-images/
44 mv output/.config $1/$i-images/.config
45 lsb_release -a > $1/$i-images/lsb_release
46 rm -rf output/*
47 if [ $r -ne 0 ]; then
48 exit $r
49 fi
50done
51