Customizing Freetz user interface

Rishi

Neuer User
Mitglied seit
28 Feb 2020
Beiträge
6
Punkte für Reaktionen
0
Punkte
1
Hi, I am trying to update the user interface of my fritxbox 6820 v1, I followed the following steps:
1. Download the freetz source code from https://github.com/Freetz/freetz
2. Made changes in the folder freetz /build/modified (also tried changing freetz/build/original)
3. did make menuconfig
4. make
now I am able to get the * .image file in the images directory, also I am able to flash the router at mtd4, but unfortunately, my changes are not reflected in the default page displayed at http://192.168.178.1/
Default firmware on the router is 7.01, I can make out the upgrade since the version post flashing is changed to 7.13.

Changes I am trying to make:
I changed the image for logo_fritzDiamond.svg (kept the same file name, but different image)

can someone, please help me in case I a doing anything wrong with the flashing or compilation process? Thanks in advance.
 
now I am able to get the * .image file in the images directory, also I am able to flash the router at mtd4,

That can not work. The 6820 is a NAND-Flash model, when the firmware is flashed via EVA, it is loaded into the RAM (a "in-memory.image", not the normal image). mtd4 is one of two TFFS-Partitions.
 
Thanks for the response, now the question is how am I able to see the updated firmware version since the default one I saw was 7:01 (i am not sure what it .01 or .10) but post flashing it through mtd4, I was able to see the new version in my box.
Additionally, I wanted to know if is it possible to change HTML files for http://192.168.178.1/ ?
I am new to this stuff, so apologies for such basic questions, and really appreciate the help.
 
... but post flashing it through mtd4, I was able to see the new version in my box.

Sure? Then you have not (only) flashed the firmware in mtd4. Mtd4 is only 448KiB in size, a firmware image (larger than 20MB) can't fit there.
 
If the occurring errors and their related messages are ignored (even my scripts do not show them in every case on the console and the idea of writing to MTD4 requires - afaik - a "normal" FTP client or one of my scripts, while "push_firmware" on the other hand selects the target partitions itself), any write attempt to MTD4 doesn't matter, as long as MTD3 still contains a valid TFFS image. The content of MTD4 (no matter, whether it's erased or not - it must only not contain a valid image) gets ignored and will be written next time with further changes to the content from MTD3.

The 6820 model uses the same filesystem structure as any VR9 device and installs a new system using "/sbin/flash_update", if it's started from RAM. Even the injection of SIAB is possible, as with all other VR9 devices with a "wrapper" partition.

I would bet, that the observation of a device booting with any freshly installed version after a new image was written to MTD4, was simply wrong.

Rich (BBCode):
vidar:/home/GitHub/YourFritz/toolbox $ ./inspect_image -d /home/FritzBox/FB6820/FRITZ.Box_6820v1_LTE-07.13.image
inspect_image, version 0.8

Copyright (C) 2018-2020 P.Hämmerlein ([email protected])

This script is a part of the YourFritz project from https://github.com/PeterPawn/YourFritz.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License under http://www.gnu.org/licenses/gpl-2.0.html for more details.

--------------------------------------------------------------------------------------------------

Device uses NAND flash for kernel and a wrapper partition for filesystem image.
The wrapper partition uses YAFFS2 format on the device and ext2 format for installation.
SquashFS version used: 4
SquashFS compression used: xz
SquashFS endianess used: big

>>>>> Output of 'extract_version_values' <<<<<
Model="Fritz_Box_HW214"
Product="FRITZ!Box 6820 LTE"
Date="25.11.2019 17:29:18"
Version="142.07.13"
Subversion="-73673"
Buildnumber="73673"
Buildtype="1"
Brandings="avm"
Release="1"
BetaRelease="0"
LaborName=""
DirtyBuild=""
InstallType="mips74_128MB_lte_1geth_wlan11n_01227"
KernelVersion="4.4.60"
LibraryProject="uClibc-ng"
LibraryVersion="1.0.14"
LibraryIdent="uClibc-ng-1.0.14"
BootType="rc.S"
PublicKey1="00a5fa9f15273be3e3b497d5093595ff31cfeab556c9647fe6f8c01bee5cadbf55c4b51c461bab1794927333eb30a2b182a27824adfb1e04f64a35c6b8776ef6dcc410b5af82e78147208528c7932251e8f2ce9d36d0accfcc58b1f32585e02ba98572d67ff44c8b617c33ce77cccd65fcf936b3faae8d5c09eae7604fcba1dc5b"
PublicKey2="00f1af852cea7ea4c4605df4517d02489f6b463b44b4d581aa0896d97aa011e979a8ddf76e57f2e0242f94625d84774ca3dedfb54ea0f9e536bfeedb57f4130119a75e5bcefc3b4bbf13e672212954e138f43d7451a0dd0492248254479d99d946b451af5409f8f30eba2612a862601dab34da199b637a6aa68d32a4af64257c27"
>>>>> ================================== <<<<<

