Advertisement
techmik

new buildscript

Sep 5th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # mybuild2.sh
  4.  
  5. # my custom script to download, build and flash
  6.  
  7. # note the start time
  8. START=$(date +%s)
  9.  
  10. # assign variable
  11. DEVICE="$1"
  12.  
  13. # start from the beginning, if called
  14. case "$DEVICE" in
  15.     buildall)
  16.         # make the needed directories
  17.         cd ~
  18.         mkdir -p ~/bin
  19.         mkdir -p ~/android/system
  20.         # download repo and make executable
  21.         curl http://android.git.kernel.org/repo > ~/bin/repo
  22.         chmod a+x ~/bin/repo
  23.         # reload terminal
  24.         source .bashrc
  25.         # change to the proper directory and download the source
  26.         cd ~/android/system/
  27.         repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
  28.         echo -n \n
  29.         echo -n \n
  30.         # create local_manifest, make a link to it in the right place
  31.         cp ~/Saved/local_manifest.xml ~/android/system/.repo/manifests/
  32.         ln -s ~/android/system/.repo/manifests/local_manifests.xml ~/android/system/.repo/local_manifest.xml
  33.         # download source
  34.         repo sync -j16
  35.         ;;
  36.     clean)
  37.         make clean
  38.         rm -rf ./out
  39.         ;;
  40. esac
  41.  
  42. # get rom manager
  43. cd vendor/cyanogen
  44. ./get-rommanager
  45.  
  46. # prepare to build kernel
  47. cd ~/android/system && . build/envsetup.sh && lunch cyanogen_captivatemtd-eng
  48.  
  49. # change to kernel directory and build kernel
  50. cd ~/android/system/kernel/samsung/aries && ./build.sh captivatemtd
  51.  
  52. # change to top of build directory and build, using ccache to speed things up
  53. cd ~/android/system && USE_CCACHE=1 brunch captivatemtd
  54.  
  55. # push zip to connected phone and flash
  56. eat
  57.  
  58. # calculate and show elapsed time
  59. END=$(date +%s)
  60. ELAPSED=$((END - START))
  61. E_MIN=$((ELAPSED / 60))
  62. E_SEC=$((ELAPSED - E_MIN * 60))
  63. printf "Elapsed: "
  64. [ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN
  65. printf "%d sec(s)\n" $E_SEC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement