summaryrefslogtreecommitdiffstats
path: root/ci/build-all-defconfigs.sh
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-08-10 13:47:48 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2018-08-28 17:15:24 +1000
commit8d102aa511b8a8430f7759cdb965cb5eca8b3d83 (patch)
tree0c4dce8a1d887808ea21b76bd52188e6a7f7642a /ci/build-all-defconfigs.sh
parent7f4c37d95c3aef7d61e621c84e5d6114b0cabdcf (diff)
downloadblackbird-op-build-8d102aa511b8a8430f7759cdb965cb5eca8b3d83.tar.gz
blackbird-op-build-8d102aa511b8a8430f7759cdb965cb5eca8b3d83.zip
ci: Add release mode to build legal info
Add an option to build the Buildroot legal-info target after building a platform. This is mainly useful as part of building platforms for inclusion in images for distribution, but is also good for CI systems doing a sanity check on what is being built. This also updates build-all-defconfigs.sh to use getopt to handle its inputs more sanely. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'ci/build-all-defconfigs.sh')
-rwxr-xr-xci/build-all-defconfigs.sh46
1 files changed, 39 insertions, 7 deletions
diff --git a/ci/build-all-defconfigs.sh b/ci/build-all-defconfigs.sh
index 61c3bbfe..839d30a5 100755
--- a/ci/build-all-defconfigs.sh
+++ b/ci/build-all-defconfigs.sh
@@ -3,22 +3,48 @@
set -ex
set -eo pipefail
+BUILD_INFO=0
CONFIGTAG="_defconfig"
DEFCONFIGS=();
-if [ -z "$2" ]; then
+while getopts "o:p:r" opt; do
+ case $opt in
+ o)
+ echo "Output directory: $OPTARG"
+ OUTDIR="$OPTARG"
+ ;;
+ p)
+ echo "Platforms to build: $OPTARG"
+ PLATFORM_LIST="$OPTARG"
+ ;;
+ r)
+ echo "Build legal-info for release"
+ BUILD_INFO=1
+ ;;
+ \?)
+ echo "Invalid option: -$OPTARG"
+ exit 1
+ ;;
+ :)
+ echo "Option -$OPTARG requires an argument."
+ exit 1
+ ;;
+ esac
+done
+
+if [ -z "${PLATFORM_LIST}" ]; then
echo "Using all the defconfigs for all the platforms"
DEFCONFIGS=`(cd openpower/configs; ls -1 *_defconfig)`
else
IFS=', '
- for p in $2;
+ for p in ${PLATFORM_LIST};
do
DEFCONFIGS+=($p$CONFIGTAG)
done
fi
-if [ -z "$1" or ! -d "$1" ]; then
+if [ -z "${OUTDIR}" or ! -d "${OUTDIR}" ]; then
echo "No output directory specified"
exit 1;
fi
@@ -45,10 +71,16 @@ for i in ${DEFCONFIGS[@]}; do
op-build olddefconfig
op-build
r=$?
- mkdir $1/$i-images
- mv output/images/* $1/$i-images/
- mv output/.config $1/$i-images/.config
- lsb_release -a > $1/$i-images/lsb_release
+
+ if [ ${BUILD_INFO} = 1 ] && [ $r = 0 ]; then
+ op-build legal-info
+ mv output/legal-info ${OUTDIR}/$i-legal-info
+ fi
+
+ mkdir ${OUTDIR}/$i-images
+ mv output/images/* ${OUTDIR}/$i-images/
+ mv output/.config ${OUTDIR}/$i-images/.config
+ lsb_release -a > ${OUTDIR}/$i-images/lsb_release
if [ $r -ne 0 ]; then
exit $r
fi
OpenPOWER on IntegriCloud