The unpacked filesystem structure may be found at:

/tmp/tmp.wr2Y72i2Wy/12632_inspect_image/fs

The content of the extra YAFFS2 partition may be found at:

/tmp/tmp.wr2Y72i2Wy/12632_inspect_image/wrapper

Please use another terminal session to inspect or backup data from the location above.

If you've done with it and want to continue, the whole working directory

/tmp/tmp.wr2Y72i2Wy/12632_inspect_image

gets deleted - any possibly open file(s) within, will lead to an orphaned directory, which has to be removed manually.

Do you want to continue/exit? Enter 'x' / 'q' (eXit/Quit): q

vidar:/home/GitHub/YourFritz/toolbox $
Rich (BBCode):
vidar:/home/GitHub/YourFritz/toolbox $ ./inspect_image -d /home/FritzBox/FB6820v2/FRITZ.Box_6820v2_LTE-07.13.image
inspect_image, version 0.8

Copyright (C) 2018-2020 P.Hämmerlein ([email protected])

This script is a part of the YourFritz project from https://github.com/PeterPawn/YourFritz.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License under http://www.gnu.org/licenses/gpl-2.0.html for more details.

--------------------------------------------------------------------------------------------------

Device uses NAND flash for kernel and a wrapper partition for filesystem image.
The wrapper partition uses YAFFS2 format on the device and ext2 format for installation.
SquashFS version used: 4
SquashFS compression used: xz
SquashFS endianess used: big

>>>>> Output of 'extract_version_values' <<<<<
Model="Fritz_Box_HW214"
Product="FRITZ!Box 6820 LTE"
Date="25.11.2019 17:30:34"
Version="142.07.13"
Subversion="-73674"
Buildnumber="73674"
Buildtype="1"
Brandings="avme"
Release="1"
BetaRelease="0"
LaborName=""
DirtyBuild=""
InstallType="mips74_128MB_lte_1geth_wlan11n_01227"
KernelVersion="4.4.60"
LibraryProject="uClibc-ng"
LibraryVersion="1.0.14"
LibraryIdent="uClibc-ng-1.0.14"
BootType="rc.S"
PublicKey1="00a5fa9f15273be3e3b497d5093595ff31cfeab556c9647fe6f8c01bee5cadbf55c4b51c461bab1794927333eb30a2b182a27824adfb1e04f64a35c6b8776ef6dcc410b5af82e78147208528c7932251e8f2ce9d36d0accfcc58b1f32585e02ba98572d67ff44c8b617c33ce77cccd65fcf936b3faae8d5c09eae7604fcba1dc5b"
PublicKey2="00f1af852cea7ea4c4605df4517d02489f6b463b44b4d581aa0896d97aa011e979a8ddf76e57f2e0242f94625d84774ca3dedfb54ea0f9e536bfeedb57f4130119a75e5bcefc3b4bbf13e672212954e138f43d7451a0dd0492248254479d99d946b451af5409f8f30eba2612a862601dab34da199b637a6aa68d32a4af64257c27"
>>>>> ================================== <<<<<

The unpacked filesystem structure may be found at:

/tmp/tmp.HOwrK0xAhG/12937_inspect_image/fs

The content of the extra YAFFS2 partition may be found at:

/tmp/tmp.HOwrK0xAhG/12937_inspect_image/wrapper

Please use another terminal session to inspect or backup data from the location above.

If you've done with it and want to continue, the whole working directory

/tmp/tmp.HOwrK0xAhG/12937_inspect_image

gets deleted - any possibly open file(s) within, will lead to an orphaned directory, which has to be removed manually.

Do you want to continue/exit? Enter 'x' / 'q' (eXit/Quit): q

vidar:/home/GitHub/YourFritz/toolbox $
 
