-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-gd
More file actions
executable file
·54 lines (50 loc) · 1.9 KB
/
build-gd
File metadata and controls
executable file
·54 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
### This script won't work for you unless you edit the toolchain directory to become as yours.
### GCC 4.9x
DATE=`date +%Y-%m-%d`
CYAN="\\033[1;36m"
GREEN="\\033[1;32m"
RED="\\033[1;31m"
RESET="\\e[0m"
VERSION="2"
GD="GreatDevs"
set -e
if [ -z "$1" ]
then
echo -n -e "\n${CYAN}Ether use e.g: (./build-gd amami) or enter (amami/honami/togari) here:${RESET}\n\n"
read device
DEVICE=${device}
else
DEVICE=$1
echo -n -e "\n${GREEN}Building for ${DEVICE}${RESET}\n\n"
fi
cd ~/Desktop/${GD}
rm -rf toolchain arch/arm/boot/zImage-dtb
unzip -q ~/toolchain.zip -d toolchain
ARCH=arm CROSS_COMPILE=toolchain/bin/arm-eabi- make distclean
export KBUILD_BUILD_USER=${GD}
export KBUILD_BUILD_VERSION=${VERSION}
ARCH=arm CROSS_COMPILE=toolchain/bin/arm-eabi- make gd_${DEVICE}_defconfig
ARCH=arm CROSS_COMPILE=toolchain/bin/arm-eabi- make -j16
if [ -f arch/arm/boot/zImage ]
then
cd ../my_tools
mv ../${GD}/arch/arm/boot/zImage ${GD}
./dtbTool -o ${GD}/dt.img -s 2048 -p ../${GD}/scripts/dtc/ ../${GD}/arch/arm/boot/
mkdir modules
find ../${GD} -name '*.ko' -exec cp {} modules \;
../${GD}/toolchain/bin/arm-eabi-strip --strip-unneeded modules/*
zip -r ${GD} META-INF modules ${GD}
cd ${DEVICE}/${GD}/sbin/ramdisk-recovery
find . ! -name '.placeholder' ! -path '.' | cpio -o -H newc > ../../ramdisk-recovery.cpio
cd ../../..
zip -ru ../${GD}.zip ./* -x "${GD}/sbin/*"
cd ..
java -Xmx1024m -jar signapk.jar -w META-INF/com/android/otacert testkey.pk8 ${GD}.zip ~/Desktop/${GD}-Kernel-V${VERSION}_${DATE}_${DEVICE}.zip
rm -rf ${GD}.zip ${GD}/zImage ${GD}/dt.img modules ${DEVICE}/${GD}/ramdisk-recovery.cpio
cd ../${GD}
ARCH=arm CROSS_COMPILE=toolchain/bin/arm-eabi- make distclean
rm -rf toolchain arch/arm/boot/zImage-dtb
echo -e "\n\n${GREEN}DONE!\n\n\n${GD} Kernel V${VERSION} Build ${DATE} For ${DEVICE} Is Ready ^_^${RESET}\n\n"
else
echo -e "\n\n${RED}Failed To build ${GD} Kernel V${VERSION} For ${DEVICE}!!!!${RESET}\n\n"
fi