Stewart Smith | 098d03e | 2016-03-01 13:59:42 +1100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | set -eo pipefail |
| 5 | |
Pridhiviraj Paidipeddi | 24d94a2 | 2016-08-15 16:51:31 +0530 | [diff] [blame^] | 6 | CONFIGTAG="_defconfig" |
| 7 | |
| 8 | DEFCONFIGS=(); |
| 9 | |
| 10 | if [ -z "$2" ]; then |
| 11 | echo "Using all the defconfigs for all the platforms" |
| 12 | DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)` |
| 13 | else |
| 14 | IFS=', ' |
| 15 | for p in $2; |
| 16 | do |
| 17 | DEFCONFIGS+=($p$CONFIGTAG) |
| 18 | done |
| 19 | fi |
Stewart Smith | 098d03e | 2016-03-01 13:59:42 +1100 | [diff] [blame] | 20 | |
| 21 | if [ -z "$1" or ! -d "$1" ]; then |
| 22 | echo "No output directory specified" |
| 23 | exit 1; |
| 24 | fi |
| 25 | |
| 26 | if [ -z "$CCACHE_DIR" ]; then |
| 27 | CCACHE_DIR=`pwd`/.op-build_ccache |
| 28 | fi |
| 29 | |
| 30 | shopt -s expand_aliases |
| 31 | source op-build-env |
| 32 | |
Pridhiviraj Paidipeddi | 24d94a2 | 2016-08-15 16:51:31 +0530 | [diff] [blame^] | 33 | for i in ${DEFCONFIGS[@]}; do |
Stewart Smith | 098d03e | 2016-03-01 13:59:42 +1100 | [diff] [blame] | 34 | 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 |
| 50 | done |
| 51 | |