Thanks, Peter.
so if I make changes in the user interface in the following folders, will the changes be ignored due to the filesystem? or can I still make changes
freetz /build/modified | freetz/build/original

I also tried using the following command to flash it to the memory

.\EVA-FTP-Client.ps1 -Address 192.168.178.1 -Verbose -Debug -Scriptblock { BootDeviceFromImage 6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory }


Code:
DEBUG: Response:

220 ADAM2 FTP Server ready



================

DEBUG: Sent

USER adam2

================

DEBUG: Response:

331 Password required for adam2



================

DEBUG: Sent

PASS adam2

================

DEBUG: Response:

230 User adam2 successfully logged in



================

DEBUG: Sent

SYST

================

DEBUG: Response:

215 AVM EVA Version 1.2373 0x0 0x640D



================

DEBUG: Sent

GETENV memsize

================

DEBUG: Response:

memsize               0x08000000



200 GETENV command successful



================

DEBUG: Memory size found    : 0x08000000 (128 MB)

DEBUG: Memory size used     : 0x08000000 (128 MB)

DEBUG: Image size found     : 0x016f0500

DEBUG: Set memory size to   : 0x0690fb00

DEBUG: Set MTD RAM device to: 0x8690fb00,0x88000000

DEBUG: Sent

SETENV memsize 0x0690fb00

================

DEBUG: Response:

200 SETENV command successful



================

DEBUG: Sent

SETENV kernel_args_tmp mtdram1=0x8690fb00,0x88000000

================

DEBUG: Response:

200 SETENV command successful



================

DEBUG: Sent

TYPE I

================

DEBUG: Response:

200 Type set to BINARY



================

DEBUG: Sent

MEDIA SDRAM

================

DEBUG: Response:

200 Media set to MEDIA_SDRAM



================

DEBUG: Uploading file '/home/rishi/freetz/images/6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory' to '0x8690fb00 0x88000000' ...

DEBUG: Sent

P@SW

================

DEBUG: Response:

227 Entering Passive Mode (192,168,178,1,12,27)



================

DEBUG: Sent

STOR 0x8690fb00 0x88000000

================

DEBUG: Response:

150 Opening BINARY data connection



================

DEBUG: Response:

226 Transfer complete



================

True

and then I reboot, I still see the old interface, none of my changes were been reflected.
 
There's no need to reboot manually ... the loaded firmware image writes itself to flash memory (after it was started from RAM with the (correct) command from above) and reboots the device afterwards. If you restart the device yourself, the flash process will not get finished.

If you want to make changes to contents of image, you have to use the "fwmod_custom" script, as I wrote in the GitHub issue already.

Sure, it's possible to modify the content of the "original" sub-directory ... but it's tricky, because the whole content is under control of "fakeroot" and if you're making your changes here in a wrong manner, they will not get accommodated into the image.

As I wrote in GitHub, it's much better to script the needed changes in a sub-function of the "fwmod_custom" file and let "fwmod" do its job.
 
  • Like
Reaktionen: Rishi
Thanks, I will be just making changes in the logo or images not something with the modules., I will try with fwmod_custom. Thanks for the support. Is there a way I can reach you out over mail or in Berlin?
 
I tried installing the firmware using 2 options mentioned above
CASE 1.
.\EVA-FTP-Client.ps1 -Address 192.168.178.1 -Verbose -Debug -Scriptblock { BootDeviceFromImage 6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory }
in this case router is rebooted automatically, but once booted, I see the regular log in screen and user home page.

CASE 2.
ftp 192.168.178.1 Name (192.168.178.1:xyz): adam2 Password: adam2 ftp> quote MEDIA FLSH ftp> binary ftp> passive ftp> put /home/rishi/freetz-git/freetz/images/6820_07.13-freetz-master-20200226-30c1ad21b-dirty.en_20200311-153249.image mtd4 227 Entering Passive Mode (192,168,178,1,12,23) 150 Opening BINARY data connection 426 Data connection closed 25127424 bytes sent in 9.44 secs (2.5391 MB/s) ftp> quote REBOOT ftp> exit
in this case, i see led on the router changed to still (non-blinking) and i need to manually reboot the router.
Well, in this casewhen i access the router page at http://192.168.178.1/ I see the login screen, on successfully login i see a message indicating firmware updated successfully.

