-
Notifications
You must be signed in to change notification settings - Fork 1
/
tch_5000_versioncusto
executable file
·319 lines (299 loc) · 9.93 KB
/
tch_5000_versioncusto
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
#!/bin/sh
********************************************************************
* Modifiing the SW version to the values required by Customer
*********************************************************************
board=`uci get env.var.hardware_version`
if [ $board == "VBNT-K" ]; then
uci set versioncusto.override.fwversion_prefix='AGTEF_'
transl="TI_versions"
elif [ $board == "VBNT-K_SFP" ]; then
uci set versioncusto.override.fwversion_prefix='AGTHP_'
transl="TI_versions_SFP"
elif [ $board == "VBNT-S" ]; then
uci set versioncusto.override.fwversion_prefix='AGTHP_'
transl="TI_versions_SFP"
fi
#this will only be used during development/customization and will be removed normally together with closing the build
#uci set versioncusto.override.fwversion_suffix='ti_open file 16.3.7187-2789001'
#firmware versions conversion table : homeware version -> TI version
#Add new entries in the 'here-document' below (before the EOTX ending line)
#leave the last line : 'Unknown' if no matching version
#top-down precedence order : if actual version does not match first field of first line, try next line
TI_versions_SFP(){
cat <<EOTXT
17.1.7745-0009001 1.0.1_001
17.1.7745-0001001 1.0.1_001
17.1.7745-0009010 1.0.1_001
17.1.7745-0001010 1.0.1_001
17.1.7745-0009009 1.0.1_001_DUMMY
17.1.7745-0001009 1.0.1_001_DUMMY
17.1.7765-0009003 1.0.1_002
17.1.7765-0001003 1.0.1_002
17.1.7765-0009016 1.0.1_002
17.1.7765-0001016 1.0.1_002
17.1.7765-0009017 1.0.1_002_DUMMY
17.1.7765-0001017 1.0.1_002_DUMMY
17.1.7765-0009018 1.0.2_001
17.1.7765-0001018 1.0.2_001
17.1.7765-0009019 1.0.2_001
17.1.7765-0001019 1.0.2_001
17.1.7765-0009020 1.0.2_001_DUMMY
17.1.7765-0001020 1.0.2_001_DUMMY
17.1.7798-0009001 1.0.2_002
17.1.7798-0001001 1.0.2_002
17.1.7798-0009002 1.0.2_002
17.1.7798-0001002 1.0.2_002
17.1.7798-0009003 1.0.2_002_DUMMY
17.1.7798-0001003 1.0.2_002_DUMMY
17.1.7798-0009009 1.0.2
17.1.7798-0001009 1.0.2
17.1.7798-0009010 1.0.2
17.1.7798-0001010 1.0.2
17.1.7798-0009011 1.0.2_DUMMY
17.1.7798-0001011 1.0.2_DUMMY
17.1.7812-0009003 1.0.3_002
17.1.7812-0001003 1.0.3_002
17.1.7812-0009007 1.0.3_002
17.1.7812-0001007 1.0.3_002
17.1.7812-0009008 1.0.3_002_DUMMY
17.1.7812-0001008 1.0.3_002_DUMMY
17.1.7841-0009001 1.0.4_001
17.1.7841-0001001 1.0.4_001
17.1.7841-0009002 1.0.4_001
17.1.7841-0001002 1.0.4_001
17.1.7841-0009003 1.0.4_001_DUMMY
17.1.7841-0001003 1.0.4_001_DUMMY
17.1.7882-0009001 1.0.5_001
17.1.7882-0001001 1.0.5_001
17.1.7882-0009003 1.0.5_001
17.1.7882-0001003 1.0.5_001
17.1.7882-0009005 1.0.5_001_DUMMY
17.1.7882-0001005 1.0.5_001_DUMMY
17.1.7882-0009020 1.0.5_002
17.1.7882-0001020 1.0.5_002
17.1.7882-0009021 1.0.5_002
17.1.7882-0001021 1.0.5_002
17.1.7882-0009022 1.0.5_002_DUMMY
17.1.7882-0001022 1.0.5_002_DUMMY
17.1.7882-0009026 1.0.5
17.1.7882-0001026 1.0.5
17.1.7882-0009027 1.0.5
17.1.7882-0001027 1.0.5
17.1.7882-0009028 1.0.5_DUMMY
17.1.7882-0001028 1.0.5_DUMMY
17.3.0165-1689001 1.0.6_001
17.3.0165-1681001 1.0.6_001
17.3.0165-1689003 1.0.6_001
17.3.0165-1681003 1.0.6_001
17.3.0165-1689004 1.0.6_001_DUMMY
17.3.0165-1681004 1.0.6_001_DUMMY
17.3.0177-1689012 1.1.0_001
17.3.0177-1681012 1.1.0_001
17.3.0177-1689013 1.1.0_001
17.3.0177-1681013 1.1.0_001
17.3.0177-1689014 1.1.0_001_DUMMY
17.3.0177-1681014 1.1.0_001_DUMMY
17.3.0177-1689025 1.1.0_002
17.3.0177-1681025 1.1.0_002
17.3.0177-1689026 1.1.0_002
17.3.0177-1681026 1.1.0_002
17.3.0177-1689027 1.1.0_002_DUMMY
17.3.0177-1681027 1.1.0_002_DUMMY
17.3.0177-1689034 1.1.0
17.3.0177-1681034 1.1.0
17.3.0177-1689035 1.1.0
17.3.0177-1681035 1.1.0
17.3.0177-1689036 1.1.0_DUMMY
17.3.0177-1681036 1.1.0_DUMMY
17.3.0238-1689001 1.1.1_001
17.3.0238-1681001 1.1.1_001
17.3.0238-1689004 1.1.1_001
17.3.0238-1681004 1.1.1_001
17.3.0238-1689005 1.1.1_001_DUMMY
17.3.0238-1681005 1.1.1_001_DUMMY
17.3.0268-1689001 1.1.1_002
17.3.0268-1681001 1.1.1_002
17.3.0268-1689004 1.1.1_002
17.3.0268-1681004 1.1.1_002
17.3.0268-1689005 1.1.1_002_DUMMY
17.3.0268-1681005 1.1.1_002_DUMMY
17.3.0268-1689018 1.1.1
17.3.0268-1681018 1.1.1
17.3.0268-1689019 1.1.1
17.3.0268-1681019 1.1.1
17.3.0268-1689020 1.1.1_DUMMY
17.3.0268-1681020 1.1.1_DUMMY
17.3.0307-1689001 1.1.2_001
17.3.0307-1681001 1.1.2_001
17.3.0307-1689003 1.1.2_001
17.3.0307-1681003 1.1.2_001
17.3.0307-1689005 1.1.2_001_DUMMY
17.3.0307-1681005 1.1.2_001_DUMMY
17.3.c.0331-8041001 1.1.2_003
17.3.c.0331-8049001 1.1.2_003
17.3.c.0331-8041002 1.1.2_003
17.3.c.0331-8049002 1.1.2_003
17.3.c.0331-8041003 1.1.2_003_DUMMY
17.3.c.0331-8049003 1.1.2_003_DUMMY
17.3.c.0337-8041008 1.1.2_004
17.3.c.0337-8049008 1.1.2_004
17.3.c.0337-8041009 1.1.2_004
17.3.c.0337-8049009 1.1.2_004
17.3.c.0337-8041010 1.1.2_004_DUMMY
17.3.c.0337-8049010 1.1.2_004_DUMMY
17.3.c.0337-8041020 1.2.0_001
17.3.c.0337-8049020 1.2.0_001
17.3.c.0337-8041021 1.2.0_001
17.3.c.0337-8049021 1.2.0_001
17.3.c.0337-8041022 1.2.0_001_DUMMY
17.3.c.0337-8049022 1.2.0_001_DUMMY
17.3.c.0337-8041026 1.1.2
17.3.c.0337-8049026 1.1.2
17.3.c.0337-8041027 1.1.2
17.3.c.0337-8049027 1.1.2
17.3.c.0337-8041028 1.1.2_DUMMY
17.3.c.0337-8049028 1.1.2_DUMMY
17.3.c.0349-8041001 2.0.0_002
17.3.c.0349-8049001 2.0.0_002
17.3.c.0349-8041004 2.0.0_002
17.3.c.0349-8049004 2.0.0_002
17.3.c.0349-8041005 2.0.0_002_DUMMY
17.3.c.0349-8049005 2.0.0_002_DUMMY
17.3.c.0349-8041008 2.0.0_003
17.3.c.0349-8049008 2.0.0_003
17.3.c.0349-8041010 2.0.0_003
17.3.c.0349-8049010 2.0.0_003
17.3.c.0349-8041012 2.0.0_003_DUMMY
17.3.c.0349-8049012 2.0.0_002_DUMMY
17.3.c.0349-8041015 2.0.0_004
17.3.c.0349-8049015 2.0.0_004
17.3.c.0349-8041016 2.0.0_004
17.3.c.0349-8049016 2.0.0_004
17.3.c.0349-8041017 2.0.0_004_DUMMY
17.3.c.0349-8049017 2.0.0_004_DUMMY
17.3.c.0349-8041021 2.0.0
17.3.c.0349-8049021 2.0.0
17.3.c.0349-8041022 2.0.0
17.3.c.0349-8049022 2.0.0
17.3.c.0349-8041023 2.0.0_DUMMY
17.3.c.0349-8049023 2.0.0_DUMMY
17.3.c.0365-8041001 2.0.1_001
17.3.c.0365-8049001 2.0.1_001
17.3.c.0365-8041003 2.0.1_001
17.3.c.0365-8049003 2.0.1_001
17.3.c.0365-8041004 2.0.1_001_DUMMY
17.3.c.0365-8049004 2.0.1_001_DUMMY
17.3.c.0365-8041007 2.0.1_002
17.3.c.0365-8049007 2.0.1_002
17.3.c.0365-8041008 2.0.1_002
17.3.c.0365-8049008 2.0.1_002
17.3.c.0365-8041009 2.0.1_002_DUMMY
17.3.c.0365-8049009 2.0.1_002_DUMMY
17.3.c.0365-8041014 2.0.1_003
17.3.c.0365-8049014 2.0.1_003
17.3.c.0365-8041015 2.0.1_003
17.3.c.0365-8049015 2.0.1_003
17.3.c.0365-8041016 2.0.1_003_DUMMY
17.3.c.0365-8049016 2.0.1_003_DUMMY
18.3.0313-3161001 2.1.0_001
18.3.0313-3169001 2.1.0_001
18.3.0313-3161002 2.1.0_001
18.3.0313-3169002 2.1.0_001
18.3.0313-3161003 2.1.0_001_DUMMY
18.3.0313-3169003 2.1.0_001_DUMMY
18.3.0335-3161001 2.1.0_002
18.3.0335-3169001 2.1.0_002
18.3.0335-3161002 2.1.0_002
18.3.0335-3169002 2.1.0_002
18.3.0335-3161003 2.1.0_002_DUMMY
18.3.0335-3169003 2.1.0_002_DUMMY
18.3.0335-3161008 2.1.0_003
18.3.0335-3169008 2.1.0_003
18.3.0335-3161009 2.1.0_003
18.3.0335-3169009 2.1.0_003
18.3.0335-3161010 2.1.0_003_DUMMY
18.3.0335-3169010 2.1.0_003_DUMMY
18.3.0357-3161001 2.1.0_004
18.3.0357-3169001 2.1.0_004
18.3.0357-3161002 2.1.0_004
18.3.0357-3169002 2.1.0_004
18.3.0357-3161003 2.1.0_004_DUMMY
18.3.0357-3169003 2.1.0_004_DUMMY
18.3.0376-3161001 2.1.0_005
18.3.0376-3169001 2.1.0_005
18.3.0376-3161002 2.1.0_005
18.3.0376-3169002 2.1.0_005
18.3.0376-3161003 2.1.0_005_DUMMY
18.3.0376-3169003 2.1.0_005_DUMMY
18.3.0385-3161001 2.2.0_001
18.3.0385-3169001 2.2.0_001
18.3.0385-3161002 2.2.0_001
18.3.0385-3169002 2.2.0_001
18.3.0385-3161003 2.2.0_001_DUMMY
18.3.0385-3169003 2.2.0_001_DUMMY
18.3.0376-3161021 2.1.0
18.3.0376-3169021 2.1.0
18.3.0376-3161022 2.1.0
18.3.0376-3169022 2.1.0
18.3.0376-3161023 2.1.0_DUMMY
18.3.0376-3169023 2.1.0_DUMMY
18.3.0412-3161003 2.2.0_002
18.3.0412-3169003 2.2.0_002
18.3.0412-3161004 2.2.0_002
18.3.0412-3169004 2.2.0_002
18.3.0412-3161005 2.2.0_002_DUMMY
18.3.0412-3169005 2.2.0_002_DUMMY
18.3.0445-3161002 2.2.0_003
18.3.0445-3169002 2.2.0_003
18.3.0445-3161003 2.2.0_003
18.3.0445-3169003 2.2.0_003
18.3.0445-3161004 2.2.0_003_DUMMY
18.3.0445-3169004 2.2.0_003_DUMMY
18.3.k.0451-3161001 2.2.0_004
18.3.k.0451-3169001 2.2.0_004
18.3.k.0451-3161002 2.2.0_004
18.3.k.0451-3169002 2.2.0_004
18.3.k.0451-3161003 2.2.0_004_DUMMY
18.3.k.0451-3169003 2.2.0_004_DUMMY
18.3.k.0451-3161010 2.2.0
18.3.k.0451-3169010 2.2.0
18.3.k.0451-3161011 2.2.0
18.3.k.0451-3169011 2.2.0
18.3.k.0451-3161012 2.2.0_DUMMY
18.3.k.0451-3169012 2.2.0_DUMMY
18.3.0495-3161001 2.2.1_001
18.3.0495-3169001 2.2.1_001
18.3.0495-3161002 2.2.1_001
18.3.0495-3169002 2.2.1_001
18.3.0495-3161003 2.2.1_001_DUMMY
18.3.0495-3169003 2.2.1_001_DUMMY
18.3.0547-3161001 2.2.1_002
18.3.0547-3169001 2.2.1_002
18.3.0547-3161002 2.2.1_002
18.3.0547-3169002 2.2.1_002
18.3.0547-3161003 2.2.1_002_DUMMY
18.3.0547-3169003 2.2.1_002_DUMMY
.* 1.99.99.99
EOTXT
}
#perform a translation (table based in this example : output 2nd field of matching version entry in PXS_versions table above)
#input params:
# none
TI_translate_swversions(){
tver=$($transl | awk -v srch="$(uci get env.var.friendly_sw_version_activebank)" 'srch ~ $1 {print $2}' | head -1)
uci set env.var.friendly_sw_version_activebank=`uci get versioncusto.override.fwversion_prefix`"$tver"
uci set versioncusto.override.fwversion_override="$tver"
#Populate user-agent
#user-agent format for TI: vendorname / <HWversion>/ <FWversion> / <SWversion>
uci set mmpbxrvsipnet.sip_net.user_agent="$(uci get env.var.company_name) / $(uci get env.var.hardware_version) / `uci get versioncusto.override.fwversion_prefix`"$tver" / `uci get versioncusto.override.fwversion_prefix`"$tver""
uci commit mmpbxrvsipnet
tver=$($transl | awk -v srch="$(uci get env.var.friendly_sw_version_passivebank)" 'srch ~ $1 {print $2}' | head -1)
uci set env.var.friendly_sw_version_passivebank=`uci get versioncusto.override.fwversion_prefix`"$tver"
#if no conversion needed : comment previous 3 lines
uci commit env
}
TI_translate_swversions
SW_Version=`lua -e "t=require'transformer.shared.banktable' value=t.getCurrentVersion() print(string.match(value,'([^%-]+)%-'))"`
#this will only be used during development/customization and will be removed normally together with closing the build
#uci set versioncusto.override.fwversion_suffix='_Custo005'
uci commit versioncusto