5 KNAME
=kernel.cyano.RELEASE
6 DEVICE_CM_DIR
=$ANDROID_BUILD_TOP/device
/samsung
/${BOARD}
11 if [ $
(adb get-state
) != device
-a $
(adb shell busybox
test -e /sbin
/recovery
2> /dev
/null
; echo $?
) != 0 ] ; then
12 echo "No device is online. Waiting for one..."
13 echo "Please connect USB and/or enable USB debugging"
14 until [ $
(adb get-state
) = device
-o $
(adb shell busybox
test -e /sbin
/recovery
2> /dev
/null
; echo $?
) = 0 ];do
23 if [ x
= "x$ANDROID_BUILD_TOP" ] ; then
24 echo "Android build environment must be configured"
27 .
"$ANDROID_BUILD_TOP"/build
/envsetup.sh
29 KERNEL_DIR
="$(dirname "$
(readlink
-f "$0")")"
30 BUILD_DIR
="$KERNEL_DIR/build"
31 # add modules which should be copied after build below
34 if [ x
= "x$NO_CCACHE" ] && ccache
-V &>/dev
/null
; then
36 CCACHE_BASEDIR
="$KERNEL_DIR"
38 CCACHE_DIR
="$BUILD_DIR/.ccache"
39 export CCACHE_DIR CCACHE_COMPRESS CCACHE_BASEDIR
44 CROSS_PREFIX
="$ANDROID_BUILD_TOP/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-"
57 sVersion
=$
(cat build
/${BOARD}/include
/config
/kernel.release
)
59 sVersionMerge
=${sVersion:(-8)}
69 KZIPNAME
=$KNAME.v
$iMayor.
$iMinor.
$sVersionMerge.
zip
71 if [ "$responseSend" == "y" ] ; then
73 echo Going into fastboot
74 if adb reboot-bootloader
; then
76 echo Pushing kernel
file
77 if fastboot flash zimage kernel
/zImage
; then
87 for filename
in system
/modules
/* ; do
88 echo Sending
$filename to
/system
/modules
89 if adb push
$filename /system
/modules
; then
90 echo "Rebooting again"
103 iMinor
=$
(($iMinor+1))
104 echo $iMinor > .Minor
109 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
110 echo ! COMPILACION FAILED
113 echo ! ---------------------- COMPILACION ERROR CODE
: $RET
117 echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
123 echo "Building for $target"
124 local target_dir
="$BUILD_DIR/$target"
127 mkdir
-p "$target_dir"
128 [ x
= "x$NO_DEFCONFIG" ] && mka
-C "$KERNEL_DIR" O
="$target_dir" ARCH
=arm
${BOARD}_defconfig HOSTCC
="$CCACHE gcc"
129 if [ x
= "x$NO_BUILD" ] ; then
130 mka
-C "$KERNEL_DIR" O
="$target_dir" ARCH
=arm HOSTCC
="$CCACHE gcc" CROSS_COMPILE
="$CCACHE $CROSS_PREFIX" modules
132 if [[ $RET == 0 ]] ; then
133 mka
-C "$KERNEL_DIR" O
="$target_dir" ARCH
=arm HOSTCC
="$CCACHE gcc" CROSS_COMPILE
="$CCACHE $CROSS_PREFIX" zImage
135 if [[ $RET == 0 ]] ; then
136 cp "$target_dir"/arch
/arm
/boot
/zImage bin
/kernel
/zImage
137 for module
in "${MODULES[@]}" ; do
138 cp "$target_dir/$module" bin
/system
/modules
154 echo Type y
+ \"intro
\" to send kernel to your mobile
:
155 read -t 10 responseSend
;
156 if [ "$responseSend" == "y" ] ; then
157 echo Sending to device after build ..
$responseSend
159 echo Only compile ..
$responseSend
162 if [ "$1" = clean
] ; then
163 rm -fr "$BUILD_DIR"/*
168 if [ 0 = "${#targets[@]}" ] ; then
174 for target
in "${targets[@]}" ; do
179 ELAPSED
=$
((END
- START
))
180 E_MIN
=$
((ELAPSED
/ 60))
181 E_SEC
=$
((ELAPSED
- E_MIN
* 60))
183 [ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN
184 printf "%d sec(s)\n" $E_SEC