blob: 6d2ea24787c860352718f9cd324dba2c51d067aa [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="shared db845c hikey960 rb5 sm8x50"
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
# Copy the proprietary files
PROP_DEV_TARGETS="sm8x50"
for PROP_DEV in $PROP_DEV_TARGETS; do
mkdir -p $TARGET_DIR/$PROP_DEV/$VER/proprietary/
cp -r $SRC_DIR/proprietary/$PROP_DEV/* $TARGET_DIR/$PROP_DEV/$VER/proprietary/
done
#tar it up
tar -C out -czf out/vendor-prop.tgz vendor/
# prepend the extraction script
cp $SCRIPT_DIR/extract-linaro_devices.sh-source out/extract-linaro_devices-$VER-prop.sh
cat out/vendor-prop.tgz >> out/extract-linaro_devices-$VER-prop.sh
# tar it again
tar -C out -czf out/extract-linaro_devices-$VER-prop.tgz extract-linaro_devices-$VER-prop.sh
# cleanup: remove the temp/intermediate files
rm out/extract-linaro_devices-$VER-prop.sh out/vendor-prop.tgz
rm -rf out/vendor