Guest User

build script

a guest
Sep 23rd, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. #
  2. # Copyright � 2015, Akhil Narang "akhilnarang" <[email protected]>
  3. # Original by Varun Chitre
  4. # Heavily modified by Akhil :P
  5. # Custom build script for OwnKernel
  6. #
  7. # This software is licensed under the terms of the GNU General Public
  8. # License version 2, as published by the Free Software Foundation, and
  9. # may be copied, distributed, and modified under those terms.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # Please maintain this if you use this script or any part of it
  17. #
  18. dir=$PWD
  19. op=$dir/arch/arm/boot/zImage
  20. okzip=$dir/anykernel
  21. okversion="1.0"
  22. device="cm_condor"
  23. zipname="inazumakernel_$device-$okversion.zip"
  24. START=$(date +"%s")
  25. awesome=$(tput bold)$(tput setaf 6)
  26. config=$device"_defconfig"
  27. export CROSS_COMPILE="/home/zeeshan/toolchains/linaro/bin/arm-eabi-"
  28. export ARCH=arm
  29. export SUBARCH=arm
  30. export LOCALVERSION="-inazumakernel-$okversion"
  31.  
  32. function zip_kernel ()
  33. {
  34. cp $op $okzip/tools/zImage
  35. cd $okzip
  36. zip -r9 /home/zeeshan/android/$zipname *
  37. cd $dir
  38. cd /home/zeeshan/android
  39. if [ -e "$zipname" ]
  40. then
  41. while read -p "Do you want to upload zip (y/n)? " uchoice
  42. do
  43. case "$uchoice" in
  44. y|Y)
  45. upload-sf $zipname
  46. break
  47. ;;
  48. n|N )
  49. break
  50. ;;
  51. * )
  52. echo
  53. echo "Invalid try again!"
  54. echo
  55. ;;
  56. esac
  57. done
  58. else
  59. echo -e "Error occurred"
  60. echo -e "Zip not found"
  61. fi
  62. cd $dir
  63. }
  64.  
  65. function compile_kernel ()
  66. {
  67. echo $awesome
  68. echo " ) ) ";
  69. echo " ( /( ( /( ( ";
  70. echo " )\()) ( ( )\()) ( ( ( )\ ";
  71. echo "((_)\ )\))( ( |((_)\ ))\ )( ( ))((_) ";
  72. echo " ((_)((_)()\ )\ )_ ((_)((_|()\ )\ ) /((_) ";
  73. echo " / _ \_(()((_)_(_/( |/ (_)) ((_)_(_/((_))| | ";
  74. echo "| (_) \ V V / ' \))' </ -_)| '_| ' \)) -_) | ";
  75. echo " \___/ \_/\_/|_||_|_|\_\___||_| |_||_|\___|_| ";
  76. echo " ";
  77. echo $nocol
  78. make $config
  79. make -j8
  80. END=$(date +"%s")
  81. DIFF=$(($END - $START))
  82. if [ -e "$op" ]
  83. then
  84. echo -e "$awesome inazuma kernel $okversion for $device Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
  85. zip_kernel
  86. else
  87. echo -e "$awesome inazuma kernel $okversion for $device Build Failed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
  88. fi
  89. }
  90.  
  91. case $1 in
  92. clean)
  93. make clean
  94. rm -f include/linux/autoconf.h
  95. ;;
  96. mrproper)
  97. make mrproper
  98. ;;
  99. menu|menuconfig)
  100. make cm_condor_defconfig menuconfig
  101. ;;
  102. cleanbuild)
  103. make clean mrproper
  104. rm -f include/linux/autoconf.h
  105. compile_kernel
  106. ;;
  107. *)
  108. compile_kernel
  109. esac
Advertisement
Add Comment
Please, Sign In to add comment