Stewart Smith | 098d03e | 2016-03-01 13:59:42 +1100 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | set -eo pipefail |
| 5 | |
| 6 | DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)` |
| 7 | |
| 8 | if [ -z "$1" or ! -d "$1" ]; then |
| 9 | echo "No output directory specified" |
| 10 | exit 1; |
| 11 | fi |
| 12 | |
| 13 | if [ -z "$CCACHE_DIR" ]; then |
| 14 | CCACHE_DIR=`pwd`/.op-build_ccache |
| 15 | fi |
| 16 | |
| 17 | shopt -s expand_aliases |
| 18 | source op-build-env |
| 19 | |
| 20 | for i in $DEFCONFIGS; do |
| 21 | op-build $i |
| 22 | echo 'BR2_CCACHE=y' >> output/.config |
| 23 | echo "BR2_CCACHE_DIR=\"$CCACHE_DIR\"" >> output/.config |
| 24 | echo 'BR2_CCACHE_INITIAL_SETUP=""' >> output/.config |
| 25 | |
| 26 | op-build olddefconfig |
| 27 | op-build |
| 28 | r=$? |
| 29 | mkdir $1/$i-images |
| 30 | mv output/images/* $1/$i-images/ |
| 31 | mv output/.config $1/$i-images/.config |
| 32 | lsb_release -a > $1/$i-images/lsb_release |
| 33 | rm -rf output/* |
| 34 | if [ $r -ne 0 ]; then |
| 35 | exit $r |
| 36 | fi |
| 37 | done |
| 38 | |