Das war ein guter Hinweis. Ich hatte die (alte) Standardverson von gnu-netcat
[user@host ~/freetz-trunk]$ nc -V
netcat (The GNU Netcat) 0.7.1
Copyright (C) 2002 - 2003 Giovanni Giacobbi
Habe dann die openbsd-netcat Version installiert
[<user>@<host> /home/<user>/freetz-trunk/images]# pacman -Ss openbsd-netcat
community/openbsd-netcat 1.178_3-1 [Installiert]
TCP/IP swiss army knife. OpenBSD variant.
Damit hat es dann sofort funktioniert.
Code:
[<user>@<host> ~/freetz-trunk/images]$ bash -x ./eva_to_memory 7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory
+ printf '\n'
+ read -u 0
+ filename=7590_06.92-freetz-devel-14583.de_20180117-183813.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_1516285409_11397
+ writefifo=/tmp/tmp_1516285409_11397/write
+ readfifo=/tmp/tmp_1516285409_11397/read
+ storefifo=/tmp/tmp_1516285409_11397/store
+ outstream=7
+ instream=8
+ upstream=9
+ logstream=3
+ logfile=./eva_to_memory.log
+ envfile=/tmp/tmp_1516285409_11397/env
+ startaddress=0x80000000
+ '[' x7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory == x ']'
++ stat -c %s 7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory
+ filesize=23736576
+ '[' 0 -ne 0 ']'
+ mkfifo
+ '[' 1 -eq 127 ']'
+ nc
+ '[' 1 -eq 127 ']'
+ mkdir -p /tmp/tmp_1516285409_11397
+ mkfifo /tmp/tmp_1516285409_11397/write
+ rc=0
+ '[' 0 -ne 0 ']'
+ mkfifo /tmp/tmp_1516285409_11397/read
+ rc=0
+ '[' 0 -ne 0 ']'
+ mkfifo /tmp/tmp_1516285409_11397/store
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 7<>/tmp/tmp_1516285409_11397/write'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 8<>/tmp/tmp_1516285409_11397/read'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ eval 'exec 3<>./eva_to_memory.log'
++ exec
+ rc=0
+ '[' 0 -ne 0 ']'
+ control_connection=11409
+ 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.3258 0x0 0x46409
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '215 AVM EVA Version 1.3258 0x0 0x46409
++ return 0
' line='215 AVM EVA Version 1.3258 0x0 0x46409
+ ec=215
+ '[' x215 == x215 ']'
'+ echo '215 AVM EVA Version 1.3258 0x0 0x46409
++ sed -n -e 's/.*\(AVM EVA\).*/\1/p'
+ syst='AVM EVA'
+ '[' 7 -ne 0 ']'
' echo 'Found AVM bootloader: AVM EVA Version 1.3258 0x0 0x46409
Found AVM bootloader: AVM EVA Version 1.3258 0x0 0x46409
++ 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,3)
+++ '[' ' ' '!=' - ']'
+++ break
+++ rc=0
'++ echo '227 Entering Passive Mode (192,168,178,1,12,3)
+++ return 0
'+ line='227 Entering Passive Mode (192,168,178,1,12,3)
++ ec=227
++ '[' x227 == x227 ']'
'++ echo 227 Entering Passive Mode '(192,168,178,1,12,3)
+++ 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 + 3 ))'
++ '[' 51 -eq 0 ']'
++ eval 'data_ip=192.168.178.1 data_port=$(( 12 * 256 + 3 ))'
+++ data_ip=192.168.178.1
+++ data_port=3075
++ data_connection=11424
++ sleep 1
++ nc -d -w 60 192.168.178.1 3075
++ 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/11424 ']'
++ wait 11424
++ kill 11424
++ data_connection=
++ echo /tmp/tmp_1516285409_11397/env
++ return 0
+ environment=/tmp/tmp_1516285409_11397/env
+ '[' 0 -eq 0 ']'
++ sed -n -e 's/^HWRevision *\(.*\)\r$/\1/p' /tmp/tmp_1516285409_11397/env
+ hwrev=226
+ echo 'Found hardware revision: 226'
Found hardware revision: 226
++ sed -n -e 's/^memsize *\(.*\)\r$/\1/p' /tmp/tmp_1516285409_11397/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 23736576
++ printf '(%u MB)' 22
+ echo 'Image size is 0x16a3100 (22 MB)'
Image size is 0x16a3100 (22 MB)
++ printf 0x%08x 110481152
+ setmemsize=0x0695cf00
+ echo 'Setting temporary memory size to: 0x0695cf00'
Setting temporary memory size to: 0x0695cf00
++ printf 0x%08x 2257964800
+ imagestartaddr=0x8695cf00
++ printf 0x%08x 2281701376
+ imageendaddr=0x88000000
+ echo 'Setting temporary kernel args to: mtdram1=0x8695cf00,0x88000000'
Setting temporary kernel args to: mtdram1=0x8695cf00,0x88000000
+ upload_image 8 7 3 7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory 0x0695cf00 0x8695cf00 0x88000000
+ local instream=8 outstream=7 log=3 file=7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory memsize=0x0695cf00 startaddr=0x8695cf00 endaddr=0x88000000
+ eval 'exec 9<>/tmp/tmp_1516285409_11397/store'
++ exec
+ '[' 0 -ne 0 ']'
+ write_ftp_command 'SETENV memsize 0x0695cf00' 7 3
+ local outstream=7 'cmd=SETENV memsize 0x0695cf00' log=3
+ '[' '!' -z 3 ']'
+ echo 'SETENV memsize 0x0695cf00'
+ echo 'SETENV memsize 0x0695cf00'
++ 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=0x8695cf00,0x88000000' 7 3
+ local outstream=7 'cmd=SETENV kernel_args_tmp mtdram1=0x8695cf00,0x88000000' log=3
+ '[' '!' -z 3 ']'
+ echo 'SETENV kernel_args_tmp mtdram1=0x8695cf00,0x88000000'
+ echo 'SETENV kernel_args_tmp mtdram1=0x8695cf00,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,9)
++ '[' ' ' '!=' - ']'
++ break
++ rc=0
'+ echo '227 Entering Passive Mode (192,168,178,1,12,9)
++ return 0
' line='227 Entering Passive Mode (192,168,178,1,12,9)
+ ec=227
+ '[' x227 == x227 ']'
'+ echo 227 Entering Passive Mode '(192,168,178,1,12,9)
++ 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 + 9 ))'
+ '[' 51 -eq 0 ']'
+ eval 'data_ip=192.168.178.1 data_port=$(( 12 * 256 + 9 ))'
++ data_ip=192.168.178.1
++ data_port=3081
+ data_connection=11445
+ sleep 1
+ nc -w 3 192.168.178.1 3081
+ write_ftp_command 'STOR 0x8695cf00 0x88000000' 7 3
+ local outstream=7 'cmd=STOR 0x8695cf00 0x88000000' log=3
+ '[' '!' -z 3 ']'
+ echo 'STOR 0x8695cf00 0x88000000'
+ echo 'STOR 0x8695cf00 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 7590_06.92-freetz-devel-14583.de_20180117-183813.image.in-memory
++ 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/11445 ']'
+ data_connection=
+ eval 'exec 9>&-'
++ exec
+ rm /tmp/tmp_1516285409_11397/store
+ return 0
+ '[' 0 -eq 0 ']'
+ echo 'Image uploaded to device.'
Image uploaded to device.
+ '[' 0 -ne 0 ']'
+ '[' 5 -ne 0 ']'
+ '[' -d /proc/11409 ']'
+ wait 11409
+ kill 11409
+ eval 'exec 3>&-'
++ exec
+ eval 'exec 8>&-'
++ exec
+ eval 'exec 7>&-'
++ exec
+ rm /tmp/tmp_1516285409_11397/write
+ rm /tmp/tmp_1516285409_11397/read
+ rm -r /tmp/tmp_1516285409_11397
+ exit
Die DSL Synchronisierung hat jetzt beim ersten Mal länger gedauert aber die Box hat verbunden. Freetz ist drauf und es war tatsächlich einfacher als meine weiter oben beschriebene Hardwarelösung für den ssh Zugang
. Vielen Dank für die Unterstützung.
Für die google Sucher die hierher finden nochmal kurz meine Vorgehensweise.
Mein System ist ein Arch Linux.
1. Dort erstmal netcat (nc) in der openbsd-netcat Version installieren.
2. Dann musste ich noch svn installieren, ist bei Arch nicht standardmäßig installiert.
3. Im Terminal als normaler User im home Verzeichnis die freetz-trunk Version herunterladen mit
svn checkout
http://svn.freetz.org/trunk freetz-trunk.
4. In das Verzeichnis freetz-trunk wechseln und mit "make menuconfig" die entsprechenden Einstellungen
vornehmen. Bei mir war dies:
- Level of User Experience - auf Expert geändert (ja, stimmt nicht ganz)
- Hardware Type - 7590
- Firmware language - de
- Firmware Version - 6.9x
- Other patches - Disable tr069
- Packages - Dropbear, mit SFTP Support
- Web Interface - Freetz security level 0
- Additional image/box information - Add freetz Version to AVM Version data
- Firmware packaging - Create in-memory image file
5. Speichern und make ausführen.
6. eva_to_memory von PeterPawns github Seite
(
https://github.com/PeterPawn/YourFritz/blob/master/eva_tools/eva_to_memory) herunterladen
und in das freetz-trunk/images Verzeichnis speichern und die Berechtigung auf ausführbar
setzen.
6. Die LAN Schnittstelle einrichten und manuell die IP 192.168.178.2 (oder eine andere außer
1 und 255 aus dem Subnet) zuweisen. Netzwerkkabel muss natürlich verbunden sein.
7. Ein weiters Terminal öffnen und schonmal den ftp Zugriff vorbereiten mit "ftp 192.168.178.1".
8. Fritzbox vom Stromnetz trennen und wieder verbinden.
9. Einige Sekunden warten, die Fritzboxlichter blinken einmal alle gleichzeitig, eine Sekunde später
im vorbereiteten Terminal mit Enter die ftp Verbindung starten. Sofort sollte das login kommen.
Man muss sich nicht einloggen, der Bootvorgang der Fritzbox ist mit dem login Versuch bereits
unterbrochen.
10. Im vorherigen User-Terminal im freetz-trunk/images Verzeichnis ausführen:
eva_to_memory <imagename>.image.in-memory
11. Das wars, das Image wird auf die Box geschrieben. Die Box startet automatisch neu, einfach
einen Augenblick warten.
//edit stoney: CodeTag gesetzt