Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Copyright � 2015, Akhil Narang "akhilnarang" <[email protected]>
- # Original by Varun Chitre
- # Heavily modified by Akhil :P
- # Custom build script for OwnKernel
- #
- # This software is licensed under the terms of the GNU General Public
- # License version 2, as published by the Free Software Foundation, and
- # may be copied, distributed, and modified under those terms.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # Please maintain this if you use this script or any part of it
- #
- dir=$PWD
- op=$dir/arch/arm/boot/zImage
- okzip=$dir/anykernel
- okversion="1.0"
- device="cm_condor"
- zipname="inazumakernel_$device-$okversion.zip"
- START=$(date +"%s")
- awesome=$(tput bold)$(tput setaf 6)
- config=$device"_defconfig"
- export CROSS_COMPILE="/home/zeeshan/toolchains/linaro/bin/arm-eabi-"
- export ARCH=arm
- export SUBARCH=arm
- export LOCALVERSION="-inazumakernel-$okversion"
- function zip_kernel ()
- {
- cp $op $okzip/tools/zImage
- cd $okzip
- zip -r9 /home/zeeshan/android/$zipname *
- cd $dir
- cd /home/zeeshan/android
- if [ -e "$zipname" ]
- then
- while read -p "Do you want to upload zip (y/n)? " uchoice
- do
- case "$uchoice" in
- y|Y)
- upload-sf $zipname
- break
- ;;
- n|N )
- break
- ;;
- * )
- echo
- echo "Invalid try again!"
- echo
- ;;
- esac
- done
- else
- echo -e "Error occurred"
- echo -e "Zip not found"
- fi
- cd $dir
- }
- function compile_kernel ()
- {
- echo $awesome
- echo " ) ) ";
- echo " ( /( ( /( ( ";
- echo " )\()) ( ( )\()) ( ( ( )\ ";
- echo "((_)\ )\))( ( |((_)\ ))\ )( ( ))((_) ";
- echo " ((_)((_)()\ )\ )_ ((_)((_|()\ )\ ) /((_) ";
- echo " / _ \_(()((_)_(_/( |/ (_)) ((_)_(_/((_))| | ";
- echo "| (_) \ V V / ' \))' </ -_)| '_| ' \)) -_) | ";
- echo " \___/ \_/\_/|_||_|_|\_\___||_| |_||_|\___|_| ";
- echo " ";
- echo $nocol
- make $config
- make -j8
- END=$(date +"%s")
- DIFF=$(($END - $START))
- if [ -e "$op" ]
- then
- echo -e "$awesome inazuma kernel $okversion for $device Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
- zip_kernel
- else
- echo -e "$awesome inazuma kernel $okversion for $device Build Failed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
- fi
- }
- case $1 in
- clean)
- make clean
- rm -f include/linux/autoconf.h
- ;;
- mrproper)
- make mrproper
- ;;
- menu|menuconfig)
- make cm_condor_defconfig menuconfig
- ;;
- cleanbuild)
- make clean mrproper
- rm -f include/linux/autoconf.h
- compile_kernel
- ;;
- *)
- compile_kernel
- esac
Advertisement
Add Comment
Please, Sign In to add comment