-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu
executable file
·122 lines (104 loc) · 2.41 KB
/
menu
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
# clear screen
clear
# location
export DIR=`readlink -f .`;
export PARENT_DIR=`readlink -f ${DIR}/..`;
# color
BGRED=`echo -e "\033[41m"`
NORMAL=`echo -e "\033[m"`
# menu
echo "${BGRED} bcm21553-common kernel build script${NORMAL}"
echo " "
echo " b. build"
echo " c. clean"
echo " "
echo " r. restart script"
echo " x. exit script"
# Read the letter the user gives
echo
read enterLetter
# build
if [ "$enterLetter" == "b" ]
then
# devices menu
echo "${BGRED} Choose your device${NORMAL}"
echo " "
echo " 1. totoro"
echo " 2. cooperve"
echo " 3. tassve"
echo " "
echo " m. main menu"
echo " x. exit script"
# Read the letter the user gives
echo
read enterLetter
# totoro
if [ "$enterLetter" == "1" ]
then
VARIANT="totoro"
# cooperve
elif [ "$enterLetter" == "2" ]
then
VARIANT="cooperve"
# tassve
elif [ "$enterLetter" == "3" ]
then
VARIANT="tassve"
# main menu
elif [ "$enterLetter" == "m" ]
then
$DIR/menu
# Exit
elif [ "$enterLetter" == "x" ]
then
exit 0
# Other choice
else
echo "Invalid option, choose your device."
$DIR/menu
fi
# remove previous zImage files
if [ -e $PARENT_DIR/zImage ]; then
rm $PARENT_DIR/zImage;
fi;
#name
export KBUILD_BUILD_USER=mohammad.afaneh
export KBUILD_BUILD_HOST=ubuntu
# kernel config
export ARCH=arm;
export KERNEL_CONFIG="cyanogenmod_${VARIANT}_defconfig";
# system compiler
export CROSS_COMPILE=$PARENT_DIR/arm-eabi-4.6/bin/arm-eabi-;
# build
export USER=`whoami`
export TMPFILE=`mktemp -t`;
export NUMBEROFCPUS=`grep 'processor' /proc/cpuinfo | wc -l`;
make $KERNEL_CONFIG;
make -j$NUMBEROFCPUS zImage
# final Touch for Kernel
if [ -e $DIR/arch/arm/boot/zImage ]; then
cp $DIR/arch/arm/boot/zImage $PARENT_DIR/zImage;
fi;
stat $PARENT_DIR/zImage || exit 1;
# clean
elif [ "$enterLetter" == "c" ]
then
# system compiler
export CROSS_COMPILE=$PARENT_DIR/arm-eabi-4.6/bin/arm-eabi-;
make clean
make mrproper
$DIR/menu
# Restart
elif [ "$enterLetter" == "r" ]
then
$DIR/menu
# Exit
elif [ "$enterLetter" == "x" ]
then
exit 0
# Other choice
else
echo "Invalid option."
$DIR/menu
fi