Giter VIP home page Giter VIP logo

modfs's Introduction

modfs - improve AVM's original firmware with some small tweaks

The prefered way to get the content of this project is to clone the repository, if you don't want to download it directly to a FRITZ!Box device (with a VR9 chipset - other models can't use it to modify the firmware of the device, where "modfs" is running on).

If you want to download it to your router device, use the ZIP file (on the fly created by GitHub) from:

https://codeload.github.com/PeterPawn/modfs/zip/refs/heads/master

for a "released version" or

https://codeload.github.com/PeterPawn/modfs/zip/refs/heads/beta

for the "beta" branch.

Pay attention to the different directory names, after you've extracted the files from ZIP archive(s). The release version contains a base-directory called modfs-master, while the beta archive starts with modfs-beta in its upmost level.

If you're using an original firmware version by AVM, the provided BusyBox binary usually doesn't support HTTPS URLs for its wget applet. Instead AVM uses an own utility httpsdl, which tends to be unable to follow redirections from HTTP protocol (at least in some versions and/or with some URLs). That's why the URLs from above are from the last redirected to, if the journey has been started by Download ZIP from GitHub page.

So it shouldn't be needed anymore to load the gzip-compressed TAR archive from www.yourfritz.de - but it's (mostly) still available there (from the URL http[s]://yourfritz.de/modfs.tgz), with and without TLS-protected access.

Example(s) to download/unpack it from FRITZ!OS:

# cd /var
# httpsdl -O master.zip https://codeload.github.com/PeterPawn/modfs/zip/refs/heads/master
ok
# unzip -q master.zip
# find modfs-master/ | wc -l
182
#

or

# cd /var
# httpsdl -O - https://codeload.github.com/PeterPawn/modfs/zip/refs/heads/master | unzip -q -
ok
# find modfs-master/ | wc -l
182
#

without a permanently stored download file, to save some space from your tmpfs storage.

Please keep in mind, that you have to use a filesystem, which handles Unix/Linux access control rights correctly, to unpack and/or store the provided files. Do not use an USB storage volume with FAT or NTFS format here.

If you need any older version, please use the VCS provided by GitHub to checkout any previous version. There's no older version provided to be downloaded from yourfritz.de.

Most of this project and the provided modification scripts (called modscripts for short) is documented in a (meanwhile really large) thread in a Bulletin Board System called "IP-Phone-Forum", a (mostly german) board with discussions around Voice over IP and devices from german router manufacturer AVM. But other router manufacturers, open-source software and internet access providers from Germany (and other german-speaking countries in Europe) are discussed there.

The main thread for this project may be found here: https://www.ip-phone-forum.de/threads/modfs-squashfs-image-avm-firmware-%C3%A4ndern-f%C3%BCr-nand-basierte-fritz-boxen.273304/post-2037875 - try to read the first post in the beginning (use an online-translator to read it in your own language) and further posts linked to from this first post. To collect info for latest changes, start at the last post and try to read at least 5 pages (100 posts) - it's your decision, whether you prefer to read top-down (start at end - 100) or bottom-up (don't stop, before you've reached 5 previous pages or the first 3 or 4 month old posts).

There's an attempt to collect scattered info from the thread mentioned above in another thread: https://www.ip-phone-forum.de/threads/how-to-modfs-die-gebrauchsanleitung.284778/ (it's linked from the thread above, too, in the first ppost) - if your German is good enough (or your online translation tool), you may see it as another approach to explain things or to find links to important info in the long, long thread mentioned above.

modfs's People

Contributors

peterpawn avatar thechatty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modfs's Issues

reduce dependencies on external commands

use the applets of the provided static Busybox binary as often as possible and call them with absolute path references to minimize the chances to call a wrong command/applet

Does this work with 6.52

Hi is there a way to get this to working with firmware version 6.52?

It appears they are checking for signatures, I would really like to get telnet access to a fritzbox 7490.

