Log
# flash_from_url.sh -f http://support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ FORCE=n
+ FW_URL=
+ opts=
+ FORCE=y
+ opts= -f
+ [ x = x ]
+ FW_URL=http://support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ [ xhttp://support.wrtech.ru/update/WR-330/ktelecom/imageupdate = x ]
+ [ -f /etc/env.sh ]
+ . /etc/env.sh
+ AMLKEYS=/sys/class/aml_keys/aml_keys
+ PLATFORM_TYPE=amls805
+ + cut -d :+ -fcut 1 -d
d -f 2
grep -E "logo" /proc/mtd
+ LOGO_MTDDEV_NUM=1
+ grep -E "boot"|"kernel"+ /proc/mtdcut
-d : -f 1
+ cut -d d -f 2
+ BOOT_MTDDEV_NUM=2
+ grep -E "recovery"|"backup_kernel"+ /proc/mtdcut
-d : -f 1
+ cut -d d -f 2
+ RECOVERY_MTDDEV_NUM=3
+ grep -E "rootfs"|"rootfs_1"|"rootfs1"|"upgrade"|"system"|"nand" /proc/mtd+
cut -d : -f 1
+ cut -d d -f 2
+ ROOTFS0_MTDDEV_NUM=4
+ grep -E "rootfs2"|"persistent"+ /proc/mtdcut
-d : -f 1
+ cut -d d -f 2
+ ROOTFS1_MTDDEV_NUM=5
+ [ -z 5 ]
+ grep mtd5 /proc/mtd+
cut -d -f 2
+ ROOTFS1_SIZE=0x06e00000
+ ROOTFS1_SIZE=115343360
+ [ 115343360 -le 83886080 ]
+ read_amlkey_str fs_part_no
+ FS_PART_NO=
+ [ x == x1 ]
+ FS_PART_NO=0
+ UPDATE_PART_NO=1
+ UBI_FS_MTDDEV_NUM=4
+ UBI_UPDATE_MTDDEV_NUM=5
+ read_amlkey_str model_name
+ export MODEL_NAME=
+ [ -z ]
+ MODEL_NAME=WR330
+ LOGO_MTDDEV=/dev/mtd1
+ BOOT_MTDDEV=/dev/mtd2
+ RECOVERY_MTDDEV=/dev/mtd3
+ UBI_FS_MTDDEV=/dev/mtd4
+ UBI_UPDATE_MTDDEV=/dev/mtd5
+ [ 4 -eq 5 ]
+ UBI_FS_DEVICE_NUM=0
+ UBI_UPDATE_DEVICE_NUM=1
+ UBI_FS_SUBDEVICE_NUM=0
+ UBI_UPDATE_SUBDEVICE_NUM=0
+ UBI_FS_DEVICE=/dev/ubi0
+ UBI_FS_SUBDEVICE=/dev/ubi0_0
+ UBI_UPDATE_DEVICE=/dev/ubi1
+ UBI_UPDATE_SUBDEVICE=/dev/ubi1_0
+ UBI_FS_PART_NAME=bank0
+ UBI_UPDATE_PART_NAME=bank1
+ FS_DIR=
+ UPDATE_DIR=/mnt
+ UPDATE_SCRIPT=/mnt/usr/bin/update_script.sh
+ APPDATA=/opt/minibrowser
+ APPENVS=/opt/minibrowser/envs.sh
+ APPDEFENVS=/opt/minibrowser/defenvs.sh
+ LOGO_FILE=/usr/share/logo.bmp.gz
+ LOGO_HEAD=/usr/share/logo_head.bin
+ date +%s
+ TEMP=/tmp/flashfromurl-1532402185
+ HEADER_FILE=/tmp/flashfromurl-1532402185-header
+ + grep -v ://
echo http://support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ echo+ http://support.wrtech.ru/update/WR-330/ktelecom/imageupdategrep
://
+ sed -es,^\(.*://\).*,\1,g
+ proto=http://
+ echo http://support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ sed -e s,http://,,g
+ url=support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ echo+ support.wrtech.ru/update/WR-330/ktelecom/imageupdategrep
@
+ cut -d@ -f1
+ user=
+ echo support.wrtech.ru/update/WR-330/ktelecom/imageupdate
+ sed -e s,@,,g
+ cut -d/ -f1
+ host=support.wrtech.ru
+ echo support.wrtech.ru
+ sed -e s,^.*:,:,g -e s,.*:\([0-9]*\).*,\1,g -e s,[^0-9],,g
+ port=
+ echo support.wrtech.ru/update/WR-330/ktelecom/imageupdate+
grep /
+ cut -d/ -f2-
+ path=update/WR-330/ktelecom/imageupdate
+ sed+ s/:\/\/.*//echo
http://
+ proto=http
+ + grep+ -Egrep /dev/mtd5|/dev/ubi1|/dev/ubi1_0 -v
grep
ps -o args
+ [ -z ]
+ port=80
+ SIZE_FILE=/tmp/flashfromurl-1532402185-size
+ CRC32_FILE=/tmp/flashfromurl-1532402185-crc32
+ HEADER_FILE=/tmp/flashfromurl-1532402185-header
+ LOCATION_FILE=/tmp/flashfromurl-1532402185-location
+ HTTP_TIMEOUT=10
+ echo HEAD /update/WR-330/ktelecom/imageupdate HTTP/1.1
+ echo HOST: support.wrtech.ru
+ echo
+ i=1
+ nc+ support.wrtech.rugrep 80 Location:
/tmp/flashfromurl-1532402185
+ grep Content-Length: /tmp/flashfromurl-1532402185
+ [ 1 -le 10 ]
+ sleep 1
+ i=2
+ grep Location: /tmp/flashfromurl-1532402185
+ grep Content-Length: /tmp/flashfromurl-1532402185
+ [ 2 -le 10 ]
+ grep Location: /tmp/flashfromurl-1532402185+
sed s/Location: //
+ tr -d \n\r
+ LOCATION=
+ [ -z ]
+ grep Content-Length: /tmp/flashfromurl-1532402185
+ sed s/Content-Length: \([0-9]*\).*/\1/
+ tr -d \n\r
+ SIZE=89645196
+ bytes=89645192-
+ echo GET /update/WR-330/ktelecom/imageupdate HTTP/1.1
+ echo HOST: support.wrtech.ru
+ echo Range: bytes=89645192-
+ echo
+ i=1
+ grep Content-Range: bytes 89645192- /tmp/flashfromurl-1532402185
+ [ 1 -le 10 ]
+ sleep 1
+ i=2
+ grep Content-Range: bytes 89645192- /tmp/flashfromurl-1532402185
+ [ 2 -le 10 ]
+ tail -c 4 /tmp/flashfromurl-1532402185
+ hexdump -v -e /1 "%02x"
+ echo -n 0x985e49b8
+ bytes=89645188-89645191
+ echo GET /update/WR-330/ktelecom/imageupdate HTTP/1.1
+ echo HOST: support.wrtech.ru
+ echo Range: bytes=89645188-89645191
+ echo
+ i=1
+ grep Content-Range: bytes 89645188-89645191 /tmp/flashfromurl-1532402185
+ [ 1 -le 10 ]
+ sleep 1
+ i=2
+ grep Content-Range: bytes 89645188-89645191 /tmp/flashfromurl-1532402185
+ [ 2 -le 10 ]
+ tail -c 1+ /tmp/flashfromurl-1532402185
hexdump -e "%d"
+ HEADER_LENGTH=132
+ bytes=89645056-89645187
+ echo GET /update/WR-330/ktelecom/imageupdate HTTP/1.1
+ echo HOST: support.wrtech.ru
+ echo Range: bytes=89645056-89645187
+ echo
+ i=1
+ grep Content-Range: bytes 89645056-89645187 /tmp/flashfromurl-1532402185
+ [ 1 -le 10 ]
+ sleep 1
+ i=2
+ grep Content-Range: bytes 89645056-89645187 /tmp/flashfromurl-1532402185
+ tail -c 132 /tmp/flashfromurl-1532402185
+ echo -n 89645196
+ rm /tmp/flashfromurl-1532402185
+ [ -f /tmp/flashfromurl-1532402185-location ]
+ cat /tmp/flashfromurl-1532402185-size
+ SIZE=89645196
+ rm /tmp/flashfromurl-1532402185-size
+ cat /tmp/flashfromurl-1532402185-crc32
+ CRC32=0x985e49b8
+ rm /tmp/flashfromurl-1532402185-crc32
+ check /tmp/flashfromurl-1532402185-header
+ LOCAL_HEADER_FILE=/etc/header.json
+ IMAGE_HEADER_FILE=/tmp/flashfromurl-1532402185-header
+ [ -f /etc/header.json ]
+ sed -e s/.*"ImageDate":"\([^"]*\)".*/\1/ /etc/header.json
+ LOCAL_ImageDate=Mon Mar 12 07:58:21 GMT 2018
+ sed -e s/.*"ImageDescription":"\([^"]*\)".*/\1/ /etc/header.json
+ LOCAL_ImageDescription=1.003
+ sed -e s/.*"ImageVersion":"\([^"]*\)".*/\1/ /etc/header.json
+ LOCAL_ImageVersion=1.003.021wrt
+ sed -e s/.*"PlatformType":"\([^"]*\)".*/\1/ /etc/header.json
+ LOCAL_PlatformType=amls805
+ [ -f /tmp/flashfromurl-1532402185-header ]
+ sed -e s/.*"ImageDate":"\([^"]*\)".*/\1/ /tmp/flashfromurl-1532402185-header
+ IMAGE_ImageDate=Mon Jul 23 08:09:04 GMT 2018
+ sed -e s/.*"ImageDescription":"\([^"]*\)".*/\1/ /tmp/flashfromurl-1532402185-header
+ IMAGE_ImageDescription=1.006
+ sed -e s/.*"ImageVersion":"\([^"]*\)".*/\1/ /tmp/flashfromurl-1532402185-header
+ IMAGE_ImageVersion=1.006.019ktelecom
+ sed -e s/.*"PlatformType":"\([^"]*\)".*/\1/ /tmp/flashfromurl-1532402185-header
+ IMAGE_PlatformType=amls805
+ [ xamls805 != xamls805 ]
+ [ y = y ]
+ echo do not checking image version
do not checking image version
+ return 0
+ rm /tmp/flashfromurl-1532402185-header
+ pre_download
+ mkdir -p /mnt
+ find /mnt/
+ fuser /mnt/ -k
+ sleep 3
+ umount /mnt
umount: can't umount /mnt: Invalid argument
+ [ -e /dev/ubi1_0 ]
+ echo volume prepared
volume prepared
+ mkfifo /tmp/flashfromurl-1532402185
+ retry=0
+ seq 0 10
+ PID=792
+ sleep 1
+ ubiupdatevol /dev/ubi1_0 /tmp/flashfromurl-1532402185 -s 89645196
+ wget http://support.wrtech.ru/update/WR-330/ktelecom/imageupdate -O -
+ tee /tmp/flashfromurl-1532402185
+ check_crc -s 89645196 -c 0x985e49b8
+ CRC32=
+ SIZE=
+ FILE=-
+ [ 0 -lt 4 ]
+ shift
+ SIZE=89645196
+ shift
+ [ 0 -lt 2 ]
+ shift
+ CRC32=0x985e49b8
+ shift
+ [ 0 -lt 0 ]
+ [ -z 0x985e49b8 ]
+ [ x- == x- ]
+ [ -z 89645196 ]
Connecting to support.wrtech.ru (94.229.21.72:80)
+ head -c 89645192
+ ubicrc32
- 100% |***************************************************************************
+ CALCED=0x985e49b8
+ [ 0x985e49b8 == 0x985e49b8 ]
+ echo crc check success!
crc check success!
+ return 0
+ echo wget finished, waiting 792
wget finished, waiting 792
+ wait 792
+ rm /tmp/flashfromurl-1532402185
+ [ 0 -eq 0 ]
+ echo post download
post download
+ post_download
+ mount -t ubifs ubi1_0 /mnt
+ cd /mnt/
+ sh /mnt/usr/bin/update_script.sh
Erasing 128 Kibyte @ 800000 - 100% complete.
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000
Writing data to block 8 at offset 0x100000
Writing data to block 9 at offset 0x120000
Writing data to block 10 at offset 0x140000
Writing data to block 11 at offset 0x160000
Writing data to block 12 at offset 0x180000
Writing data to block 13 at offset 0x1a0000
Writing data to block 14 at offset 0x1c0000
Writing data to block 15 at offset 0x1e0000
Writing data to block 16 at offset 0x200000
Writing data to block 17 at offset 0x220000
Writing data to block 18 at offset 0x240000
Writing data to block 19 at offset 0x260000
Writing data to block 20 at offset 0x280000
Writing data to block 21 at offset 0x2a0000
Writing data to block 22 at offset 0x2c0000
Writing data to block 23 at offset 0x2e0000
Writing data to block 24 at offset 0x300000
Writing data to block 25 at offset 0x320000
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
Writing data to block 28 at offset 0x380000
Writing data to block 29 at offset 0x3a0000
Writing data to block 30 at offset 0x3c0000
Writing data to block 31 at offset 0x3e0000
Socket error Event: 32 Error: 10053.
Connection closing...Socket close.
Connection closed by foreign host.