blob: 92db7881c6e884e0f85f4dfd85c66f83a83a683c [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
Stewart Smith098d03e2016-03-01 13:59:42 +110039 op-build $i
40 echo 'BR2_CCACHE=y' >> output/.config
41 echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config
42 echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config
43
44 op-build olddefconfig
45 op-build
46 r=$?
47 mkdir $1/$i-images
48 mv output/images/* $1/$i-images/
49 mv output/.config $1/$i-images/.config
50 lsb_release -a > $1/$i-images/lsb_release
51 rm -rf output/*
52 if [ $r -ne 0 ]; then
53 exit $r
54 fi
55done
56