Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created March 2, 2020 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrvick/2121308f28d525ae3c2e64e915548170 to your computer and use it in GitHub Desktop.
Save lrvick/2121308f28d525ae3c2e64e915548170 to your computer and use it in GitHub Desktop.
Find blobs in the factory android vendor partition that duplicate blobs in AOSP by examining build errors.
device="coral"
set -x
while true; do
duplicate=$( \
make DEVICE=${device} build \
| grep -A1 'FAILED:' \
| grep 'error:' \
| awk -F"', previously defined" '{print $1}' \
| awk -F"out/target/product/${device}/" '{print $2}' \
)
[[ -z "${duplicate}" ]] && break
duplicate_base=$(printf "%s" "${duplicate}" | sed 's/.*\///')
sed -i "\:$duplicate_base:d" \
build/base/vendor/google_devices/${device}/${device}-vendor-blobs.mk
echo "Found duplicate: ${duplicate}"
echo "$duplicate" | tee -a duplicates.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment