commit 870169864e0973aa0e2f72ee36d3048657ec3b7f Author: mrtuxa Date: Thu Nov 24 01:46:12 2022 +0100 Init diff --git a/README.md b/README.md new file mode 100644 index 0000000..69ea06f --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# Fritz!Repeater 1200 flashen + +Am einfachsten ist das Flashen von diesem Gerät mit den bereitgestellten Tools vom Github Repository von mrtuxa [**Link**](https://github.com/mrtuxa/ffl-firmware-flash/releases/tag/final) + +*Die meisten Teile dieser Anleitung beziehen sich auf Linux (Ubuntu/Debian)* + + + +## Benötigte Dateien + + ### Tools + +- Die Tools sind unte diesem Link zu finden: https://github.com/mrtuxa/ffl-firmware-flash/releases/tag/final + +- Hinweis: *Nur die Tools.zip Datei downloaden* + + + + ### Firmware + + - Aktuell ist es empfehlenswert das Nightly Build zu verwenden (Die Stable Version hat keine Auto Updates) + - http://download.freifunk-dresden.de/firmware/.nightly/firmware/ipq40xx.generic.fritz-tffs-nand/openwrt-ipq40xx-generic-avm_fritzrepeater-1200-squashfs-sysupgrade.bin + + + +1. Benötigte Tools in ein beliebiges Verzeichnis entpacken + +2. Installieren eines FTP Server + + + +​ `sudo apt install tftpd-hpa` + +4. Kopiere die FRITZ1200.bin in den TFTP-Root Ordner (standartmäßig `/srv/tftp`) + + `cp FRITZ1200.bin /srv/tftp` + +5. Konfiguriere die IP-Adressen `192.168.178.10/24` und `192.168.1.70/24` + + (`enp2s0` durch den Namen des entsprechenden Netzwerkinterfaces ersetzen) + + `ip a a 192.168.178.10/24 dev enp2s0 && ip a a 192.168.1.70/24 enp2s0` + +6. Verbinde den PC mit dem Router und schalte ihn ein + +7. Warte bis ein Link auf dem Netzwerkinterface erkannt wird + +8. Starte U-Boot auf dem Router (Dieser Schritt kann mehrere Versuche beanspruchen sollte dieser Schritt nicht beim ersten mal funktionieren, bitte das Gerät neustarten und den Command erneut ausführen) + + `./eva_ramboot.py --offset 0x85000000 192.168.178.1 /path/to/directory/uboot-fritz1200.bin` + +9. Nach einigen Minuten sollter der Router per SSH auf 192.168.178.1 erreichbar sein + +10. Logge dich per SSH auf dem Router ein + + `ssh root@192.168.1.1` + +11. Kopiere die uboot-fritz1200.bin auf den Router + +​ `scp /path/to/directory/uboot-fritz1200.bin root@192.168.1.1:/tmp` + + + +12. Kopiere das Sysupgrade-Firmware Image auf den Router + +​ `scp /path/to/directory/openwrt-ipq40xx-generic-avm_fritzrepeater-1200-squashfs-sysupgrade.bin root@192.168.1.1:/tmp` + +13. Installiere U-Boot mit folgendem Command in der SSH-Sitzung + + `mtd write /tmp/uboot-fritz1200.bin uboot0 && mtd write /tmp/uboot-fritz1200.bin uboot1` + +14. Lösche das alte Betriebssystem mit dem folgendem Command in der SSH-Sitzung + +​ `ubirmvol /dev/ubi0 --name=avm_filesys_0 && ubirmvol /dev/ubi0 --name=avm_filesys_1` + + + +15. Installiere die Firmware mit folgendem Command in der SSH-Sitzung + +​ `sysupgrade -n /tmp/openwrt-ipq40xx-generic-avm_fritzrepeater-1200-squashfs-sysupgrade.bin` + +Quelle: Freifunk Stuttgart Wiki diff --git a/Tools/FRITZ1200.bin b/Tools/FRITZ1200.bin new file mode 100644 index 0000000..981ff96 Binary files /dev/null and b/Tools/FRITZ1200.bin differ diff --git a/Tools/eva_ramboot.py b/Tools/eva_ramboot.py new file mode 100755 index 0000000..b182f09 --- /dev/null +++ b/Tools/eva_ramboot.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 + +import argparse + +from ftplib import FTP +from sys import argv +from os import stat + +parser = argparse.ArgumentParser(description='Tool to boot AVM EVA ramdisk images.') +parser.add_argument('ip', type=str, help='IP-address to transfer the image to') +parser.add_argument('image', type=str, help='Location of the ramdisk image') +parser.add_argument('--offset', type=lambda x: int(x,0), help='Offset to load the image to in hex format with leading 0x. Only needed for non-lantiq devices.') +args = parser.parse_args() + +size = stat(args.image).st_size +# arbitrary size limit, to prevent the address calculations from overflows etc. +assert size < 0x2000000 + +if args.offset: + addr = size + haddr = args.offset +else: + # We need to align the address. + # A page boundary seems to be sufficient on 7362sl and 7412 + addr = ((0x8000000 - size) & ~0xfff) + haddr = 0x80000000 + addr + +img = open(args.image, "rb") +ftp = FTP(args.ip, 'adam2', 'adam2') + +def adam(cmd): + print("> %s"%(cmd)) + resp = ftp.sendcmd(cmd) + print("< %s"%(resp)) + assert resp[0:3] == "200" + +ftp.set_pasv(True) +# The following parameters allow booting the avm recovery system with this +# script. +adam('SETENV memsize 0x%08x'%(addr)) +adam('SETENV kernel_args_tmp mtdram1=0x%08x,0x88000000'%(haddr)) +adam('MEDIA SDRAM') +ftp.storbinary('STOR 0x%08x 0x88000000'%(haddr), img) +img.close() +ftp.close() diff --git a/Tools/uboot-fritz1200.bin b/Tools/uboot-fritz1200.bin new file mode 100644 index 0000000..00aff67 Binary files /dev/null and b/Tools/uboot-fritz1200.bin differ