root@x230:~/YourFritz-master/eva_tools# bash -x ./eva_to_memory /usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory 192.168.178.1
+ printf '\n'
+ read -u 0
+ filename=/usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory
+ box_ip=192.168.178.1
+ limit_memory=1
+ box_port=21
+ box_user=adam2
+ box_pass=adam2
+ passive_ftp=P@SW
+ '[' 0 -eq 0 ']'
+ TMP=/tmp
++ date +%s
+ tmpdir=/tmp/tmp_1508357760_10072
+ writefifo=/tmp/tmp_1508357760_10072/write
+ readfifo=/tmp/tmp_1508357760_10072/read
+ storefifo=/tmp/tmp_1508357760_10072/store
+ outstream=7
+ instream=8
+ upstream=9
+ logstream=3
+ logfile=./eva_to_memory.log
+ envfile=/tmp/tmp_1508357760_10072/env
+ startaddress=0x80000000
+ '[' x/usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory == x ']'
++ stat -c %s /usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory
+ filesize=27057408
+ '[' 0 -ne 0 ']'
+ mkfifo
+ '[' 1 -eq 127 ']'
+ nc
+ '[' 1 -eq 127 ']'
+ mkdir -p /tmp/tmp_1508357760_10072
+ mkfifo /tmp/tmp_1508357760_10072/write
+ rc=0
+ '[' 0 -ne 0 ']'
+ mkfifo /tmp/tmp_1508357760_10072/read
+ rc=0
+ '[' 0 -ne 0 ']'
+ mkfifo /tmp/tmp_1508357760_10072/store
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 7<>/tmp/tmp_1508357760_10072/write'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 8<>/tmp/tmp_1508357760_10072/read'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 3<>./eva_to_memory.log'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ control_connection=10084
+ data_connection=
+ nc 192.168.178.1 21
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '220 ADAM2 FTP Server ready
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '220 ADAM2 FTP Server ready
++ return 0
' line='220 ADAM2 FTP Server ready
+ ec=220
+ '[' x220 == x220 ']'
+ login_to_box 8 7 3
+ local instream=8 outstream=7 log=3 lines=0
+ write_ftp_command 'USER adam2' 7 3
+ local outstream=7 'cmd=USER adam2' log=3
+ '[' '!' -z 3 ']'
+ echo 'USER adam2'
+ echo 'USER adam2'
+ '[' 0 -lt 10 ']'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '331 Password required for adam2
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '331 Password required for adam2
++ return 0
' line='331 Password required for adam2
+ ec=331
+ '[' x331 == x331 ']'
+ write_ftp_command 'PASS adam2' 7 3
+ local outstream=7 'cmd=PASS adam2' log=3
+ '[' '!' -z 3 ']'
+ echo 'PASS adam2'
+ echo 'PASS adam2'
+ lines=0
+ '[' 0 -lt 10 ']'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '230 User adam2 successfully logged in
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '230 User adam2 successfully logged in
++ return 0
' line='230 User adam2 successfully logged in
+ ec=230
+ '[' x230 == x331 ']'
+ '[' x230 == x230 ']'
+ return 0
+ '[' 0 -eq 0 ']'
+ write_ftp_command SYST 7 3
+ local outstream=7 cmd=SYST log=3
+ '[' '!' -z 3 ']'
+ echo SYST
+ echo SYST
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '215 AVM EVA Version 1.1964 0x0 0x740D
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '215 AVM EVA Version 1.1964 0x0 0x740D
++ return 0
' line='215 AVM EVA Version 1.1964 0x0 0x740D
+ ec=215
+ '[' x215 == x215 ']'
'+ echo '215 AVM EVA Version 1.1964 0x0 0x740D
++ sed -n -e 's/.*\(AVM EVA\).*/\1/p'
+ syst='AVM EVA'
+ '[' 7 -ne 0 ']'
' echo 'Found AVM bootloader: AVM EVA Version 1.1964 0x0 0x740D
Found AVM bootloader: AVM EVA Version 1.1964 0x0 0x740D
++ get_environment 8 7 3
++ local instream=8 outstream=7 log=3 lines=0
++ write_ftp_command 'TYPE I' 7 3
++ local outstream=7 'cmd=TYPE I' log=3
++ '[' '!' -z 3 ']'
++ echo 'TYPE I'
++ echo 'TYPE I'
+++ read_ftp_response 8 3
+++ local 'line= -' rc=0 instream=8 log=3
+++ read -u 8 -r line
+++ '[' '!' -z 3 ']'
'++ echo '200 Type set to BINARY
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '200 Type set to BINARY
+++ return 0
'+ line='200 Type set to BINARY
++ ec=200
++ '[' x200 '!=' x200 ']'
++ write_ftp_command 'MEDIA SDRAM' 7 3
++ local outstream=7 'cmd=MEDIA SDRAM' log=3
++ '[' '!' -z 3 ']'
++ echo 'MEDIA SDRAM'
++ echo 'MEDIA SDRAM'
+++ read_ftp_response 8 3
+++ local 'line= -' rc=0 instream=8 log=3
+++ read -u 8 -r line
+++ '[' '!' -z 3 ']'
'++ echo '200 Media set to MEDIA_SDRAM
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '200 Media set to MEDIA_SDRAM
+++ return 0
'+ line='200 Media set to MEDIA_SDRAM
++ ec=200
++ '[' x200 '!=' x200 ']'
++ write_ftp_command P@SW 7 3
++ local outstream=7 cmd=P@SW log=3
++ '[' '!' -z 3 ']'
++ echo P@SW
++ echo P@SW
+++ read_ftp_response 8 3
+++ local 'line= -' rc=0 instream=8 log=3
+++ read -u 8 -r line
+++ '[' '!' -z 3 ']'
'++ echo '227 Entering Passive Mode (192,168,178,1,12,2)
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '227 Entering Passive Mode (192,168,178,1,12,2)
+++ return 0
'+ line='227 Entering Passive Mode (192,168,178,1,12,2)
++ ec=227
++ '[' x227 == x227 ']'
'++ echo 227 Entering Passive Mode '(192,168,178,1,12,2)
+++ sed -n -e 's/.*(\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\)).*/data_ip=\1.\2.\3.\4 data_port=\$(( \5 * 256 + \6 ))/p'
++ data_conn='data_ip=192.168.178.1 data_port=$(( 12 * 256 + 2 ))'
++ '[' 51 -eq 0 ']'
++ eval 'data_ip=192.168.178.1 data_port=$(( 12 * 256 + 2 ))'
+++ data_ip=192.168.178.1
+++ data_port=3074
++ data_connection=10099
++ sleep 1
++ nc -w 60 192.168.178.1 3074
++ write_ftp_command 'RETR env' 7 3
++ local outstream=7 'cmd=RETR env' log=3
++ '[' '!' -z 3 ']'
++ echo 'RETR env'
++ echo 'RETR env'
+++ read_ftp_response 8 3
+++ local 'line= -' rc=0 instream=8 log=3
+++ read -u 8 -r line
+++ '[' '!' -z 3 ']'
'++ echo '150 Opening BINARY data connection
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '150 Opening BINARY data connection
+++ return 0
'+ line='150 Opening BINARY data connection
++ ec=150
++ '[' x150 == x150 ']'
+++ read_ftp_response 8 3
+++ local 'line= -' rc=0 instream=8 log=3
+++ read -u 8 -r line
+++ '[' '!' -z 3 ']'
'++ echo '226 Transfer complete
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '226 Transfer complete
+++ return 0
'+ line='226 Transfer complete
++ ec=226
++ '[' x226 == x226 ']'
++ '[' -d /proc/10099 ']'
++ wait 10099
++ kill 10099
++ data_connection=
++ echo /tmp/tmp_1508357760_10072/env
++ return 0
+ environment=/tmp/tmp_1508357760_10072/env
+ '[' 0 -eq 0 ']'
++ sed -n -e 's/^HWRevision *\(.*\)\r$/\1/p' /tmp/tmp_1508357760_10072/env
+ hwrev=203
+ echo 'Found hardware revision: 203'
Found hardware revision: 203
++ sed -n -e 's/^memsize *\(.*\)\r$/\1/p' /tmp/tmp_1508357760_10072/env
+ memsize=0x08000000
++ printf '(%u MB)' 128
+ echo 'Memory size is 0x08000000 (128 MB)'
Memory size is 0x08000000 (128 MB)
+ '[' 1 = 1 ']'
+ memsize=134217728
+ echo 'Memory size limited to 128 MB'
Memory size limited to 128 MB
++ printf 0x%06x 27057408
++ printf '(%u MB)' 25
+ echo 'Image size is 0x19cdd00 (25 MB)'
Image size is 0x19cdd00 (25 MB)
++ printf 0x%08x 107160320
+ setmemsize=0x06632300
+ echo 'Setting temporary memory size to: 0x06632300'
Setting temporary memory size to: 0x06632300
++ printf 0x%08x 2254643968
+ imagestartaddr=0x86632300
++ printf 0x%08x 2281701376
+ imageendaddr=0x88000000
+ echo 'Setting temporary kernel args to: mtdram1=0x86632300,0x88000000'
Setting temporary kernel args to: mtdram1=0x86632300,0x88000000
+ upload_image 8 7 3 /usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory 0x06632300 0x86632300 0x88000000
+ local instream=8 outstream=7 log=3 file=/usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory memsize=0x06632300 startaddr=0x86632300 endaddr=0x88000000
+ eval 'exec 9<>/tmp/tmp_1508357760_10072/store'
++ exec
+ '[' 0 -ne 0 ']'
+ write_ftp_command 'SETENV memsize 0x06632300' 7 3
+ local outstream=7 'cmd=SETENV memsize 0x06632300' log=3
+ '[' '!' -z 3 ']'
+ echo 'SETENV memsize 0x06632300'
+ echo 'SETENV memsize 0x06632300'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '200 SETENV command successful
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '200 SETENV command successful
++ return 0
' line='200 SETENV command successful
+ ec=200
+ '[' x200 '!=' x200 ']'
+ write_ftp_command 'SETENV kernel_args_tmp mtdram1=0x86632300,0x88000000' 7 3
+ local outstream=7 'cmd=SETENV kernel_args_tmp mtdram1=0x86632300,0x88000000' log=3
+ '[' '!' -z 3 ']'
+ echo 'SETENV kernel_args_tmp mtdram1=0x86632300,0x88000000'
+ echo 'SETENV kernel_args_tmp mtdram1=0x86632300,0x88000000'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '200 SETENV command successful
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '200 SETENV command successful
++ return 0
' line='200 SETENV command successful
+ ec=200
+ '[' x200 '!=' x200 ']'
+ write_ftp_command 'TYPE I' 7 3
+ local outstream=7 'cmd=TYPE I' log=3
+ '[' '!' -z 3 ']'
+ echo 'TYPE I'
+ echo 'TYPE I'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '200 Type set to BINARY
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '200 Type set to BINARY
++ return 0
' line='200 Type set to BINARY
+ ec=200
+ '[' x200 '!=' x200 ']'
+ write_ftp_command 'MEDIA SDRAM' 7 3
+ local outstream=7 'cmd=MEDIA SDRAM' log=3
+ '[' '!' -z 3 ']'
+ echo 'MEDIA SDRAM'
+ echo 'MEDIA SDRAM'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '200 Media set to MEDIA_SDRAM
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '200 Media set to MEDIA_SDRAM
++ return 0
' line='200 Media set to MEDIA_SDRAM
+ ec=200
+ '[' x200 '!=' x200 ']'
+ write_ftp_command P@SW 7 3
+ local outstream=7 cmd=P@SW log=3
+ '[' '!' -z 3 ']'
+ echo P@SW
+ echo P@SW
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '227 Entering Passive Mode (192,168,178,1,12,15)
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '227 Entering Passive Mode (192,168,178,1,12,15)
++ return 0
' line='227 Entering Passive Mode (192,168,178,1,12,15)
+ ec=227
+ '[' x227 == x227 ']'
'+ echo 227 Entering Passive Mode '(192,168,178,1,12,15)
++ sed -n -e 's/.*(\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\)).*/data_ip=\1.\2.\3.\4 data_port=\$(( \5 * 256 + \6 ))/p'
+ data_conn='data_ip=192.168.178.1 data_port=$(( 12 * 256 + 15 ))'
+ '[' 52 -eq 0 ']'
+ eval 'data_ip=192.168.178.1 data_port=$(( 12 * 256 + 15 ))'
++ data_ip=192.168.178.1
++ data_port=3087
+ data_connection=10120
+ sleep 1
+ nc -w 3 192.168.178.1 3087
+ write_ftp_command 'STOR 0x86632300 0x88000000' 7 3
+ local outstream=7 'cmd=STOR 0x86632300 0x88000000' log=3
+ '[' '!' -z 3 ']'
+ echo 'STOR 0x86632300 0x88000000'
+ echo 'STOR 0x86632300 0x88000000'
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line
++ '[' '!' -z 3 ']'
'+ echo '150 Opening BINARY data connection
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '150 Opening BINARY data connection
++ return 0
' line='150 Opening BINARY data connection
+ ec=150
+ '[' x150 == x150 ']'
+ cat /usr/local/src/freetz/freetz-trunk/images/7362_06.83-freetz-devel-14443.de_20171017-080835.image.in-memory
++ read_ftp_response 8 3
++ local 'line= -' rc=0 instream=8 log=3
++ read -u 8 -r line