blob: 61c3bbfeb4a36fbb1ba52325e850758307524975 [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
Samuel Mendoza-Jonas94ec86a2018-08-06 15:18:26 +100033if [ -n "$DL_DIR" ]; then
34 unset BR2_DL_DIR
35 export BR2_DL_DIR=${DL_DIR}
36fi
37
Pridhiviraj Paidipeddi24d94a22016-08-15 16:51:31 +053038for i in ${DEFCONFIGS[@]}; do
Samuel Mendoza-Jonas7f4c37d2018-08-07 14:51:51 +100039 rm -rf output/*
Stewart Smith098d03e2016-03-01 13:59:42 +110040 op-build $i
41 echo 'BR2_CCACHE=y' >> output/.config
42 echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config
43 echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config
44
45 op-build olddefconfig
46 op-build
47 r=$?
48 mkdir $1/$i-images
49 mv output/images/* $1/$i-images/
50 mv output/.config $1/$i-images/.config
51 lsb_release -a > $1/$i-images/lsb_release
Stewart Smith098d03e2016-03-01 13:59:42 +110052 if [ $r -ne 0 ]; then
53 exit $r
54 fi
55done
56