2023-05-31 12:47:22 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-01-31 13:45:02 +00:00
|
|
|
|
2023-08-10 11:31:51 +00:00
|
|
|
set -e
|
|
|
|
|
2023-04-14 13:12:57 +00:00
|
|
|
cd $(dirname $0)
|
|
|
|
|
2023-05-31 12:47:22 +00:00
|
|
|
BUILDVH=$(realpath ../../tools/build_vendorheader)
|
|
|
|
BINCTL=$(realpath ../../tools/headertool.py)
|
|
|
|
|
2023-08-10 11:31:51 +00:00
|
|
|
for arg in "$@"; do
|
|
|
|
if [ "$arg" == "--check" ]; then
|
|
|
|
CHECK="--check"
|
|
|
|
fi
|
|
|
|
if [ "$arg" == "--quiet" ]; then
|
|
|
|
QUIET="--quiet"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2023-08-24 09:33:50 +00:00
|
|
|
MODELS=(T2T1 T2B1 T3T1 D001 D002)
|
2023-05-31 12:47:22 +00:00
|
|
|
|
|
|
|
for MODEL in ${MODELS[@]}; do
|
|
|
|
cd $MODEL
|
2023-08-24 14:55:52 +00:00
|
|
|
echo "Generating vendor headers for $MODEL"
|
2023-05-31 12:47:22 +00:00
|
|
|
# construct all vendor headers
|
|
|
|
for fn in *.json; do
|
2024-04-12 12:20:32 +00:00
|
|
|
$BUILDVH $QUIET $CHECK $fn
|
2023-05-31 12:47:22 +00:00
|
|
|
done
|
2018-01-31 13:45:02 +00:00
|
|
|
|
2023-08-10 11:31:51 +00:00
|
|
|
TMPDIR=$(mktemp -d)
|
|
|
|
trap "rm -rf $TMPDIR" EXIT
|
2023-05-31 12:47:22 +00:00
|
|
|
# sign dev and QA vendor header
|
2023-08-24 14:55:52 +00:00
|
|
|
for name in unsafe dev_DO_NOT_SIGN; do
|
2023-08-10 11:31:51 +00:00
|
|
|
SRC_NAME="vendorheader_${name}_unsigned.bin"
|
|
|
|
DEST_NAME="vendorheader_${name}_signed_dev.bin"
|
|
|
|
if [ ! -f "$SRC_NAME" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
cp -a vendorheader_${name}_unsigned.bin "$TMPDIR/$DEST_NAME"
|
|
|
|
$BINCTL $QUIET -D "$TMPDIR/$DEST_NAME"
|
|
|
|
if [ -n "$CHECK" ]; then
|
|
|
|
diff "$DEST_NAME" "$TMPDIR/$DEST_NAME"
|
|
|
|
fi
|
|
|
|
cp -a "$TMPDIR/$DEST_NAME" "$DEST_NAME"
|
2023-05-31 12:47:22 +00:00
|
|
|
done
|
|
|
|
cd ..
|
2023-03-02 15:15:15 +00:00
|
|
|
done
|