-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel_compile.sh
executable file
·99 lines (80 loc) · 2.01 KB
/
kernel_compile.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!bin/bash
read -p "Do you want to clean the kernel? yes/no:" re
while [ "${re}" != "yes" -a \
"${re}" != "y" -a \
"${re}" != "YES" -a \
"${re}" != "Y" -a \
"${re}" != "no" -a \
"${re}" != "n" -a \
"${re}" != "NO" -a \
"${re}" != "N" ]
do
read -p "Do you want to clean the kernel? yes/no:" re
done
if [ "${re}" = "yes" -o \
"${re}" = "y" -o \
"${re}" = "YES" -o \
"${re}" = "Y" ];then
make mrproper
make clean
rm -rf dist/
else
echo "skip"
fi
read -p "Which defconfig:
(1)bcm2709_defconfig
(2)defconfig
(3)skip
" def
until [ -n "${def}" ]
do
read -p "Which defconfig:" def
done
if [ "${def}" = "1" ]; then
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
elif [ "${def}" = "2" ]; then
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
elif [ "${def}" = "3" ]; then
echo "skip"
else
echo "Wrong input!"
exit
fi
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
read -p "How many threads for compile or skip: " num
until [ -n "${num}" ]
do
read -p "How many threads for compile:" num
done
if [ "${num}" = "skip" ]; then
echo "skip"
else
make -j ${num} ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs 2> error_log
fi
##read -p "Module install path:" mod
##until [ -n "${mod}" ]
##do
## read -p "Module install path:" mod
##done
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=dist modules_install
#read -p "Do you want to compress boot & modules? yes/no:" re
#while [ "${re}" != "yes" -a \
# "${re}" != "y" -a \
# "${re}" != "YES" -a \
# "${re}" != "Y" -a \
# "${re}" != "no" -a \
# "${re}" != "n" -a \
# "${re}" != "NO" -a \
# "${re}" != "N" ]
#do
# read -p "Do you want compress boot & modules? yes/no:" re
#done
#if [ "${re}" = "yes" -o \
# "${re}" = "y" -o \
# "${re}" = "YES" -o \
# "${re}" = "Y" ];then
# tar Jcvf boot.tar.xz arch/arm/boot
# tar Jcvf modules.tar.xz dist/lib/modules
#else
# exit
#fi