Applying for a 7590 device

Hello Peter,
I started to look into enabling the SSH access for this router and I almost instantly came across your posts.
They are very helpful and full of information, especially this page (I don't speak German so I used google translate)!
However, I'm not able to understand how to apply this project upon an existing, out-of-the-box 7590, with OS 7.21, firmware 154.07.21, maybe just for the language problem :)
Since it's my only router, it would be unfortunate if I wasn't able to recover it, so I am quite scared into applying firmware modifications.
I've already tried the "# 96 * 7 *" method, and it's not working (although the "# 96 * 8 *" responds).
I am not a computer novice, and I am confident into kernel compilation and similar stuff, but the "embedded" part of it (so bootloader, image into RAM through EVA, ...) is not crystal clear for me. Also, some commands are updated, I can pack a step-by-step English instruction for newcomers like me.

I tried to upload the modfs.tgz image to the "file FRITZ!OS" but it didn't work, the system gave me with "incorrect file" and then rebooted with factory settings.
Do I have to build a YourFritz kernel image and flash it?
It doesn't seem so in the aforementioned post, but I don't get the section about the "switch system", and the "bootloader not working after a soft reset".

However, I had a peek at eva_switch_system (which uses eva_discover) but the system is not able to find the FritzBox, maybe because you need to power-cycle the device in the meanwhile? But it doesn't seem to work either.
By hard-wiring the IP address in the variable EVA_IP, the function eva_switch_interface is able to connect, but it fails since the "SYST" command returns "UNIX Type: L8 Version: Linux 4.9.198", and the script is complaining that it should be "AVM whatever".
I use Ubuntu 18.04 in WSL (version 1), I don't know if it may be the source of the problem.

Maybe this issue does not belong here and is more suited to YourFritz, but since I "only" want to enable Telnet, I tought this repository is the most minimal configuration.

I can provide more information if those are helpful, I put everything that seemed relevant.
Can you help me out?
Thank you!

start sshd script?

I just wonder why there is a script to start the telnet daemon but non to install and start a sshd.

What is the problem?

provide a modscript to ensure proper deinitialization

... of mounted volumes, even for filesystem images mounted via loop device from an USB volume and swap space from USB devices, while the USB subsystem is to be stopped

  • this should avoid a "hanging system", if the USB host is stopped while important parts of the system are swapped out - in this moment it leads to a "read error" condition from the unavailable swap space
  • the obvious way to ensure this, is a modification of post_install in the var.tar file

modfs update <firmware.image> <modded firmware.image> does not work as expected

Peter, I completely understand that modfs is "as-is" and all the many code-paths are neither necessarily documented or tested, but in case it is of interest to you, I want to report that the code-path used by the above command does not create a new firmware-image as expected, rather (after checking modfs-code in the path activated by create_image_only) just creates an image of the root-filesystem. The reason I used this command was that I wanted to create a modded firmware-image and then practice uploading it with eva_to_memory - after having to revert too often to 6.51 and work my way back to 6.80:-(

Regards, Martin

add openssl binary to the project

It's needed to download files directly from GitHub repositories (e.g. an automatic update check) and to implement signature verification in "AVM manner".

provide a more general "customization" modscript

  • embed an init script to mount a SquashFS image from the /wrapper directory
  • this image may contain all files needed for additional services
  • a new init script in /etc/init.d enumerates all additional startup script files in a special directory from the newly mounted structure, these scripts will be called to prepare the environment for "their services" and to start the required daemons
  • in the first step, there will be no user interface to create such a "custom image", it's solely user's own task to build it with the expected content for his own purposes/modifications

configuration file editor (browser-based)

  • provide a new expert page with a "textarea" box as universal editor
  • may be used e.g. for editing to vpn.cfg file or any other file, as long as no encoded value is changed
  • contemplate to integrate decoding of credentials

error message when putting modified firmware on fritz.box

Peter: I am sorry but I was unable to find a good description on how to put shellInABox onto my fritz.box 7490 (with firmware 6.50). So I choose a description I found in a German website and ended up with a message that I did not understand. Googling the message gave me exactly one match that does not tell me anything, now I am stuck. Can you help me (a link how to proceed would be fine).

I managed to get onto fritz.box:8010 and I can login into my fritzbox. I downloaded modfs-0.4.5.tgz onto /var/mod (joint with some other files like "README.outdated", is that a problem?) and I tried to run
gunzip -c modfs-0.4.5.tgz | tar x;./modfs
from the commandline. The output was

Ermitteln der Hardware-Version ... OK
Prüfen, ob die Hardware-Version unterstützt wird ... OK
Suchen der Einstellung zur Umschaltung auf das alternative System ... OK
Prüfen der aktuell zu startenden Systemversion ... OK
Suchen der aktuellen Kernel-Partition ... OK
Suchen der alternativen Kernel-Partition ... OK
Vergleich der Systeme in den Kernel-Partitionen ... Fehler
Die Flash-Partitionen in der Box enthalten unterschiedliche Versionen der Firmware.
Soll das laufende System in die inaktiven Partitionen kopiert werden? (j/N) N

and since I had no idea whether the last question is a problem I answered with No. How can I proceed from here? Thanks!

return to a more modular design

  • divide the large script into smaller parts again
  • it's not possible anymore to test each change in such a monolithic design
  • use yourfritz_helpers wherever possible
  • use a litte text-based file to store/exchange settings between the different parts, this file may also be kept to provide pre-selected settings for future calls of "modfs"

Enhancement request: Simplify adding files to root and wrapper

While I have been able to make the changes I needed to my FB 7490 with modfs I had a couple of extra iterations because changes I wanted to make to the root and wrapper fs were not included in one of the two filesystems - because of my own carelessness in updating the binaries archive or copying to a rw-remounted wrapper. So I suggest:

  • Let modscript copy_binaries copy a correspondingly named directory rather than insisting on an archive. See attached diff.

  • Let modfs also copy to wrapper. I saw that you there are some hooks (ADD_TO_WRAPPER) to do this - which I build on for a q-n-d solution (see diff) but I am sure you could make it more robust and versatile.

Regards, Martin

EDIT: I am deeply ashamed that I initially attached a patchbefore final testing - but now it should be OK ...
git.diff.2.gz

telnetd on 7390 @ 6.83

Hey Peter,
I am looking around since weeks to find the right way to reach my goal. I am not sure what the right way is to have a telnetd acess to my 7390 FB from AVM.
I was looking through the IP forum which gave me not a clear picture of what the right way is to go.
my assumption by now is:

  1. place any file (modfs, ..) to the usb drive of my FB
  2. place the FW 6.83 to the usb drive
  3. modify this firmware
  4. sign this firmware
  5. upload this firmware to the device.

(by the way: i would have this RuKernelTool) if this would help me in reaching my goal.

it would be great if you might show me the right way to go here.

many thanks in advance.

Best
Alex

wrong free space values requested for "update" mode

the requested 32 MB of free space to unpack an image for "update" mode aren't enough, because in "extract_rootfs_from_wrapper" the room for one kernel image (up to 4 MB) and two times the space for the filesystem image could be used for a short time (during the cut-off for the dummy header using "dd" command)

check source image signature

check signature of downloaded or specified source images to prevent malicious changes in images from other sources

modfs not using existing core-image, environment of rc.custom not found

In my first trials with modfs I found two easy-to-fix problems:

  • modfs systematically rejects an existing core-image in check_squashfs_file_version - because /etc/rc.conf is not extracted as needed by get_system_version.

  • mod_custom_images chops off a .custom suffix when creating the enviromnment-file - which contradicts the way it is searched for in rc.template.

The attached diff (created with git after cloneing your repository) fixes these glitches for me, consider integrating them - and keep up the great work!

Regards, Martin

git.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.