-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.sh
executable file
·275 lines (274 loc) · 5.9 KB
/
config.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#!/bin/bash
#
# vInstaller an Android upgrade tool.
# Copyright (C) 2012 Vincenzo Frascino <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
if [ -z $1 ]
then
echo "Usage: ./config.sh <upgrade> [<platform>] [<nand>]"
echo "Supported Upgrades:"
echo "-xloader"
echo "-kernel"
echo "-android"
echo "-debug"
echo "-debug-usb"
echo "-bootandroid"
echo "Supported Platforms:"
echo "-1340AB"
echo "-1340ABC"
echo "-1340ABC.ICS"
echo "-1340ABC.ICS.IRIS"
echo "-900_LCAD"
echo "-1340_LCAD"
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
else
if [ -n $2 ]
then
echo "Platform: [ "$2" ]"
case $2 in
-1340AB)
rm installer/install.sh
cp plat/1340AB/install.1340AB installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "NAND: [ "$3" ]"
case $3 in
-1GB)
rm cmd*
cp plat/1340AB/1GB/* .
./make_scriptcmds
;;
*)
rm cmd*
cp plat/1340AB/2GB/* .
./make_scriptcmds
;;
esac
else
echo "NAND dim is required for 1340AB."
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
fi
;;
-1340ABC)
rm installer/install.sh
cp plat/1340ABC/install.1340ABC installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "NAND: [ "$3" ]"
case $3 in
-1GB)
rm cmd*
cp plat/1340ABC/1GB/* .
./make_scriptcmds
;;
*)
rm cmd*
cp plat/1340ABC/2GB/* .
./make_scriptcmds
;;
esac
else
echo "NAND dim is required for 1340ABC."
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
fi
;;
-1340ABC.ICS)
rm installer/install.sh
cp plat/1340ABC.ICS/install.1340ABC.ICS installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "NAND: [ "$3" ]"
case $3 in
-1GB)
rm cmd*
cp plat/1340ABC.ICS/1GB/* .
./make_scriptcmds
;;
*)
rm cmd*
cp plat/1340ABC.ICS/2GB/* .
./make_scriptcmds
;;
esac
else
echo "NAND dim is required for 1340ABC.ICS."
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
fi
;;
-1340ABC.ICS.IRIS)
rm installer/install.sh
cp plat/1340ABC.ICS.IRIS/install.1340ABC.ICS.IRIS installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "RAM: [ "$3" ]"
case $3 in
-1GB)
rm cmd*
cp plat/1340ABC.ICS.IRIS/1GB/* .
./make_scriptcmds
;;
*)
rm cmd*
cp plat/1340ABC.ICS.IRIS/512MB/* .
./make_scriptcmds
;;
esac
else
echo "RAM dim is required for 1340ABC.ICS.IRIS."
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
fi
;;
-900_LCAD)
rm installer/install.sh
cp plat/900_LCAD/install.900_LCAD installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "NAND: [ "$3" ]"
rm cmd
cp plat/900_LCAD/1GB/* .
./make_scriptcmds
else
echo "NAND dim is required for 900_LCAD."
echo "Supported NANDs:"
echo "-1GB"
fi
;;
-1340_LCAD)
rm installer/install.sh
cp plat/1340_LCAD/install.1340_LCAD installer/install.sh
chmod +x installer/install.sh
if [ -n $3 ]
then
echo "NAND: [ "$3" ]"
case $3 in
-1GB)
rm cmd*
rm upgrade*
cp plat/1340_LCAD/1GB/* .
./make_scriptcmds
;;
*)
rm cmd*
rm upgrade*
cp plat/1340_LCAD/2GB/* .
./make_scriptcmds
;;
esac
else
echo "NAND dim is required for 1340_LCAD."
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
fi
;;
*)
echo "Usage: ./config.sh <upgrade> [<platform>] [<nand>]"
echo "Supported Upgrades:"
echo "-xloader"
echo "-kernel"
echo "-android"
echo "-debug"
echo "-debug-usb"
echo "-bootandroid"
echo "Supported Platforms:"
echo "-1340AB"
echo "-1340ABC"
echo "-1340ABC.ICS"
echo "-1340ABC.ICS.IRIS"
echo "-900_LCAD"
echo "-1340_LCAD"
echo "Supported NANDs:"
echo "-1GB"
echo "-2GB"
esac
fi
echo "Upgrade from: [ "$1" ]"
case $1 in
-debug)
rm cmd*
rm upgrade*
cp plat/Debug/Debug/* .
./make_scriptcmds
rm installer/install.sh
cp plat/Debug/install.Debug installer/install.sh
chmod +x installer/install.sh
;;
-debug-usb)
rm cmd*
rm upgrade*
cp plat/Debug.usb/Debug/* .
./make_scriptcmds
rm installer/install.sh
cp plat/Debug.usb/install.Debug installer/install.sh
chmod +x installer/install.sh
;;
-bootandroid)
rm cmd*
rm upgrade*
./bootandroid.sh $2
cp plat/BootAndroid/drive/* .
./make_scriptcmds
./convertImage.sh logo.jpg
;;
-xloader)
if [ -e upgrade-x.img ]
then
if [ -e upgrade-a.img ]
then
mv upgrade.img upgrade-k.img
mv upgrade-x.img upgrade.img
else
mv upgrade.img upgrade-a.img
mv upgrade-x.img upgrade.img
fi
fi
;;
-kernel)
if [ -e upgrade-k.img ]
then
if [ -e upgrade-a.img ]
then
mv upgrade.img upgrade-x.img
mv upgrade-k.img upgrade.img
else
mv upgrade.img upgrade-a.img
mv upgrade-k.img upgrade.img
fi
fi
;;
*)
if [ -e upgrade-a.img ]
then
mv upgrade.img upgrade-x.img
mv upgrade-a.img upgrade.img
fi
esac
fi