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

How to adding some extra files into Tomato /lib ?

Discussion in 'Tomato Firmware' started by jenom, Jul 2, 2013.

  1. jenom

    jenom Networkin' Nut Member

    I want to run a small program (250 KB) and it needs 1 library file to run.
    I would like to know, if it is possible in any version (or modified version) of Tomato:
    --to copy this needed library file into /lib ?
    Basically, is the main file system locked, only readable ?
    If I copy my lib file into a writable jffs2 filesystem, is there any way to create a link or modify some setting or run some-kind-of script, so my program could find it ? (it is looking for it in /lib or /usr/lib)

    Thanks !
  2. koitsu

    koitsu Network Guru Member

    No, you don't need to do this.

    The ld search path will by default look in . (current working directory) for libraries. You should be able to put your library and program/executable in the same directory together and have it work.

    Please provide more details/show full output/examples/etc. if you run into problems, as there are way to work around this as well.

    TL;DR -- You do not need to drop something into /lib or /usr/lib. If the program is explicitly looking for something in that fully-qualified path, then the author of the program is doing it wrong. Provide the source to the program and I might be able to tell you what's going on.
  3. jenom

    jenom Networkin' Nut Member

    Thank you for your reply!
    The source of this program is not available, it a semi-public/semi-private program, which means only program shared with public, not the source.
    Meanwhile I have gone brave, and installed dd-wrt-v24-mini-generic.bin , then installed Tomato-Nd-1.28.8754-Std.bin.......I do not have USB (WRT54G v3)
    All worked good--enabled SSH , then enabled and formatted JFFS in menu--960 Kb
    Used WinScp and transferred all my files, including the lib file into /root, which is linked to /home/root.
    Changed permissions and run program.....and to my big surprise it started and worked fine! :)
    Now to make program autorun, I have a small xxx.sh script, which supposed to be executed at startup in a folder such /etc/init.d and enabled to run in /etc/common.....however, I do not see neither of those folders in Tomato ?
    Any suggestion, where to place it so it will get executed at startup along with the other services ?
  4. jenom

    jenom Networkin' Nut Member

    Gone through all the file system folders and still can not find anywhere where system services starting.
    I have a sense that I am not able to see everything .(?)

    Next I searched through the WEB GUI sections, and went to ADMINISTRATION......SCRIPTS.......INIT and entered /jffs/myprogram's_name and SAVE after and REBOOT
    Program is running now, but I am sure, that there is another (better) way to do it !

    I consider myself very lucky, because when I checked JFFS size: Total 960 kb / Free 64 kb.....just made it !!!!
    Is there any way to make jffs bigger than 960 Kb ?
  5. jerrm

    jerrm Network Guru Member

    GUI Init script section is probably the best place. Tomato does not use init.d. There is an autorun script facility for Tomato - see here, but I generally prefer to have things where I can see them.

    Only way to increase jffs is to find a smaller build, or get a new router with larger flash.
  6. Monk E. Boy

    Monk E. Boy Network Guru Member

    Yeah, you can go with a mini or micro build instead of a standard build, but obviously it all depends on what features you require. Lots of things get removed from the smaller builds, but if you can live without them, then you can get more flash space.
  7. jenom

    jenom Networkin' Nut Member

    --so I am going to stay with GUI 's ADMIN-SCRIPTS-INIT or maybe put all my files into /jffs/etc/config and only make the main program file executable
    --using a Tomato-K24-ND-1.28.8765-Std file....this was the smallest build I found 2804 kb, and it gives me 960 kb usable free jffs space :)
    --tried also VICTEC's RAF 1.28-121006, it is little bit smaller 2773 kb, GUI looks very nice, but it creates only a 636 kb jffs filesystem and even after formatting it, only 324 kb available .......something seriously gone wrong there

    Is there any smaller sized , non USB build Tomato version ?
  8. mstombs

    mstombs Network Guru Member

    Another option slightly below building your own firmware is to mod the actual filesystem - the squashfs-lzma has great compression, this tool used to work,


    but I haven't used it for a while...
  9. Monk E. Boy

    Monk E. Boy Network Guru Member

    The latest Toastman build for ND devices is 7634 (at least for a 2.4 kernel), and he has Mini, Micro, etc. builds available. I don't know who made 8765 but it's far from your only option.

Share This Page