-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_kernel_p4
More file actions
executable file
·79 lines (66 loc) · 1.71 KB
/
build_kernel_p4
File metadata and controls
executable file
·79 lines (66 loc) · 1.71 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#
#****************************************************************
## Start timer:
START=$(date +%s)
#****************************************************************
## Check for missing parameters:
if [ "$1" != "p4" ] && [ "$1" != "p4t" ] && [ "$1" != "p4v" ] && [ "$1" != "p4w" ]
then
echo "No target device defined"
exit 0
fi
#****************************************************************
## Set target:
if [ "$1" = "p4" ]
then
trgt=p4
fi
if [ "$1" = "p4t" ]
then
trgt=p4tmo
fi
if [ "$1" = "p4v" ]
then
trgt=p4vzw
fi
if [ "$1" = "p4w" ]
then
trgt=p4wifi
fi
#****************************************************************
## Set folder parameters:
echo "Setting folders"
finalout=~/android/cm102/out/target/product/$trgt
androidtop=~/android/cm102
secsign=~/android/cm102/build/target/product/security
#****************************************************************
## Clean environment:
cd $androidtop/
make installclean
rm $finalout/boot.img
#****************************************************************
## Make the build:
cd $androidtop/
. build/envsetup.sh
breakfast $trgt
mka bootimage
#****************************************************************
## Check whether build finished succesfully:
echo "Check whether p4 kernel build finished succesfully"
if [ -e $finalout/boot.img ]
then
echo "Build finished succesfully"
else
echo "Build not found, probably a compile error occured"
exit 0
fi
#****************************************************************
## Report timer:
END=$(date +%s)
ELAPSED=$((END - START))
E_MIN=$((ELAPSED / 60))
E_SEC=$((ELAPSED - E_MIN * 60))
printf "${txtgrn}Elapsed: "
[ $E_MIN != 0 ] && printf "%d min(s) " $E_MIN
printf "%d sec(s)\n ${txtrst}" $E_SEC