My problem still stays same related to user interface, but I was a little confused, since I see an update message in case I do it through mtd4 and not though in-memory method.
 
@all:
Hat irgendjemand mit einer 6820v1 mal bitte das Environment dieses Modells (steht ganz am Beginn der Support-Datei) zur Hand?

Ich frage mich ernsthaft, ob die 6820v1 tatsächlich einen komplett anderen Aufbau verwendet, als die Schwestermodelle oder ob der Fragesteller hier nur endloses Schwein hatte, daß seine Box nach dieser Aktion:
https://forum.openwrt.org/t/help-needed-in-flashing-fritzbox-6820-v1/56427 nicht ebenfalls ohne Bootloader-Code im SPI-Flash dasteht, wie es jemand anderem ja mit der 5490 ergangen ist, als er unbedingt versuchen mußte, nach "mtd1" zu schreiben: https://www.ip-phone-forum.de/threads/fritz-5490-eva-bootloader-lost.306099/post-2360339

Hier schreibt er in #9 zwar nach "mtd4" und nicht nach "mtd1", wie in dem Beitrag im OpenWRT-Forum ... aber wenn der Aufbau derselbe ist, wie bei den anderen Modellen (und zumindest nach dem Firmware-Image ist das ebenfalls ein Modell, was den "ext2"-Wrapper (bzw. YAFFS2 im laufenden System im Flash) um die "filesystem_core.squashfs" verwendet, wie die anderen Modelle), ist das die zweite TFFS-Partition und die kann eigentlich kaum eine Größe von 25 MB haben.

Damit stellt sich schon die Frage, WOHIN der FTP-Server wohl die Daten, die er lt. dem oben stehenden FTP-Protokoll empfangen haben SOLLTE, am Ende geschrieben hat. Ich könnte mir höchstens noch vorstellen, daß die Box - ähnlich wie die 7412 - gar keinen SPI-Flash hat (dann ist "mtdnand" vermutlich die (emulierte) TFFS-Partition) und "mtd4" irgendwo in die Wüste zeigt im Bootloader-Environment. Wobei das, nach dem "sent" zu urteilen, ja auch nur die Ansicht des FTP-Clients ist - der Server müßte hier ja "received" sagen ... das ist also eigentlich auch noch kein "Beweis", daß diese kompletten 25 MB ihr Ziel gefunden haben und auch tatsächlich in irgendeiner Flash-Partition landeten.

Ich wäre jedenfalls schon sehr verblüfft, wenn dieses Modell tatsächlich durch Schreiben nach "mtd4" im Bootloader aktualisiert werden kann ... und vermutlich nicht nur ich alleine (denn das wäre m.W. ein "Alleinstellungsmerkmal"). Ehe ich mich jetzt aber aufs Glatteis begebe und dem Fragesteller (der einfach nicht davon abzubringen ist, DASS er irgendetwas falsch macht, wenn das erwartete Ergebnis nicht eintritt) noch einmal versuche zu erklären, WAS er da falsch macht, wenn er versucht, nach "mtd4" zu schreiben, würde ich gerne noch mal (quasi an seiner Stelle, denn ihn ficht das offenbar nicht weiter an) ein paar Basis-Infos zur 6820v1 sammeln - vielleicht betreibt ja sogar jemand eine Freetz-Installation auf diesem Modell? Die Frage, ob die von ihm postulierten Änderungen auch tatsächlich den Weg in das Image gefunden haben, was er in "Case 1" installieren läßt, ist ja auch immer noch nicht wirklich geklärt ... er besteht trotzdem darauf, daß nur noch der Flash-Vorgang der Knackpunkt sein könne.

Das von ihm beobachtete "i see a message indicating firmware updated successfully" ist für mich im Moment nur ein Zeichen dafür, daß - nachdem er die zweite und wohl aktuellere TFFS-Kopie in "mtd4" erfolgreich zerstört hat - die Box danach wieder mit den älteren Einstellungen aus "mtd3" startet und dabei dann feststellt, daß die laufende Version neuer ist, als diejenige, welche die vorhandenen Einstellungen gespeichert hat ... die "natürliche Schlußfolgerung" ist dann wohl: "Es muß ein Update gegeben haben." - was jetzt wohl dazu führt, daß man ihn nun erst recht nur mit sehr, sehr viel Überzeugungsarbeit davon abbringen kann, daß seine Installation wohl doch nicht geklappt hat.

