Advertisement
techmik

the official buildscript =)

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