blob: 6cc9266f101d681acb979217b2a2c369537f8960 [file] [log] [blame]
#!/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/
DEV_TARGETS="db845c rb5 linux-firmware hikey960"
for DEV in $DEV_TARGETS; do
DEV_TARGET_DIR=$TARGET_DIR/$DEV/$VER
#Create and copy the files into the out dir
mkdir -p $DEV_TARGET_DIR
cp -r $SRC_DIR/$DEV/* $DEV_TARGET_DIR/
# set the version file in the package
echo "TARGET_LINARO_VENDOR_VERSION := $VER" > $DEV_TARGET_DIR/version.mk
done
# Copy the toplevel items
cp $SRC_DIR/README $TARGET_DIR/
cp $SRC_DIR/android-info.txt $TARGET_DIR/
#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