Created
April 10, 2015 03:50
-
-
Save invisiblek/34069d8190f1dcb5fa7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cmversion=12.1 | |
outdir=/opt/out/${cmversion} | |
ccachedir=/home/dp/cm/${cmversion}/prebuilts/misc/linux-x86/ccache | |
jobs=12 | |
if [ "`which arm-eabi-gcc`" == "" ]; then | |
echo "No toolchain in path!" | |
echo "Make sure an arm-eabi-gcc is in your path!" | |
exit 1 | |
fi | |
if [[ -z $1 ]]; then | |
echo "You must specify a device!" | |
exit 1 | |
fi | |
device=${1} | |
arm-eabi-gcc --version | head -1 | |
echo | |
case $device in | |
v400) kernel=lge/v4xx; defconfig=cyanogen_e7wifi_defconfig;; | |
v410) kernel=lge/v4xx; defconfig=cyanogen_e7att_defconfig;; | |
vs985) kernel=lge/g3; defconfig=cyanogenmod_vs985_defconfig;; | |
vs980) kernel=lge/msm8974; defconfig=cyanogenmod_vs980_defconfig;; | |
n3) kernel=oppo/n3; defconfig=cyanogenmod_n3_defconfig;; | |
n3bacon) kernel=oneplus/msm8974; defconfig=cyanogenmod_n3_defconfig; device=n3;; | |
bacon) kernel=oneplus/msm8974; defconfig=cyanogenmod_bacon_defconfig;; | |
m8) kernel=htc/msm8974; defconfig=cm_m8_defconfig;; | |
dlx) kernel=htc/m7; defconfig=cyanogenmod_dlx_defconfig;; | |
dlx8960) kernel=htc/msm8960; defconfig=dlx_defconfig; device=dlx;; | |
jfltevzw|jf) kernel=samsung/jf; defconfig=cyanogen_jf_defconfig;; | |
d2vzw|d2) kernel=samsung/d2; defconfig=cyanogen_d2_defconfig;; | |
tenderloin) kernel=hp/tenderloin; defconfig=cyanogenmod_tenderloin_defconfig;; | |
*) echo "Unsupported device!"; exit 1;; | |
esac | |
cd ~/cm/${cmversion} | |
mkdir -p ${outdir}/target/product/${device}/obj/KERNEL_OBJ/ | |
make -j${jobs} -C kernel/${kernel}/ O=${outdir}/target/product/${device}/obj/KERNEL_OBJ/ ARCH=arm CROSS_COMPILE="$ccachedir/ccache arm-eabi-" ${defconfig} | |
make -j${jobs} -C kernel/${kernel}/ O=${outdir}/target/product/${device}/obj/KERNEL_OBJ/ ARCH=arm CROSS_COMPILE="$ccachedir/ccache arm-eabi-" zImage | |
cd - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment