Skip to content

Instantly share code, notes, and snippets.

@yshalsager
Created April 4, 2018 19:20
Show Gist options
  • Save yshalsager/8795c71e5c2fd386eb599d787993e030 to your computer and use it in GitHub Desktop.
Save yshalsager/8795c71e5c2fd386eb599d787993e030 to your computer and use it in GitHub Desktop.
A script to build TWRP (in docker) and upload to basketbuild
#Usage: sudo ./buildtwrp.sh [Brand] [Model]
# You need to define basketbuild info!
docker run --rm -i -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/home/cmbuild/twrp/:rw,z" stucki/cyanogenmod bash << EOF
cd ../twrp/
source build/envsetup.sh ; lunch omni_$2-eng ; make -j16 recoveryimage
exit
EOF
export version=$(cat bootable/recovery/variables.h | grep "define TW_MAIN_VERSION_STR" | cut -d '"' -f2)
cp out/target/product/$2/recovery.img out/TWRP-$version-$2-$(date +"%Y%m%d").img
cd out
wput TWRP-$version-$2-$(date +"%Y%m%d").img ftp://$username:$password@basketbuild.com//TwrpBuilder/$1/$2/
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment