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

install programs in tomato

Discussion in 'Tomato Firmware' started by mars, May 7, 2009.

  1. mars

    mars Addicted to LI Member

    Hi all,

    I've used openwrt in the past for it's extensibility options (ipkg mainly) but ended up with tomato because of the stability and because it looked much better and robust. And, because I use an Asus WL500G had to give up the USB ports - until now, that I found out the ND USB mod. It's now installed and fully working.

    My question is, can I install other programs in tomato (through SSH) ? And if I can, how ? I've tried to install enhanced-ctorrent: can't compile because there's no compilers available, and after finding a compiled copy of ctorrent (through openwrt .ipk files) I can't install the required libraries for it to function.

    So, is my only option making a custom mod of tomato/NDUSB mod ? Or can I easily install stuff like this ?

    Thank you in advance !
     
  2. mstombs

    mstombs Network Guru Member

    Openwrt (and dd-wrt)t brcm-2.4 uses a subtly different Linux kernel to Tomato so not all OpenWRT executables will run on Tomato even if the correct writable links and ipkg utility provided.
     
  3. mars

    mars Addicted to LI Member

    assuming i could compile the programs in a kernel similar to tomato's (2.4.20 i believe), how do I solve the libraries issue ? is that possible to solve ?

    thanks
     
  4. janosik47

    janosik47 Addicted to LI Member

    If you have installed a mod Tomato with USB support then as my understanding is you can put an memory stick to it and mount it - right?
    I am assuming the ND USB mod gives you ability to run a script once a USB device is connected so you could use that to bind the stick storage into the WRT's file system e.g.

    mount -o bind /tmp/mnt/disc0_1/opt /opt

    Ensure you replace the /tmp/mnt/disc0_1/opt with correct folder.
    If there is not possible to run a USB 'auto script' you can try to enable jffs and put there the small script.
    The above just mounts a folder on the USB stick as the /opt on the WRT. Once you have it you should be able to put ipkg stuff into /opt e.g.

    wget http://www.wlan-sat.com/boleo/optware/optware-install-oleg.sh -O - | tr -d '\r' > /tmp/optware-install-oleg.sh
    sh /tmp/optware-install-oleg.sh
    export PATH=/opt/bin:/opt/sbin:$PATH
    unset LD_LIBRARY_PATH

    Once you have ipkg on you USB memory stick (/opt) update the ipkg stuff:

    ipkg update

    So from now on you can list and install an ipkg packages

    ipkg list
    ipkg install <package_name>

    Not sure if the above description is 100% correct -just done it a quite long time ago ...
     
  5. mars

    mars Addicted to LI Member

    that worked perfectly ! I wrote the instructions directly through SSH and I have everything running :)

    thank you very much janosik47 (y)
     
  6. janosik47

    janosik47 Addicted to LI Member

    good to hear that !
    I think you may want to do a bit more in your init script e.g.

    if [ -d /tmp/mnt/disc0_1/opt ] && [ `/bin/mount | grep /dev/discs/disc0/part1 | grep /opt | wc -l` == 0 ]; then
    mount -o bind /tmp/mnt/disc0_1/opt /opt
    fi

    unset LD_LIBRARY_PATH
    unset LD_PRELOAD

    [ -e /opt/etc/profile ] && mount -o bind /opt/etc/profile /etc/profile

    if [ -d /opt/etc/init.d ]; then
    for f in /opt/etc/init.d/S* ; do
    [ -x $f ] && $f start
    done
    fi

    and create the /opt/etc/profile file with the following content:

    export PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin

    That should bind your /opt directory once the USB is connected, mount the /etc/profile file (executed once root log in) and finally auto start all the opt init.d stuff - that at least works fine for me ;)
     
  7. SoftCoder

    SoftCoder Addicted to LI Member

    Any idea why Tomato uses the 2.4 kernel and not 2.6? My DLink NAS (DNS323) runs almost the same software (busybox etc.) but runs on a 2.6 kernel. I am finding numerous problems trying to write apps to expand on tomato mainly due to the fact that the kernel had numerous problems and backports are lacking in various areas. For example the CIFS client is limited because of a lack of features in the 2.4 kernel which causes problems writing sqlite appslicatiosn because of huge changes to locking files in the kernel. Would it be possible for me to plugin the 2.6 kernel and recompile tomato? (something tells me it would have already been done if it were that easy)

    Thanks
     
  8. mstombs

    mstombs Network Guru Member

    Its all down to the hardware specific Broadcom drivers, generally distributed as binary only. Steady progress is being made on opensource versions of the b43 and b43legacy drivers, but there are still issues unlocking the hardware features of the chipset I understand. Should be easier to move Tomato from Linux 2.4.20 to the same version kernel Linux 2.4.35 used by dd-wrt and OpenWRT on this platform - but even that is a huge task.
     
  9. mars

    mars Addicted to LI Member

    @janosik47: the first time I run those command, everything went perfectly, but now it's giving me these errors:

    Code:
    Checking system config ...
    Using XXX.XXX.XXX.XXX as default gateway.
    Using the following nameserver(s):
    nameserver 127.0.0.1
    Warning: /opt partition not empty!
    Installing package uclibc-opt_0.9.28-13_mipsel.ipk ...
    Connecting to ipkg.nslu2-linux.org (140.211.169.169:80)
    Updating /opt/etc/ld.so.cache
    /opt/sbin/ldconfig: can't link /opt/lib/libipkg.so.0 to libipkg.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libutil.so.0 to libutil-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libc.so.0 to libuClibc-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libthread_db.so.1 to libthread_db-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libstdc++.so.6 to libstdc++.so.6.0.8: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/librt.so.0 to librt-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libresolv.so.0 to libresolv-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libpthread.so.0 to libpthread-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libnsl.so.0 to libnsl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libmudflapth.so.0 to libmudflapth.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libmudflap.so.0 to libmudflap.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libm.so.0 to libm-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libintl.so.0 to libintl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libdl.so.0 to libdl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libcrypt.so.0 to libcrypt-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/ld-uClibc.so.0 to ld-uClibc-0.9.28.so: Operation not permitted
    Installing package ipkg-opt_0.99.163-10_mipsel.ipk ...
    Connecting to ipkg.nslu2-linux.org (140.211.169.169:80)
    /opt/sbin/ldconfig: can't link /opt/lib/libipkg.so.0 to libipkg.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libutil.so.0 to libutil-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libc.so.0 to libuClibc-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libthread_db.so.1 to libthread_db-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libstdc++.so.6 to libstdc++.so.6.0.8: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/librt.so.0 to librt-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libresolv.so.0 to libresolv-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libpthread.so.0 to libpthread-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libnsl.so.0 to libnsl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libmudflapth.so.0 to libmudflapth.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libmudflap.so.0 to libmudflap.so.0.0.0: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libm.so.0 to libm-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libintl.so.0 to libintl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libdl.so.0 to libdl-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/libcrypt.so.0 to libcrypt-0.9.28.so: Operation not permitted
    /opt/sbin/ldconfig: can't link /opt/lib/ld-uClibc.so.0 to ld-uClibc-0.9.28.so: Operation not permitted
    /tmp/optware-install-oleg.sh: line 91: /opt/bin/ipkg: not found
    /tmp/optware-install-oleg.sh: line 92: /opt/bin/ipkg: not found
    /tmp/optware-install-oleg.sh: line 93: /opt/bin/ipkg: not found
    
    Any idea what the problem is ? First time I used it with an external HDD formated with ext3, and now it's a pen drive with FAT32, that anything to do with it ?

    Thanks in advance
     
  10. janosik47

    janosik47 Addicted to LI Member

    FAT32 is the problem, see the following line:
    FAT does not support symbolic links, reformat the pen drive to ext2/3
     
  11. mars

    mars Addicted to LI Member

    tyvm, worked now :)
     
  12. bokh

    bokh Network Guru Member

    Adapted the optware-install-oleg.sh script a little and it works over CIFS (samba) also. :biggrin:
    In short: point /opt to /cifs1/opt and install the 2 ipkg-packages mentioned in the script (bottom lines) into /cifs1/opt/ and mount this directory under /opt of Tomato.
    Got to write a HOWTO for this any time soon...

    Anyhow: I just installed "nmap" and "nload" through "ipkg" to check and THEY WORK! :thumbup:
     

Share This Page