Advertisement
techmik

do all buildscript

Sep 5th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.15 KB | None | 0 0
  1. #!/bin/bash
  2. # mybuild4.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 called
  12. case "$DEVICE" in
  13.     all)
  14.         # do it all
  15.         cd ~
  16.         apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev
  17.         echo y
  18.         echo -ne \\r
  19.         ;;
  20.         exec mybuild4.sh buildall
  21.         exit
  22.     buildall)
  23.         # make the needed directories
  24.         cd ~
  25.         mkdir -p ~/bin
  26.         mkdir -p ~/android/system
  27.         # download repo and make executable
  28.         curl http://android.git.kernel.org/repo > ~/bin/repo
  29.         chmod a+x ~/bin/repo
  30.         # reload terminal
  31.         source .bashrc
  32.         # change to the proper directory and download the source
  33.         cd ~/android/system/
  34.         repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
  35.         echo -ne \\r
  36.         echo -ne \\r
  37.         # create local_manifest, make a link to it in the right place
  38.         cp ~/Saved/local_manifest.xml ~/android/system/.repo/manifests/
  39.         ln -s ~/android/system/.repo/manifests/local_manifests.xml ~/android/system/.repo/local_manifest.xml
  40.         # download source
  41.         repo sync -j16
  42.         ;;
  43.     clean)
  44.         cd ~/android/system
  45.         make clean
  46.         rm -rf ./out
  47.         ;;
  48. esac
  49.  
  50. # get rom manager
  51. cd ~/android/system/vendor/cyanogen
  52. ./get-rommanager
  53.  
  54. # prepare to build kernel
  55. cd ~/android/system && . build/envsetup.sh && lunch cyanogen_captivatemtd-eng
  56.  
  57. # change to kernel directory and build kernel
  58. cd ~/android/system/kernel/samsung/aries && ./build.sh captivatemtd
  59.  
  60. # change to top of build directory and build, using ccache to speed things up
  61. cd ~/android/system && USE_CCACHE=1 brunch captivatemtd
  62.  
  63. # push zip to connected phone and flash
  64. eat
  65.  
  66. # calculate and show elapsed time
  67. END=$(date +%s)
  68. ELAPSED=$((END - START))
  69. E_MIN=$((ELAPSED / 60))
  70. E_SEC=$((ELAPSED - E_MIN * 60))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement