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

extracting individual binaries from Optware packages?

Discussion in 'Tomato Firmware' started by luckman212, May 10, 2011.

  1. luckman212

    luckman212 LI Guru Member

    Hi all,
    so there are 2 packages that I really *need* on my tomato router (asus RT-N16 running Victek's excellent TomatoRAF mod).
    they are: tcpdump & snmpd

    I see that these are available in optware but I didn't want to do a full optware install because I don't want to attach any usb storage to the unit and want to minimize the jffs writes.

    so I found this guide on extracting .ipk packages (basically they are just renamed .tar.gz files) and I was able to download & extract the binaries, but they don't run. I put them in /jffs but when I try to execute them I get e.g. "-sh: ./tcpdump: not found". Yes I did chmod +x.

    any idea if this is possible to do? I was thinking this might be due to a bad transfer (ASCII vs binary) but I think I did it correctly (used WinSCP). Do I need special MIPSR2 versions? I see in the optware repo that there are many directories for various build types but I don't know which one to choose exactly. I chose the one at http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ because that was the one referenced in the TomatoUSB mod optware install guide.

    any ideas? thanks! :)
     
  2. TT76

    TT76 Networkin' Nut Member

    I think you didn't input a correct filename or a path. Maybe try /jffs/tcpdump.
     
  3. luckman212

    luckman212 LI Guru Member

    thanks, but no-- tcpdump is a file, not a directory in this case. I think I downloaded the wrong binary somehow. but not sure which one is correct for MIPS R2 devices like RT-N16.
     
  4. shibby20

    shibby20 Network Guru Member

    but tcpdump needs libpcap ;)

    btw all packages are compiled with prefix /opt. May not work from other path!

    I have idea:
    - mount /jffs as /opt and install optware, tcpdump etc
    - umount /opt and copy all from /jffs to /tmp/opt
    - then mount /tmp/opt as /opt and optware will work ;) You dont need usb storage and nothing will using flash memory. Optware will works in ram (rtn16 has lot of ram ;P ).
    - add to firewall script copying data from /jffs to /tmp and mount /opt after reboot.
     
  5. luckman212

    luckman212 LI Guru Member

    I gave up on this idea and just plugged in a usb drive and installed the "real" optware.
     
  6. shibby20

    shibby20 Network Guru Member

    and this is the best way :)
     
  7. prudy

    prudy Addicted to LI Member

    tcpdump uses:
    libpcap.so.1 => /opt/lib/libpcap.so.1 (0x2aabf000)
    libgcc_s.so.1 => /opt/lib/libgcc_s.so.1 (0x2ab03000)
    libc.so.0 => /opt/lib/libc.so.0 (0x2ab22000)
    ld-uClibc.so.0 => /opt/lib/ld-uClibc.so.0 (0x2aaa8000)

    so beside pcap the three others are needed. They come from uclibc-opt_0.9.28-13_mipsel.ipk that is installed by the optware script.
     

Share This Page