forked from gsstudios/Dorimanx-SG2-I9100-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean-kernel.sh
More file actions
executable file
·40 lines (33 loc) · 927 Bytes
/
clean-kernel.sh
File metadata and controls
executable file
·40 lines (33 loc) · 927 Bytes
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
#!/bin/bash
LANG=C;
PYTHON_CHECK=$(ls -la /usr/bin/python | grep python3 | wc -l);
PYTHON_WAS_3=0;
if [ "$PYTHON_CHECK" -eq "1" ] && [ -e /usr/bin/python2 ]; then
if [ -e /usr/bin/python2 ]; then
rm -f /usr/bin/python;
ln -s /usr/bin/python2 /usr/bin/python;
echo "Switched to Python2 for cleaning kernel will switch back when done";
PYTHON_WAS_3=1;
else
echo "You need Python2 to clean this kernel. install and come back."
exit 1;
fi;
else
echo "Python2 is used! all good, cleaning!";
fi;
cp -pv .config .config.bkp;
make ARCH=arm CROSS_COMPILE=android-toolchain/bin/arm-eabi- mrproper;
make clean;
cp -pv .config.bkp .config;
if [ "$PYTHON_WAS_3" -eq "1" ]; then
rm -f /usr/bin/python;
ln -s /usr/bin/python3 /usr/bin/python;
fi;
if [ -d ./.git ]; then
git checkout android-toolchain/
fi;
# clean ccache
read -t 5 -p "clean ccache, 5sec timeout (y/n)?";
if [ "$REPLY" == "y" ]; then
ccache -C;
fi;