1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Several question about building & editing Tomato source

Discussion in 'Tomato Firmware' started by Moc, Mar 18, 2012.

  1. Moc

    Moc Networkin' Nut Member

    Hi,

    First I want to thanks all the other developer who work on tomato over the years that improved this great router firmware !

    I've finally decided to get into development for firmware I install at my client site. I want to do several changes and trying to find the correct work flow to actually do them.

    I got my first build of Toastman firmware working great to include Tiny + SNMP so it fit on old RT-N12.

    Now I want to go deeper and actually change the code. My problem I've notice is I couldn't find how to rebuild a specific code portion and just repackage a binary. For example I want to change the default settings in nvram.c, but I don't want to spend 30min to rebuild the whole tree. I've tried to re-execute the same make command I did in the first place, but that seem to rebuild pretty much everything. After looking at the Makefile, doing "make all" seem to do the trick, but all the new feature that was added didn't use the tomato_profile.mak function to save the different variable like MIPS2, V1, V2, and all the other custom flag. So is there a logical way I didn't see or I should patch it to move all the variable into the tomato_profile.mak and go from there ?

    I'm also worried about firmware size. RT-N Std toastman doesn't seem to fit on a RT-N12 4MB anymore... So I'm trying to find way to lower the footprint. Space seem to be split in 3 section including my ideas :
    • Wireless Driver(3mb)
      • Now removing the Wireless Driver is a definite possibility for me... I was thinking to maybe make the wireless network disabled on startup, and once internet connectivity is on, Download the module off my web server and load it from ramdrive...
    • System Library(4mb)
    • Web Management (1.5mb)
      • I see there script that run to remove comments already from the source, but there is alot lot of javascript code in there that are not in 'compress' format. Since it text file already, not sure how much it would save after compression, but I wonder if someone else tried to auto 'compress' the javascript code and if it help ?
      • Normally, browser support direct GZIP compress file loading, so would making css or javascript only page on gzip better than the compression of the firmware ?
      • There is also a few images included... Could probably removed.
    I have also noticed something... I know that once your login to the web management you already have full admin access... But is it normal that I can do this : http://192.168.1.1/whatever;ls;reboot;whatever.sh? And it will execute ls and reboot ?

    Here is a few items on my development ToDo list :
    • Add option to change the wan icmp ping restriction (max packet per seconds hardcoded in firewall.c)
    • Custom SNMP server port (ISP seem to block the defaultl one :/)
    • Add a SpeedTest tool
    • Internal dns have entry for a special domain name that point to it local ip myrouter.com = 192.168.1.1 for example
    • Add an option to recover/reset a lost password (Not sure yet how to implement this safely...)
    • Automaticly remotely provision configuration... For example, I want it to detect if it PPPoE or DHCP server connection... If it PPPoE login using an internal user/pass that will give basic access to a web server where it can get it real PPPoE info (This is more of a Private changes that wont be useful for most)
    • Changing the toastman default settings to fit my needs ;)
    • Add an pptp server configuration frontend
    Also any pointers on how I should proceed to contribute back patches... I would be using the Toastman branch to work on them.

    Thanks alot in advance for feedback, or maybe point to a better location where I should post my question ;)

    Moc
     
  2. mstombs

    mstombs Network Guru Member

    Many questions - one answer the filesystem is highly compressed readonly squashfs-lzma I don't expect compressing the web files will reduce the size.
     

Share This Page