John Stultz | f2a35d5 | 2021-12-16 05:48:59 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -x |
| 3 | |
| 4 | SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" |
| 5 | |
| 6 | DATE=$(date +%Y%m%d) |
| 7 | SHA1=$(git log --pretty="%h" HEAD~1..HEAD) |
| 8 | VER=$DATE |
| 9 | |
| 10 | SRC_DIR=$SCRIPT_DIR/src/ |
John Stultz | d6997a2 | 2022-01-06 00:20:44 +0000 | [diff] [blame] | 11 | TARGET_DIR=out/vendor/linaro/ |
John Stultz | f2a35d5 | 2021-12-16 05:48:59 +0000 | [diff] [blame] | 12 | |
| 13 | |
John Stultz | 479a7c9 | 2022-02-02 05:54:07 +0000 | [diff] [blame] | 14 | DEV_TARGETS="db845c rb5 linux-firmware hikey960" |
John Stultz | f2a35d5 | 2021-12-16 05:48:59 +0000 | [diff] [blame] | 15 | |
John Stultz | d6997a2 | 2022-01-06 00:20:44 +0000 | [diff] [blame] | 16 | for DEV in $DEV_TARGETS; do |
| 17 | DEV_TARGET_DIR=$TARGET_DIR/$DEV/$VER |
| 18 | |
| 19 | #Create and copy the files into the out dir |
| 20 | mkdir -p $DEV_TARGET_DIR |
| 21 | cp -r $SRC_DIR/$DEV/* $DEV_TARGET_DIR/ |
| 22 | |
| 23 | # set the version file in the package |
| 24 | echo "TARGET_LINARO_VENDOR_VERSION := $VER" > $DEV_TARGET_DIR/version.mk |
| 25 | done |
| 26 | |
| 27 | # Copy the toplevel items |
| 28 | cp $SRC_DIR/README $TARGET_DIR/ |
| 29 | cp $SRC_DIR/android-info.txt $TARGET_DIR/ |
John Stultz | f2a35d5 | 2021-12-16 05:48:59 +0000 | [diff] [blame] | 30 | |
| 31 | #tar it up |
| 32 | tar -C out -czf out/vendor.tgz vendor/ |
| 33 | |
| 34 | # prepend the extraction script |
| 35 | cp $SCRIPT_DIR/extract-linaro_devices.sh-source out/extract-linaro_devices-$VER.sh |
| 36 | cat out/vendor.tgz >> out/extract-linaro_devices-$VER.sh |
| 37 | |
| 38 | # tar it again |
| 39 | tar -C out -czf out/extract-linaro_devices-$VER.tgz extract-linaro_devices-$VER.sh |
| 40 | |
| 41 | # cleanup: remove the temp/intermediate files |
| 42 | rm out/extract-linaro_devices-$VER.sh out/vendor.tgz |
| 43 | rm -rf out/vendor |