summaryrefslogtreecommitdiff
path: root/scripts/ci/pack.sh
blob: b763803e3f688b3ca6e7088aa0cc85f459be0cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# SPDX-License-Identifier:           GPL-2.0
# https://spdx.org/licenses
# Copyright (C) 2018 Marvell International Ltd.
#
###############################################################################
## This is the pack script for atf                                           ##
## This script is called by CI automated builds                              ##
###############################################################################
## WARNING: Do NOT MODIFY the CI wrapper code segments.                      ##
## You can only modify the config and compile commands                       ##
###############################################################################
## Prerequisites:       DESTDIR is the path to the destination directory
## Usage:               pack BUILD_NAME

## =v=v=v=v=v=v=v=v=v=v=v CI WRAPPER - Do not Modify! v=v=v=v=v=v=v=v=v=v=v= ##
set -exuo pipefail
shopt -s extglob

build_name=$1
echo "running pack.sh ${build_name}"
## =^=^=^=^=^=^=^=^=^=^=^=^  End of CI WRAPPER code -=^=^=^=^=^=^=^=^=^=^=^= ##

case $build_name in
	*_a70x0_pcap )   platform="a70x0_pcac"; ;;
	*_a70x0* )       platform="a70x0"; ;;
	*_a7020_amc )    platform="a70x0_amc"; ;;
	*_a80x0_mcbin* ) platform="a80x0_mcbin"; ;;
	*_a80x0* ) 	 platform="a80x0"; ;;
	*_a3900_z1* )    platform="a3900_z1"; ;;
	*_a3900_z2* )    platform="a3900_z2"; ;;
	*_a3900* )       platform="a3900"; ;;
	*_a37xx* )       platform="a3700"; ;;
	* )	echo "Error: Could not configure platform."
	             "Unsupported build ${build_name}"; exit -1; ;;
esac

mkdir -p $DESTDIR/dev_images
module_file="build/${platform}/release/flash-image.bin"
cp $module_file $DESTDIR/

#echo 'atf.pack: copying .bin .elf .txt files'
find . -name *.bin | xargs cp -u --target-directory=$DESTDIR/dev_images/
find . -name *.elf | xargs cp -u --target-directory=$DESTDIR/dev_images/

if [[ $platform == "a3700" ]]; then
	#echo 'atf.pack: copying uart-images'
	find . -name uart-images.tgz | \
		xargs cp --target-directory=$DESTDIR/dev_images/
fi