Skip to content

Instantly share code, notes, and snippets.

@Roboe
Last active September 1, 2016 10:55
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 Roboe/46ff204e210e286f50f27d703ff1abb3 to your computer and use it in GitHub Desktop.
Save Roboe/46ff204e210e286f50f27d703ff1abb3 to your computer and use it in GitHub Desktop.
FP2 blobs downloader

Fairphone FP2 proprietary vendor files downloader

https://code.fairphone.com/projects/fp-osos/dev/fp2-blobs-download-page.html

Procedure

git init
chmod +x update-blobs.sh

Single blobs-package version:

./update-blobs.sh <version>

Multiple blobs-package versions (will take more time):

VERSIONS="2.0.0 2.0.1 16.04.0 16.05.0 16.06.0 16.07.0"
for v in $VERSIONS; do
  ./update-blobs.sh $v
done
read() {
yn="y"
}
#!/bin/bash
[ -z "$1" ] && [ -z "$VERSION" ] && echo "No version supplied" && exit 1
[ -z "$VERSION" ] && VERSION=$1
EXTRACT_RC="$PWD/extract.rc"
function say {
[[ "$#" != 0 ]] && echo -e "\033[1m~ $1 \e[0m"
}
say "Clearing 'vendor' and 'out' folders..."
rm -rf vendor/ out/
say "Downloading blobs..."
wget https://code.fairphone.com/downloads/FP2/blobs/fp2-sibon-$VERSION-blobs.tgz &&
tar xvf fp2-sibon-$VERSION-blobs.tgz &&
BASH_ENV="$EXTRACT_RC" bash ./fp2-sibon-$VERSION-blobs.sh &&
rm -rf fp2-sibon-$VERSION-blobs.tgz fp2-sibon-$VERSION-blobs.sh
say "Executing 'vendorsetup.sh'..."
for f in `find -L vendor -maxdepth 4 -name 'vendorsetup.sh'`; do source $f; done; unset f
say "Committing updates..."
git add vendor/ out/ &&
git commit -m "Update blobs to $VERSION"
say "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment