summaryrefslogtreecommitdiff
path: root/generate_vendor_package.sh
blob: 7fbb2370721352e50e64cb9fa5cb69e3085b4598 (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
#!/bin/bash
set -x

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

DATE=$(date +%Y%m%d)
SHA1=$(git log --pretty="%h" HEAD~1..HEAD)
VER=$DATE

SRC_DIR=$SCRIPT_DIR/src/
TARGET_DIR=out/vendor/linaro-devices/$VER/


#Create and copy the files into the out dir
mkdir -p $TARGET_DIR
cp -r $SRC_DIR/* $TARGET_DIR

# set the version file in the package
echo "TARGET_LINARO_VENDOR_VERSION := $VER" > $TARGET_DIR/version.mk

#tar it up
tar -C out -czf out/vendor.tgz vendor/

# prepend the extraction script
cp $SCRIPT_DIR/extract-linaro_devices.sh-source out/extract-linaro_devices-$VER.sh
cat out/vendor.tgz >> out/extract-linaro_devices-$VER.sh

# tar it again
tar -C out -czf out/extract-linaro_devices-$VER.tgz extract-linaro_devices-$VER.sh

# cleanup: remove the temp/intermediate files
rm out/extract-linaro_devices-$VER.sh out/vendor.tgz
rm -rf out/vendor