You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -127,38 +127,159 @@ The following commands are used to flash a new rootfs to image1 and then boot to
127
127
{% include alert.html content="This section is based on the `V1_7_8_210412` version of the stick's firmware " alert="Info" icon="svg-info" color="blue" %}
128
128
129
129
## Adding support to configurable SW and HW versions, Vendor ID and much more
130
-
`/etc/scripts/flash` can be flashed in order to add support for some variables implemented in `omci_app` but removed from `xmlconfig`. The patch is below (change the values to suit your needs)
if [ `echo $para | egrep $specific_mib_patten` ]; then
136
-
/bin/xmlconfig -g $para | sed -r "s/$rename_mib_name+/$2/g" | sed -r "s/,+//g"
137
-
else
138
-
- /bin/xmlconfig -g $para | sed -r "s/$rename_mib_name+/$2/g"
139
-
+ case "$para" in
140
-
+ "OMCI_EQID")
141
-
+ echo "$para=MY_EQID"
142
-
+ ;;
143
-
+ "OMCI_VENDOR_ID")
144
-
+ echo "$para=MY_VENDOR"
145
-
+ ;;
146
-
+ "OMCI_SW_VER1")
147
-
+ echo "$para=MY_SW_VER1"
148
-
+ ;;
149
-
+ "OMCI_SW_VER2")
150
-
+ echo "$para=MY_SW_VER2"
151
-
+ ;;
152
-
+ "OMCI_ONT_VER")
153
-
+ echo "$para=MY_HW_VER"
154
-
+ ;;
155
-
+ *)
156
-
+ /bin/xmlconfig -g $para | sed -r "s/$rename_mib_name+/$2/g"
157
-
+ ;;
158
-
+ esac
159
-
fi
160
-
if [ "$?" = "0" ]; then
161
-
exit 0
130
+
`/etc/scripts/flash` can be modified in order to add support for some variables implemented in `omci_app` but removed from `xmlconfig`. The modified file is below.
131
+
132
+
`flash set` will still print an error but the change wil be persisted. You can check that by running the relative `flash get` command
echo"Reset VoIP to default configuration success."
180
+
else
181
+
echo"Restore to default configurationg fail."
182
+
/bin/sh $0 -h
183
+
exit 1
184
+
fi
185
+
echo"Please reboot system."
186
+
exit 0
187
+
;;
188
+
"get" | "gethw")
189
+
# echo "------ [$1] Get a specific mib parameter from flash memory. ------"
190
+
if [ "$2"!="" ];then
191
+
para=$2
192
+
if [ `echo $para| egrep $rename_mib_patten` ];then
193
+
para=$rename_mib_name
194
+
fi
195
+
#echo "/bin/xmlconfig -g $para"
196
+
if [ `echo $para| egrep $specific_mib_patten` ];then
197
+
/bin/xmlconfig -g $para| sed -r "s/$rename_mib_name+/$2/g"| sed -r "s/,+//g"
198
+
else
199
+
local_nv_getenv=`nv getenv $para`
200
+
if [ -z"${local_nv_getenv}" ];then
201
+
/bin/xmlconfig -g $para| sed -r "s/$rename_mib_name+/$2/g"
202
+
else
203
+
echo"${local_nv_getenv}"| sed -r "s/$rename_mib_name+/$2/g"
204
+
fi
205
+
fi
206
+
if [ "$?"="0" ];then
207
+
exit 0
208
+
fi
209
+
else
210
+
/bin/sh $0 -h
211
+
exit 1
212
+
fi
213
+
;;
214
+
"set" | "sethw")
215
+
# echo "------ [$1] Set a specific mib parameter into flash memory. ------"
216
+
if [ "$2"!="" ] && [ "$3"!="" ];then
217
+
para=$2
218
+
if [ `echo $para| egrep $rename_mib_patten` ];then
219
+
$para=$rename_mib_name
220
+
fi
221
+
222
+
if [ $#-eq 3 ];then
223
+
var=$3
224
+
else
225
+
while [ $#-ge 3 ]
226
+
do
227
+
# for multiple decimal values: dec2hex and concatenate all setting value
228
+
if [ "$3"="08" ] || [ "$3"="09" ];then
229
+
# 08 & 09 are not invalid octal number
230
+
var=$var$3
231
+
else
232
+
var=$var`printf "%02x"$3`
233
+
fi
234
+
235
+
shift
236
+
if [ $#-ge 3 ];then var=$var",";fi
237
+
done
238
+
fi
239
+
#echo "/bin/xmlconfig -s $para $var"
240
+
241
+
/bin/xmlconfig -s $para$var| egrep "[ERR]"
242
+
if [ $?== 0 ];then
243
+
nv setenv $para$var
244
+
else
245
+
# Clear the ovveride from nv if it is there since we wrote it to xmlconfig
246
+
nv setenv $para
247
+
fi
248
+
if [ "`echo $2| egrep $hw_mib`"="" ];then
249
+
/bin/xmlconfig -of $LASTGOOD_FILE
250
+
fi
251
+
/bin/xmlconfig -of -hs $LASTGOOD_HS_FILE&&exit 0
252
+
else
253
+
/bin/sh $0 -h
254
+
exit 1
255
+
fi
256
+
;;
257
+
"-h")
258
+
echo'Usage: flash.sh [cmd]'
259
+
echo'cmd:'
260
+
echo' all <cs/hs> : Show all settings.'
261
+
echo' default <cs/hs> : Restore to default configuration.'
262
+
echo' get MIB-NAME : get a specific mib parameter from flash memory.'
263
+
echo' set MIB-NAME MIB-VALUE : set a specific mib parameter into flash memory.'
264
+
echo
265
+
echo' Note: When set the MIB_ARRAY or MIB_VALUE overflowed,'
266
+
echo' xmlconfig will truncate the redundant part.'
267
+
echo' Take signed integer for example:'
268
+
echo' 1. Set value=-6442450944(0xfffffffe80000000),'
269
+
echo' and get value=-2147483648(0x80000000)'
270
+
echo' 2. Set value=-2147483649(0xffffffff7fffffff),'
271
+
echo' and get value=2147483647(0x7fffffff)'
272
+
echo' 3. Set value=2147483648(0x80000000),'
273
+
echo' and get value=-2147483648(0x80000000)'
274
+
echo' 4. Set value=4294967296(0x100000000), and get value=0(0x0)'
275
+
echo
276
+
;;
277
+
*)
278
+
/bin/sh $0 -h
279
+
exit 1
280
+
;;
281
+
esac
282
+
162
283
```
163
284
## Increasing the length of the software version from 13 to 14 characters
164
285
`omci_app` has an hard-coded limit of 13 characters for the software version, which is too low. We can binary patch it to increase it to 14 (or more, if you dare/need)
0 commit comments