Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # mybuild2.sh
- # my custom script to download, build and flash
- # note the start time
- START=$(date +%s)
- # assign variable
- DEVICE="$1"
- # start from the beginning, if called
- case "$DEVICE" in
- buildall)
- # make the needed directories
- cd ~
- mkdir -p ~/bin
- mkdir -p ~/android/system
- # download repo and make executable
- curl http://android.git.kernel.org/repo > ~/bin/repo
- chmod a+x ~/bin/repo
- # reload terminal
- source .bashrc
- # change to the proper directory and download the source
- cd ~/android/system/
- repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
- repo sync -j16
- # extract proprietary files
- cd ~/android/system/device/samsung/captivatemtd/
- ./extract-files.sh
- # change to top of build directory and build
- cd ~/android/system
- . build/envsetup.sh && brunch captivatemtd
- ;;
- exit
- clean)
- make clean
- rm -rf ./out
- ;;
- esac
- # get rom manager
- cd vendor/cyanogen
- ./get-rommanager
- # prepare to build kernel
- cd ~/android/system && . build/envsetup.sh && lunch cyanogen_captivatemtd-eng
- # change to kernel directory and build kernel
- cd ~/android/system/kernel/samsung/aries && ./build.sh captivatemtd
- # change to top of build directory and build, using ccache to speed things up
- cd ~/android/system && USE_CCACHE=1 brunch captivatemtd
- # push zip to connected phone and flash
- eat
- # calculate and show elapsed time
- END=$(date +%s)
- ELAPSED=$((END - START))
- E_MIN=$((ELAPSED / 60))
- E_SEC=$((ELAPSED - E_MIN * 60))
- printf "Elapsed: "
- [ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN
- printf "%d sec(s)\n" $E_SEC
Add Comment
Please, Sign In to add comment