Nur will ich eben vorher sicher sein, wenn (bzw. inzwischen eher "falls") ich es erneut versuche, daß der Aufbau der 6820v1 auch der von mir erwartete und auch der in Freetz angenommene ist - eine Bestätigung der erfolgreichen (Erst-)Installation eines Freetz-Images über EVA (und zwar durch Laden ins RAM und nicht durch Schreiben in irgendeine MTD-Partition ... wenn das funktionieren würde, warum verwendet AVM das dann nicht selbst, sondern setzt auf den Mechanismus der "Auto-Installation", wie bei den anderen VR9-Boxen?) wäre da schon hilfreich ... auch wenn ich kaum glauben kann, daß die 6820v1-Unterstützung in Freetz es ohne eine solche Bestätigung geschafft hätte, den Status "EXPERIMENTAL" abzulegen.

Wobei sämtliche Quellen, die ich gefunden habe, nur erschreckend wenige Infos zur Hardware der 6820v1 bereithalten ... ich konnte nicht mal eine (belastbare) Quelle finden, ob die 6820v1 nun SPI-Flash fürs TFFS und den Loader verwendet oder doch ausschließlich den NAND-Flash (128 MB gesamt), wie 7412 und 7430 (wo das "TFFS im NAND" ja wohl auch eher nur Einzug hielt, weil es bei den GRX-Boxen ohnehin entwickelt wurde von AVM).

EDIT: OK, eine Quelle habe ich dann doch noch gefunden, daß die 6820v1 "ganz normal" wie die meisten anderen VR9-Boxen auch 1 MB SPI-Flash enthält - damit würde ich einiges darauf wetten, daß da "mtd3" und "mtd4" - genauso wie bei den anderen Modellen auch - nur die TFFS-Partitionen sind und es stellt sich mir eher die Frage, wie der FTP-Client da auf die Idee kommt, daß in weniger als 1 MB SPI-Flash (denn "mtd4" ist ja auch nur ein Teil davon) am Ende 25 MB Daten passen könnten.
 
This is a new post, because the prior one was (by intention) in German only - pull them together at your option, if you think, it would be necessary, to consider the rules.

CASE 1.
.\EVA-FTP-Client.ps1 -Address 192.168.178.1 -Verbose -Debug -Scriptblock { BootDeviceFromImage 6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory }
@Rishi:
You're kidding with me, aren't you?

It lasted until 3rd of March (or maybe even later), to convince you the proper way to modify a firmware image: https://github.com/Freetz/freetz/issues/270#issuecomment-593970796

And today you're installing an image, that was created on 28th of February, according to its filename: 6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory - this name contains date/time of image creation (https://github.com/Freetz/freetz/blob/master/fwmod#L1468).

Why the hell are you expecting now, that this image contains a - properly exchanged - own picture anywhere? My plea to you: Try to work (much) more accurate ... it saves your (and our) time.

You've got the info already (above), that write attempts for "mtd4" are wrong ... but you don't hesitate, to try such one again?

Why do you ask here, if you're not willing to take the given answers into account?

It seems more and more a waste of time here.
 
Hi Peter,
the line
.\EVA-FTP-Client.ps1 -Address 192.168.178.1 -Verbose -Debug -Scriptblock { BootDeviceFromImage 6820_07.13-freetz-unknown.de_20200228-184334.image.in-memory }
was copied from above post just for an example since i had multiple prompts open, so this was quicker way to explain the scenario. Besides i was just seeking some knowledge and not such kind of response, however thanks for the efforts in replying.
 
Good luck while seeking ... how should an answer read to satisfy your expectations? Has it to contain a confirmation for your (wrong) assumptions and taken steps?

My plea to work more accurate is the same, no matter whether you've copied something from somewhere or not. It's the result, that counts (re-check #9) and the wrong filename isn't the only mistake, according to your post (and its predecessors).

If you do not get the expected answer, you're ignoring it (no regards, whether it's correct and valid - and this doesn't only mean my own posts, because I've started to answer late here in the IPPF ... GitHub was earlier, iirc) - but it's your own decision and I wish you (really) good luck, while looking for a more convenient answer.

I can't see an attempt to get additional knowledge anymore ... it looks like you're awaiting a confirmation only. But your assumptions are (mainly) wrong - how could anyone confirm then?
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.