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

Tomatoware

Discussion in 'Tomato Firmware' started by lancethepants, Mar 7, 2014.

  1. lancethepants

    lancethepants Network Guru Member

    Tomatoware is a project that creates a native compiling environment for Tomato firmware supported routers.
    https://github.com/lancethepants/tomatoware


    Why

    Tomatoware may be useful for:
    1. Compiling a package not found in optware/entware.
    2. Compiling the latest (bleeding edge) version of a package.
    3. Compiling your own custom code.

    Tomatoware can be mounted to /mmc to allow co-existence with optware/entware. It can also be compiled for any prefix. Various prefixes are currently available.



    Installation

    1. Create and Mount a new partition with the desired prefix.
    (You should know how since you're already running optware/entware, right?)

    2. Download and extract.
    https://github.com/lancethepants/tomatoware/releases

    3. Replace /opt/etc/profile with 'prefix'/etc/profile

    4. Re-login so the profile you copied over can take effect.



    Compiling

    For most sources that provide a 'configure' script, compiling can be as simple as running the following.
    Code:
    ./configure --prefix='prefix'
    make
    make install
    
    Where 'prefix' is the directory your selected version of Tomatoware mounts to.
    Some software may not be so easy to compile.
    This is the place to ask if you need help with compiling something in particular.

    Tomatoware provides a base set of libraries. Perhaps the program you want to compile has other library dependencies. Those must first be compiled and installed before your program can compile.

    NOTE: Tomatoware is not capable of compiling kernel modules. These can only be built with the original tomato cross-compiling toolchain.

    Features

    c and c++ code can be compiled using the gcc compiler.
    Python and Perl languages are included.
    git is provided for pulling code from git repos.


    Included Libraries
    • bzip2
    • zlib
    • lzo
    • xz utils
    • openssl
    • gettext
    • flex
    • libcurl
    • expat
    • libpcap
    • libffi
    • iconv
    • ncurses
    • libreadline
    • libgdbm
    • tcl
    • Berkeley DB
    • sqlite
    • libxml
    • libxslt
    • libsigc++
    • libpar2
    • libevent
    • pcre
    • glib2
    • libgmp
    • libmpfr
    • libmpc
    • libnettle
    • gnutls
    * Static and dynamic versions of each library should be included. This should allow for the creation of both static and dynamic binaries.


    Included Developmental Tools
    • strace
    • htop
    • screen
    • bash
    • vim
    • tmux
    • unzip
    • binutils
    • autoconf
    • automake
    • bison
    • check
    • coreutils
    • diffutils
    • findutils
    • gawk
    • libtool
    • m4
    • make
    • util-linux
    • patch
    • wget
    • grep
    • tar
    • sed
    • texinfo

    Extras
    • Asterisk
    • par2cmdline
    • unrar
    • openssh
    • Linux-pam
    • python/cheetah
    • python/yenc
    • python/pyOpenSSL


    Speed
    Remember, speed is relative.

    Compiling on a router can be slow because they are much slower than modern day x86 computers.
    It can also be very fast if you also factor in:
    • The time it may take for a feature request to be fulfilled.
    • The time it may take you to learn and setup a cross-development environment.
    Arm routers are many times more powerful than mipsel routers. Many Arm routers have dual cores, so you can utilize both cores in most cases when compiling, so speed up compiling. This most often can be done when running 'make', by running 'make -j2'
     
    Last edited: Nov 29, 2015
  2. koitsu

    koitsu Network Guru Member

    I have two (respectful, not implicative) questions, and I hope they do not induce a debate of any kind:

    1. What versions of Perl, Python, and gcc are included?

    2. Why would someone choose Tomatoware over, say, Entware? While I acknowledge they can be run alongside one another (ex. Entware in /opt, Tomatoware in /mmc), Entware already has 95% of the aforementioned software, and opkg has dependency tracking along with update/upgrade support (opkg update ; opkg upgrade and you're done). I guess what I'm trying to figure out is why someone wouldn't just write a shell script to run opkg install {whatever} for all the stuff they want (that's what I did anyway).

    I should note that with regards to Q2 above, I have taken the time to make a spreadsheet that lists off all the equivalents between what Tomatoware comes with and the package names in Entware:

    https://www.dropbox.com/s/az63t9oj14xvwd6/Tomatoware vs Entware.xlsx

    Summary:

    Tomatoware libraries listed: 31
    Entware libraries available: 26 -- missing: gettext, flex, libmpfr, libmpc**, libnettle

    Tomatoware devtools listed: 30
    Entware devtools available: 20 -- missing: autoconf, automake, bison, check, libtool, m4, util-linux, grep, texinfo, gcc

    Tomatoware extras listed: 9
    Entware extras available: 7 -- missing: par2cmdline, python/yenc

    What surprises me the most is the lack of devtools. Is it possible to rectify this situation on Entware? Absolutely. I think (suspect) most of the Entware devs just build packages using cross-compilers and cross-arch toolchains on existing PC-based Linux systems, since PCs are faster than our little Tomato routers (we all agree upon that).

    I, however, would definitely like an actual development toolchain on my router itself, since that way I don't have to deal with the annoyances of cross-compilers and toolchains (I find them to be annoying + stressful as hell). Yes, I know my RT-N16 is slow as a dog, but I have to go through a lot less hoops/jumps building software in the environment its intended for when I can use that same environment for testing.

    ** - May possibly just be called mpc in Entware, but not sure.
     
  3. leandroong

    leandroong Addicted to LI Member

    Tomatoware, for me, if I were to use it, I would implement it in ubuntu virtualbox environment bec of cpu speed, very unlikely on 500-1Ghz router.
    Could you also include procedures on how to implement this on ubuntu?
     
  4. jerrm

    jerrm Network Guru Member

    Wouldn't that negate the whole purpose of tomatoware as a native build envirionment? Optware, Entware, and the tomato tree itself all offer cross-compile environments.
     
  5. lancethepants

    lancethepants Network Guru Member

    gcc 4.6.4
    I use the Entware toolchain for Tomatoware. Entware is built using 4.6.4, so I've decided to use the same for Tomatoware.

    Perl 5.18.2
    Python 2.7.3

    Most packages used in Tomatoware are the latest available. If one is not, there is probably a reason why.

    I 100% advocate and promote the use of entware. For most cases Entware is all most may need.
    Tomatoware is just the filler for all the situations where Entware may not be enough. I in fact use Entware.
    If a package I want is already available in Entware, that is the easiest route to go.

    If however you want:
    A package not found in Entware
    A specific or newer version
    A version of a package with a different set of compile options (ie. nginx w/ http-cache enabled)
    https://code.google.com/p/wl500g-repo/issues/detail?id=293&colspec=ID Type Stars Status Priority Owner Summary Modified

    You can then use Tomatoware to compile it on the router itself.


    A couple of usecase scenarios of Tomatoware
    http://www.linksysinfo.org/index.php?threads/two-factor-authentication-in-openvpn.69109/
    http://www.linksysinfo.org/index.php?threads/google-two-factor-authentication-on-tomato.68831/

    The first link necitates the need of OpenVPN with Linux-pam authentication. This requires OpenVPN to be recompiled.
    The second link requires google two-factor authentication, not found in Entware. Compile it on the router with Tomatoware.

    Some applications are not easily cross-compilable. Using Tomatoware's native devlopment toolchain for routers, these hard or impossible to cross-compile programs can maybe be compiled with Tomatoware.
    https://code.google.com/p/wl500g-repo/issues/detail?id=134&colspec=ID Type Stars Status Priority Owner Summary Modified

    Yes there are many duplicate libraries to those found in Tomatoware, but Entware insofar has not taken aim to being a development environment.
    Optware did have this capability with its buildroot and optware-devel packages. Much like Tomatoware you could compile stuff right on your router.

    Here's an old thread example I dug up from years ago . http://tomatousb.org/forum/t-411669

    Since Tomatoware uses the Entware toolchain, the benefits of compiling using Tomoware in place of Optware, are akin to running Entware in place of Optware.
    Compiling on the router however necesitates that all the libraries also have their dev packages. Something that Optware provided (not in all cases) but Entware does not at all.
    That is the reason for these duplicate libraries. Tomatoware provides the full version of all libraries, which included their '-dev' parts. Tomatoware can also be run stand-alone. It is not dependent on Entware in order to serve as a native toolchain.

    If Entware provided all the dev packages for their libraries, and included a compiler, and some additional development packages (libtool, autoconf make etc), then it would negate the need for Tomatoware.
    Note that Tomatoware only has a basic set of libraries. If the application you desire to compile has a dependency on a library not found in Tomatoware, you must compile that first.

    This is exactly what Tomatoware is designed to be.

    Hopefully I have answered all your questions to your satisfaction, I have certainly intended to do so anyway.
     
    Last edited: Mar 7, 2014
    ryzhov_al and koitsu like this.
  6. lancethepants

    lancethepants Network Guru Member

    Entware is the answer to your question. You can cross-compile whatever you want, and create an ipk if desired.

    Exactly right. Tomatoware is a native build environment. Optware, Entware and Tomato are cross-build environments.
     
  7. leandroong

    leandroong Addicted to LI Member

    How long would it take to install tomatoware before you can start doing cross compilation?
    I seldom do compilation. I think, I will just stick on entware. But, I do like to try it on ubuntu virtualbox ...
     
    Last edited: Mar 7, 2014
  8. lancethepants

    lancethepants Network Guru Member

    Once you've partitioned and mounted your partition on your router, just a few minutes to extract it. This is not cross-compiling however, it is a native toolchain for routers.

    It will serve you just fine in the majority of cases. If you've ever had an unfulfilled feature request, this is where Tomatoware shines and can help accomplish whatever it is you want to do.

    Tomatoware does not run on x86, only on mipsel routers.

    edit: Tomatoware itself is cross-compiled on x86, like Entware. The resulting binaries will only run on mipsel devices, like Entware. If you want a full-fledged cross-compiling environment, use Entware, it is more suited for the task.
     
    Last edited: Mar 7, 2014
    koitsu likes this.
  9. leandroong

    leandroong Addicted to LI Member

    Thanks for the clarification.
     
    lancethepants likes this.
  10. leandroong

    leandroong Addicted to LI Member

    Correct me if i'm wrong, this is one way of installing tomatoware:
    1.) mkdir /mnt/optware/tomatoware
    2.) mount -o bind /mnt/optware/tomatoware /tomatoware
    3.) cd /mnt/tomatoware
    4.) download and extract opt.tgz
    5.) Replace /opt/etc/profile with /tomatoware/etc/profile
    6.) Edit /opt/etc/profile (new) to include path
    /opt/sbin;/opt/bin
    note: why not include this in your profile?

    Note: i'm not using separate partition for tomatoware, just separate folder. Need to include mounting of tomatoware in init script.
     
  11. leandroong

    leandroong Addicted to LI Member

    I have WEB tomato router, design solely ATM of playing internet music, 240Mhz only. Will try to setup tomatoware on this and see how it goes. My main router RT-N56U, is reserved for DHCP, aria2 download, transmission download, etc.
     
  12. lancethepants

    lancethepants Network Guru Member

    Yes, it is possible to install to /mmc or /jffs prefix mounted to an existing directory in /opt.
    This Post and the following two touch on this.
    http://linksysinfo.org/index.php?th...ice-tomatousb-the-easy-way.68813/#post-241510

    I personally prefer to give it its own partition, but I can understand if you don't want to wipe your drive if you currently have a working entware setup going already, and don't want to mess with it.
     
    Last edited: Mar 7, 2014
  13. leandroong

    leandroong Addicted to LI Member

    Due to error of folder binding for unknown reason, I decided to use unzip the opt.tgz on prefix /opt.
    Question: Is your optware "entware" ?

    After extraction of opt.tgz to /opt and allow it to overwrite all conflicting files automatically. I tested if my current entware optware is still working, I invoke on putty the command "screen -list" and it prompt me "Permission denied". Self-answer, maybe this is entware optware compatible.

    Other observation: NFS server is working, transmission is dead and will not restart, aria2c -help prompt "permission denied"

    Next step is to create separate partition for tomatoware and re-install my entware.
     
    Last edited: Mar 8, 2014
  14. leandroong

    leandroong Addicted to LI Member

    router: RT-N56U (ra-link)
    this is what I did:
    1.) create folder on 2nd usb folder, /media/dl/tomatoware
    2.) download and unzip to folder tomatoware the file mmc.tgz
    3. overwrite /opt/profile and edit path

    test run, using your sample

    1.) mkdir /opt/tcpdump && cd /opt/tcpdump
    2.) wget http://www.tcpdump.org/release/tcpdump-4.4.0.tar.gz
    3.) tar zxvf tcpdump-4.4.0.tar.gz
    4.) cd tcpdump-4.4.0
    5.) ./configure --prefix=/media/dl/tomatoware
    eror result:
    Code:
    /opt/tcpdump/tcpdump-4.4.0 # ./configure --prefix=/media/dl/tomatoware
    checking build system type... Warning: creating insecure temp directory
    ./config.guess: unable to guess system type
    
    This script, last modified 2009-12-30, has failed to recognize
    the operating system you are using. It is advised that you
    download the most up to date version of the config scripts from
    
      http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;h          b=HEAD
    and
      http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=          HEAD
    
    If the version you run (./config.guess) is already up to date, please
    send the following data and any information you think might be
    pertinent to <config-patches@gnu.org> in order to provide the needed
    information to handle your system.
    
    config.guess timestamp = 2009-12-30
    
    uname -m = mips
    uname -r = 3.0.101
    uname -s = Linux
    uname -v = #4 Thu Feb 13 22:57:46 KRAT 2014
    
    /usr/bin/uname -p =
    /bin/uname -X     =
    
    hostinfo               =
    /bin/universe          =
    /usr/bin/arch -k       =
    /bin/arch              =
    /usr/bin/oslevel       =
    /usr/convex/getsysinfo =
    
    UNAME_MACHINE = mips
    UNAME_RELEASE = 3.0.101
    UNAME_SYSTEM  = Linux
    UNAME_VERSION = #4 Thu Feb 13 22:57:46 KRAT 2014
    configure: error: cannot guess build type; you must specify one
    
    Does it mean not applicable for RT-N56U FW?

    Note: same error, if I used "./configure --prefix=/opt"
     
    Last edited: Mar 8, 2014
  15. lancethepants

    lancethepants Network Guru Member

    Tomatoware should run everywhere entware does. I believe some firmwares don't come with /mmc, I don't think shibby's does. In that case you would need to use /jffs or something else. Tomatoware can be mounted to any prefix, but it must be specifically compiled for that prefix. The root directory of where you extract must be that prefix, or mounted to that prefix. ie. mmc.tgz version must be mounted to /mmc, it can't be in any sub-foldler, unless that sub-folder has been mounted to /mmc. The paths in entware and tomatoware are hard-coded to look where its been compiled for.

    I think using the 'mount' command is the best way for this. I could, however, suppose I could make one with '/opt/entware' prefix. That wouldn't require any mounting if you already have /opt. I at least don't think that would clash with entware. I could also make a version for cifs1 or cifs2, really anything that is available and not already in use.
     
    Last edited: Mar 8, 2014
  16. leandroong

    leandroong Addicted to LI Member

    How about, experimenting running on NFS server? Is it possible?

    Self-answer, not possible from what you explain. Will try modify my WEB same as yours.
     
  17. leandroong

    leandroong Addicted to LI Member

    1. this is how I mounted my /opt, "mount -o bind /tmp/mnt/optware/opt /opt"
    2. I tried creating foder, /tmp/mnt/optware/tomatoware and mount that using syntax, "mount -o bind /tmp/mnt/optware/tomatoware /tomatoware". It failed, maybe, mount conflict, not sure
     
  18. leandroong

    leandroong Addicted to LI Member

    My jffs space is limited to 6,528KB, enough?
     
  19. lancethepants

    lancethepants Network Guru Member

    I looks like you're trying to mount '/tmp/mnt/optware/tomatoware' to '/tomatoware'.
    You have to mount to a directory that already exists in tomato firmware. Tomato firmware has a read-only file system, so you cannot create one like /tomatoware. In shibby, he has removed /mmc, so you cannot use /mmc. If you run 'ls /', that will essentially give you all the folders in your root directory. You have to pick a free one from there. Currently I only have /opt, /mmc, /jffs.

    Since you're already using /opt, you have /mmc and /jffs. I don't have a tomatoware.tgz version, and none of the firmwares will have the /tomatoware directory already created.
    If you can't use /mmc or /jffs for some reason (plausible if you have shibby, and are currently using /jffs for something else), I can create another version with whatever prefix. Currently I'm compiling one that would mount to /opt/tomatoware, to give that a test. Could be /cifs1 or something else though.
     
  20. lancethepants

    lancethepants Network Guru Member

    In the case of /jffs, you would not enable /jffs through the gui in tomato. You would just mount a partition or a folder to /jffs like you've done with /opt. You actually must first disable /jffs in the tomato gui if it is enabled.
     
  21. leandroong

    leandroong Addicted to LI Member

    Actually, I'm about to test with /opt/tomatoware using mmc.tgz. Should I try?
     
  22. leandroong

    leandroong Addicted to LI Member

    How should I proceed, like this?
    1.) extract jffs.tgz on /jffs folder and just replace and edit profile...
     
  23. lancethepants

    lancethepants Network Guru Member

    If you are mounting /opt/tomatoware to /mmc then yes, otherwise no.

    Yes, so long as you have disabled /jffs in the tomato gui, and you have mounted either a partition or a folder to jffs.

    Code:
    tar zxvf jffs.tgz -C /jffs
    
     
  24. leandroong

    leandroong Addicted to LI Member

    Router: ZTE ZXV10 H618B
    CPU Freq240MHz
    FW: Tomato Firmware 1.28.0000 MIPSR1-116 K26 USB AIO

    Still error. Mounted on /jffs.
    Code:
    root@BTRouter2:/opt/tcpdump# cd tcpdump-4.4.0
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0# ./configure --prefix=/jffs
    checking build system type... Warning: creating insecure temp directory
    ./config.guess: unable to guess system type
    
    This script, last modified 2009-12-30, has failed to recognize
    the operating system you are using. It is advised that you
    download the most up to date version of the config scripts from
    
      http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
    and
      http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    
    If the version you run (./config.guess) is already up to date, please
    send the following data and any information you think might be
    pertinent to <config-patches@gnu.org> in order to provide the needed
    information to handle your system.
    
    config.guess timestamp = 2009-12-30
    
    uname -m = mips
    uname -r = 2.6.22.19
    uname -s = Linux
    uname -v = #8 Fri Jan 17 21:46:33 CET 2014
    
    /usr/bin/uname -p =
    /bin/uname -X     =
    
    hostinfo               =
    /bin/universe          =
    /usr/bin/arch -k       =
    /bin/arch              =
    /usr/bin/oslevel       =
    /usr/convex/getsysinfo =
    
    UNAME_MACHINE = mips
    UNAME_RELEASE = 2.6.22.19
    UNAME_SYSTEM  = Linux
    UNAME_VERSION = #8 Fri Jan 17 21:46:33 CET 2014
    configure: error: cannot guess build type; you must specify one
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0#
    
    oops! I forgot to correct profile. Will report back
     
  25. leandroong

    leandroong Addicted to LI Member

    Now compiling in my slow router, waiting to get completion.
    Question, where will it install, upon execution of "make install" ?

    This is my architecture, one partition containing folder opt and jffs. extract jjfs.tgz on jffs folder.
    Replace and modify profile path for addl path.
    Edit init script, have these:
    Code:
    A=1
    while [ $A -gt 0 ] ; do
    if [ -f /var/notice/sysup ] ; then sleep 2; break; fi
    sleep 1
    done
    mount -o bind /tmp/mnt/optware/opt /opt
    mount -o bind /tmp/mnt/optware/jffs /jffs
    
    Reboot router... done

    Test sample compilation of tcpdump.... Success !!!
     
  26. leandroong

    leandroong Addicted to LI Member

    optware screen with this is good. One click from win7 desktop, calling putty command prompt that call screen function to compile on the background quietly...
     
  27. lancethepants

    lancethepants Network Guru Member

    It will install depending on the prefix you hand to the configure script. It's best to do then wherever Tomatoware is installed, in your case /jffs. The binaries will then be installed in /jffs/bin, or /jffs/sbin depending on the application you're compiling.

    I do this quite often too (I actually use tmux). Just let it do it's thing if it has a lot to compile and take a look at it later.
     
  28. leandroong

    leandroong Addicted to LI Member

    I wonder, how I can install this on RT-N56U (padavan fw)? It has no /jffs, /mms, /cifs, only /opt.
    If I use opt.tgz, this will merge with current entware /opt folder, right?
    Code:
    BusyBox v1.21.1 (2014-02-13 22:39:16 KRAT) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    /opt/home/admin # ls /
    bin     etc     home    lib     mnt     proc    sys     usr     www
    dev     etc_ro  init    media   opt     sbin    tmp     var
    /opt/home/admin #
    
     
  29. lancethepants

    lancethepants Network Guru Member

    Yes, it would merge them, but that will not work.
    I've just compiled and tested a version of Tomatoware that can be placed in '/opt/tomatoware' for its root directory. It works just fine, so I'll upload that in a minute.
     
  30. leandroong

    leandroong Addicted to LI Member

    Will wait and test also
     
  31. lancethepants

    lancethepants Network Guru Member

    So I've uploaded one called 'opt.tomatoware.tgz' Create the directory /opt/tomatoware, extract opt.tomatoware.tgz in that folder. Follow the regular directions and copy over and edit the profile file, and it should work.
     
  32. leandroong

    leandroong Addicted to LI Member

    screen compilation result:
    Code:
    gcc -O2 -DHAVE_CONFIG_H  -I./missing  -D_U_="__attribute__((unused))" -I. -I/jffs/include  -I./missing -DINET6 -g -O2  -o tcpdump addrtoname.o af.o checksum.o cpack.o gmpls.o oui.o gmt2local.o ipproto.o nlpid.o l2vpn.o machdep.o parsenfsfh.o in_cksum.o print-802_11.o print-802_15_4.o print-ap1394.o print-ah.o print-arcnet.o print-aodv.o print-arp.o print-ascii.o print-atalk.o print-atm.o print-beep.o print-bfd.o print-bgp.o print-bootp.o print-bt.o print-carp.o print-cdp.o print-cfm.o print-chdlc.o print-cip.o print-cnfp.o print-dccp.o print-decnet.o print-domain.o print-dtp.o print-dvmrp.o print-enc.o print-egp.o print-eap.o print-eigrp.o print-esp.o print-ether.o print-fddi.o print-forces.o print-fr.o print-gre.o print-hsrp.o print-icmp.o print-igmp.o print-igrp.o print-ip.o print-ipcomp.o print-ipfc.o print-ipnet.o print-ipx.o print-isoclns.o print-juniper.o print-krb.o print-l2tp.o print-lane.o print-ldp.o print-lldp.o print-llc.o print-lmp.o print-lspping.o print-lwapp.o print-lwres.o print-mobile.o print-mpcp.o print-mpls.o print-msdp.o print-msnlb.o print-nfs.o print-ntp.o print-null.o print-olsr.o print-ospf.o print-pgm.o print-pim.o print-ppi.o print-ppp.o print-pppoe.o print-pptp.o print-radius.o print-raw.o print-rip.o print-rpki-rtr.o print-rrcp.o print-rsvp.o print-rx.o print-sctp.o print-sflow.o print-sip.o print-sl.o print-sll.o print-slow.o print-snmp.o print-stp.o print-sunatm.o print-sunrpc.o print-symantec.o print-syslog.o print-tcp.o print-telnet.o print-tftp.o print-timed.o print-tipc.o print-token.o print-udld.o print-udp.o print-usb.o print-vjc.o print-vqp.o print-vrrp.o print-vtp.o print-wb.o print-zephyr.o print-zeromq.o print-vxlan.o print-otv.o signature.o setsignal.o tcpdump.o util.o version.o print-ip6.o print-ip6opts.o print-mobility.o print-ripng.o print-icmp6.o print-frag6.o print-rt6.o print-ospf6.o print-dhcp6.o print-babel.o print-smb.o smbutil.o  print-isakmp.o -lcrypto -L/jffs/lib -Wl,-rpath,/jffs/lib -lpcap
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0# make install
    [ -d /jffs/sbin ] || \
        (mkdir -p /jffs/sbin; chmod 755 /jffs/sbin)
    /jffs/bin/install -c tcpdump /jffs/sbin/tcpdump
    /jffs/bin/install -c tcpdump /jffs/sbin/tcpdump.`cat ./VERSION`
    [ -d /jffs/share/man/man1 ] || \
        (mkdir -p /jffs/share/man/man1; chmod 755 /jffs/share/man/man1)
    /jffs/bin/install -c -m 644 tcpdump.1 /jffs/share/man/man1/tcpdump.1
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0#
    
    Code:
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0# tcpdump -h
    tcpdump version 4.4.0
    libpcap version 1.5.3
    Usage: tcpdump [-aAbdDefhHIJKlLnNOpqRStuUvxX] [ -B size ] [ -c count ]
                    [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
                    [ -i interface ] [ -j tstamptype ] [ -M secret ]
                    [ -r file ] [ -s snaplen ] [ -T type ] [ -V file ] [ -w file ]
                    [ -W filecount ] [ -y datalinktype ] [ -z command ]
                    [ -Z user ] [ expression ]
    root@BTRouter2:/opt/tcpdump/tcpdump-4.4.0#
    
     
  33. lancethepants

    lancethepants Network Guru Member

    Occasionally in the middle of compiling something you may have gcc segfault. Usually this is just the compiling getting overloaded. Just run 'make' again, and it should pick up and continue from where it barfed. I would also highly recommend setting up a swap space on the router, and this may help to some degree.
     
  34. leandroong

    leandroong Addicted to LI Member

    Will test later
     
  35. lancethepants

    lancethepants Network Guru Member

    Glad you got it to work. There is a newer version of tcpdump though, 4.5.1.
     
  36. leandroong

    leandroong Addicted to LI Member

    Just want to show screen snapshot while building libevent on RT-N56U, padavan fw, using tomatoware.
    So far no error yet. I assign 1GB of swap partition and it is utilizing my CPU to the maximum and left litte memory from 128MB.
     

    Attached Files:

  37. leandroong

    leandroong Addicted to LI Member

    @lancethepants, need help in compiling transmission, I can compile in ubuntu that yield transmission_0-1_i386.deb. How should binary be generated in tomatoware?

    These are my procedures:
    Code:
    mkdir -p /media/optware/build/transmission_build/transmission && cd /media/optware/build/transmission_build/transmission
    wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
    tar xvfz libevent-2.0.21-stable.tar.gz
    cd libevent-2.0.21-stable
    ./configure --prefix=/media/optware/build/transmission_build/libevent
    make && make install
    
    #download and compile transmission
    cd /media/optware/build/transmission_build/transmission
    wget https://build.transmissionbt.com/job/trunk-linux/lastSuccessfulBuild/artifact/transmission-trunk-r14252.tar.xz
    tar xJf transmission-trunk-r14252.tar.xz
    cd transmission-2.82+
    export PKG_CONFIG_PATH="/media/optware/build/transmission_build/libevent/lib/pkgconfig"
    ./configure
    make
    checkinstall --pakdir "/media/optware/build/transmission_build" --backup=no --deldoc=yes --fstrans=no --deldesc=yes --delspec=yes --default --pkgversion "2.82+"
    make clean
    
    I'm sure there is something need to be done to generate binary

    Will try to exclude the line, "checkinstall..." and replace it with make install. Hope this work
     
    Last edited: Mar 10, 2014
  38. lancethepants

    lancethepants Network Guru Member

    Tomatoware already included libevent, so no need to compile it.
    Where is Tomatoware mounted to? Are you using the /opt/tomatoware version? In general you should set --prefix to wherever tomatoware is mounted. Should be one of the following, cause these are the only versions so far I've created.
    Code:
    ./configure --prefix=/opt
    ./configure --prefix=/mmc
    ./configure --prefix=/jffs
    ./configure --prefix=/opt/tomatoware
    
    If you successfully ran through make, then the binaries should have been made. Running 'make install' will install them in the sub-directories of whatever --prefix you provided. If you look in the correct places in the source, you can manually look for the binaries. Transmission splits each one in to its own folder. Make sure to set the right --prefix, and running make install will automatically but the binaries where they need to go.
     
  39. leandroong

    leandroong Addicted to LI Member

    error, during execution of "./configure --prefix=/opt/tomatoware" as follow:
    Code:
    checking whether posix_fadvise is declared... yes
    checking for posix_fadvise... yes
    checking sys/inotify.h usability... yes
    checking sys/inotify.h presence... yes
    checking for sys/inotify.h... yes
    checking for inotify_init... yes
    checking sys/event.h usability... no
    checking sys/event.h presence... no
    checking for sys/event.h... no
    checking sys/statvfs.h usability... yes
    checking sys/statvfs.h presence... yes
    checking for sys/statvfs.h... yes
    checking xfs/xfs.h usability... no
    checking xfs/xfs.h presence... no
    checking for xfs/xfs.h... no
    checking for SYSTEMD_DAEMON... no
    checking for clock_gettime in -lrt... no
    checking µTP... yes
    checking supported miniupnp library... none
    checking whether NLS is requested... yes
    ./configure: line 18587: intltool-update: command not found
    checking for intltool >= 0.35.0...  found
    configure: error: Your intltool is too old.  You need intltool 0.35.0 or later.
    /media/optware/build/transmission_build/transmission/transmission-2.82+ #
    Nightly build seems to be needing intltool 0.35, how do i upgrade that?
     
  40. leandroong

    leandroong Addicted to LI Member

    While compiling intltool-0.50.2, got this error
    Code:
    ..
    intltool-0.50.2/tests/cases/unicodetext.xml.in
    intltool-0.50.2/tests/cases/extract9.xml.in
    intltool-0.50.2/tests/cases/extract7.xml
    intltool-0.50.2/tests/cases/extract8.glade
    intltool-0.50.2/tests/cases/extract13.desktop.in
    intltool-0.50.2/tests/cases/merge6.po
    intltool-0.50.2/tests/cases/schemasmerge2.po
    intltool-0.50.2/tests/cases/merge4.xml.in
    intltool-0.50.2/tests/cases/merge-cdata.xml.in
    intltool-0.50.2/tests/cases/iso88591text.xml.in
    intltool-0.50.2/tests/cases/merge8.keys.in
    intltool-0.50.2/tests/cases/merge5u.sheet.in
    /media/optware/build/intltool # cd intltool-0.50.2
    /media/optware/build/intltool/intltool-0.50.2 # ./configure --prefix=/opt/tomatoware
    checking for a BSD-compatible install... /opt/tomatoware/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /opt/tomatoware/bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for perl... /opt/tomatoware/bin/perl
    checking for perl >= 5.8.1... 5.18.2
    checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
    /media/optware/build/intltool/intltool-0.50.2 #
    
     
    Last edited: Mar 10, 2014
  41. leandroong

    leandroong Addicted to LI Member

    I'm recompiling tcpdump ATM, seems ok so far. Only transmission has problem. Program is perfect and I highly recommend it for developer. I 'm not getting segmentation fault or anything so far.

    edit: tcpdump compilation completed and running.
     
    Last edited: Mar 10, 2014
  42. lancethepants

    lancethepants Network Guru Member

    I've compiled a lot on the router, but never have done transmission before. I've always cross compiled it. intltool may merit being included in future releases of Tomatoware.
    You can download compile and install the XML::parser
    http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/XML-Parser-2.41.tar.gz
    Code:
    perl Makefile.PL
    make
    make install
    
    There still some tricky stuff in the transmisison Makefile where it tries to recursively go through the directories that fails. I'll take a look at it later today.
     
    Last edited: Mar 12, 2014
  43. leandroong

    leandroong Addicted to LI Member

    Error compilation of aria2 version 1.18.3. Pass ./configure --prefix=/opt/tomatoware. Fail on make command
     
  44. leandroong

    leandroong Addicted to LI Member

    After fixing XML_parser (2.41) and inttltool (0.50.2), transmission start compiling. Will report if success.

    Edit: success, it is downloading. Now only aria2 has problem
    Edit: I wan able to compile aria2 v1.18.3 in entware environment and using it.
     
    Last edited: Mar 10, 2014
  45. leandroong

    leandroong Addicted to LI Member

    Only comment on transmission, I still prefer having script in /opt/etc/init.d/S88transmission, for easily "start, stop, kill, check"
     
  46. leandroong

    leandroong Addicted to LI Member

    Re-compile aria2 1.18.3, ./configure success. make has error
    Code:
    make[1]: Entering directory '/media/optware/build/aria2/aria2-1.18.3'
    Making all in po
    Makefile:529: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/media/optware/build/aria2/aria2-1.18.3'
    Makefile:439: recipe for target 'all' failed
    make: *** [all] Error 2
    /media/optware/build/aria2/aria2-1.18.3 #
    
     
  47. lancethepants

    lancethepants Network Guru Member

    Ah, looks like you've found me a bug only present in this latest version of Tomatoware (just my luck). I suspect it's an issue with the latest version of bash. I'll check it out soon.
     
  48. lancethepants

    lancethepants Network Guru Member

    Yep, its as I expected. :/ I'll have to figure out how to fix bash or else just revert it to the previous release. For now you can install bash from entware. When running configure use the following.

    Code:
    ./configure --prefix=/yourprefix SHELL=/opt/bin/bash
    
    edit: Better yet, rename the bash binary from Tomatoware to something else, so only the entware bash is present. I'm going to revert to the old bash. Since 4.3 is so new, there's not a lot of help yet on cross-compiling it. I'l re-release as v0.8.1.
     
    Last edited: Mar 10, 2014
  49. lancethepants

    lancethepants Network Guru Member

    I've released Tomatoware v0.8.1.
    This has the reverted version of bash. If you have v0.8 you can.
    1. Delete Tomatoware bash and install entware bash.
    2. Replace bash binary with a new one uploaded under the v0.8 release.
    3. Update to v0.8.1.
     
  50. leandroong

    leandroong Addicted to LI Member

    I think there is path error in your /opt/tomatoware/etc/profile
    Missing '/' on ":eek:pt/usr/sbin:eek:pt/sbin:eek:pt/bin"
    tomatoware-0.8.1:
    1. XML_parser(2.41) and inittool (0.50.2) request update for transmission to compile
    2. libxml2 (2.9.1) update - optional
     
    Last edited: Mar 11, 2014
  51. lancethepants

    lancethepants Network Guru Member

    Thanks, I've corrected the path issue.
    1. inttool will probably be in the next release. XML_parser I think is only for help to build inttool, but not sure now.
    2. libxml2 2.9.1 is already included.
    Sometimes when compiling, the configure script may not correctly find libraries. You may have to look for xml options in configure --help and try to tell it where to find things.
     
  52. leandroong

    leandroong Addicted to LI Member

    1. Inorder to compile initltool, you need to compile XML_parser first, then transmission is compilable.
    2. atm I'm compiling aria2, I never thought it would takes so long, more than 2hrs already.
    3. Why are you supporting so many prefix? Ithink, it is sufficent to have the prefix=/opt/tomatoware. That way more easier for you to update. We users will have to adjust...
    4. It would be nice, if the provide opt.tomatoware.tgz, will have root subfolder "tomatoware" I made mistake in the extraction, forgot that I needed to create folder first.
     
  53. leandroong

    leandroong Addicted to LI Member

    New
    @lancethepants,
    1. There are 2 more in path that does not exist in tomato fw:
    - "/opt/usr/sbin" and "/usr/local/sbin"
    2. Glad to report that I managed to successfully compile
    -aria2
    - transmission nightly buld

    Will try to compile MPD next and probably last. I only needed those 3 application at the moment.
    Edit: It seems not possible, one library that is required is not compilable. I'm trying to compile glib 2.38.2. Fail on ./configure
    Code:
    /media/optware/build/glib/glib-2.38.2 # ./configure --prefix=/opt/tomatoware
    configure: error: cannot find sources (glib/glib.h) in . or ..
    
    Anyway, I have my old version running well. No need to compile. Just evaluating tomatoware and I'm very impress.
     
    Last edited: Mar 11, 2014
  54. lancethepants

    lancethepants Network Guru Member

    1. I'll look a including intltool in the future.
    2. Aria2 seems like it takes forever even on x86 to compile.
    3. I personally like having mine in /mmc. Maybe I will limit options in the future.
    4. I'll try to do this for future releases.

    Those locations in the path are also in the entware profile. Maybe other firmwares that entware and tomatoware can work with might use those locations.

    I tried very hard before to get the latest MPD, but it requires newer versions glib2, which don't work with the kernel we're stuck with. If I remember right, in the future they plan to remove the glib2 dependency, could take a long time though.

    Thanks for the help and evaluation so far.
    https://github.com/lancethepants/tomatoware/blob/master/THANKS
    I hope it can be a useful tool for others, I certainly have found it useful.
     
  55. leandroong

    leandroong Addicted to LI Member

    1. It took me 6hrs and 45mins to complete aria2 compilation.
    2. Addl bug observe:
    - /opt/etc/profile path is being modified. Not sure if that is result of compilation. Repeating of words at the end of the path, not sure if i remember correctly, ":/usr:/usr:". What I did, remove extra and save. Later on it appears again.
    - opkg update get easily broken, it says "permission denied". To remedy this, needed to re-install entware, 3x for latest release. It appears that v8.0 don't inhibit that characteristic.

    Will still monitor your work and experiment from time to time

    Edit: altered path maybe, I'm wrong. Very confusing, look alike
     
    Last edited: Mar 11, 2014
  56. leandroong

    leandroong Addicted to LI Member

    Re-test and download you latest patch "opt.tomatoware".
    1. test compile of tcpdump... ok
    2. opkg update ... ok
    3. Interesting issue, problem now running "make make install" in XML_Parser
    Code:
    /media/optware/build/xml_parser/XML-Parser-2.41 # perl Makefile.PL
    Warning: prerequisite LWP 0 not found.
    Writing Makefile for XML::Parser::Expat
    Writing MYMETA.yml and MYMETA.json
    Writing Makefile for XML::Parser
    Writing MYMETA.yml and MYMETA.json
    /media/optware/build/xml_parser/XML-Parser-2.41 # make make install
    make: *** No rule to make target 'make'.  Stop.
    /media/optware/build/xml_parser/XML-Parser-2.41 #
    
    Note: this is working yesterday.
    Edit: I tested on my WEB tomato router, old version, same result. Seems that I got lucky installing it yesterday.
     
    Last edited: Mar 12, 2014
  57. lancethepants

    lancethepants Network Guru Member

    'make' then run 'make install'
     
  58. leandroong

    leandroong Addicted to LI Member

    Thanks... all working now. Perfect.
     
  59. leandroong

    leandroong Addicted to LI Member

    For info only
    Aria2c (version 1.18.3) binary size comparision
    1. entware compiled ---- 3.61MB
    2. lancetheparts compiled ----- 1.8MB
    3. tomatoware compiled ------ 59.3MB

    atm, I decided to use, tomatoware compiled for both aria2c and transmission. So far, they are tested working well.
     
  60. lancethepants

    lancethepants Network Guru Member

    Did you create a static binary? Check this way
    Code:
    readelf -d ./aria2c
    
    If it gives ...
    Code:
    There is no dynamic section in this file.
    
    Then it is static.

    You can strip the binary to reduce size
    Code:
    strip ./aria2c
    
    I use upx to compress binary to save additional size.
    https://www.google.com/search?q=upx...j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8

    Code:
    upx --ultra-brute ./aria2c
    [CODE]
     
  61. leandroong

    leandroong Addicted to LI Member

    Code:
    /opt/tomatoware/bin # readelf -d ./aria2c
    
    Dynamic section at offset 0x190 contains 45 entries:
      Tag        Type                         Name/Value
    0x00000001 (NEEDED)                     Shared library: [libintl.so.8]
    0x00000001 (NEEDED)                     Shared library: [libc.so.0]
    0x00000001 (NEEDED)                     Shared library: [libhogweed.so.2]
    0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
    0x00000001 (NEEDED)                     Shared library: [liblzma.so.5]
    0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
    0x00000001 (NEEDED)                     Shared library: [libgmp.so.10]
    0x00000001 (NEEDED)                     Shared library: [libnettle.so.4]
    0x00000001 (NEEDED)                     Shared library: [libgnutls.so.28]
    0x00000001 (NEEDED)                     Shared library: [libsqlite3.so.0]
    0x00000001 (NEEDED)                     Shared library: [libxml2.so.2]
    0x00000001 (NEEDED)                     Shared library: [libiconv.so.2]
    0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
    0x00000001 (NEEDED)                     Shared library: [libz.so.1]
    0x00000001 (NEEDED)                     Shared library: [libm.so.0]
    0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
    0x0000000f (RPATH)                      Library rpath: [/opt/tomatoware/lib]
    0x0000000c (INIT)                       0x470ac0
    0x0000000d (FINI)                       0x726f40
    0x00000004 (HASH)                       0x400328
    0x00000005 (STRTAB)                     0x41c928
    0x00000006 (SYMTAB)                     0x409138
    0x0000000a (STRSZ)                      295808 (bytes)
    0x0000000b (SYMENT)                     16 (bytes)
    0x70000016 (MIPS_RLD_MAP)               0x7ba510
    0x00000015 (DEBUG)                      0x0
    0x00000003 (PLTGOT)                     0x7ba520
    0x00000011 (REL)                        0x4674d8
    0x00000012 (RELSZ)                      8464 (bytes)
    0x00000013 (RELENT)                     8 (bytes)
    0x70000001 (MIPS_RLD_VERSION)           1
    0x70000005 (MIPS_FLAGS)                 NOTPOT
    0x70000006 (MIPS_BASE_ADDRESS)          0x400000
    0x7000000a (MIPS_LOCAL_GOTNO)           4705
    0x70000011 (MIPS_SYMTABNO)              4991
    0x70000012 (MIPS_UNREFEXTNO)            42
    0x70000013 (MIPS_GOTSYM)                0x122c
    0x00000014 (PLTREL)                     REL
    0x00000017 (JMPREL)                     0x470ab0
    0x00000002 (PLTRELSZ)                   16 (bytes)
    0x70000032 (MIPS_PLTGOT)                0x7ba310
    0x6ffffffe (VERNEED)                    0x4673a8
    0x6fffffff (VERNEEDNUM)                 4
    0x6ffffff0 (VERSYM)                     0x464ca8
    0x00000000 (NULL)                       0x0
    /opt/tomatoware/bin #
    
     
  62. leandroong

    leandroong Addicted to LI Member

    after applying "strip ./aria2c", final size = 3.95MB. Should I do this after compiled?

    Edit: Probably, I will include that in the run script. Thanks... I'm learning a lot.

    Edit2: for transmission, entware and tomatoware, size differs also (568KB vs 10.1MB)

    Possible to include that in tomatoware operation? Maybe not, will just add that in my run script for easier implementation.
     
    Last edited: Mar 12, 2014
    lancethepants likes this.
  63. lancethepants

    lancethepants Network Guru Member

    http://en.wikipedia.org/wiki/Strip_(Unix)
    This explains it better than I can. I may have learned something too. It looks like placing "-s", mentioned in the link, in the LDFLAGS should strip automatically when linking. I usually just run strip after compiling.
     
  64. crai

    crai LI Guru Member

    Hi lancethepants,
    First sorry for my English.
    Today I have replaced my Asterisk 1.6/Optware with Tomatoware 0.8/Asterisk 11.8 in my home office PBX and for now is workig ok
    The Asterisk 11 in Optware fail with IAX2 that is necessary for me. Idem Asterisk 1.8 from Entware.
    Finally with Tomatoware I could upgrade my old Asterisk 1.6.
    I compiled my AGI applications written in C successfully.
    Thanks a lot for your great work.
     
  65. lancethepants

    lancethepants Network Guru Member

    Thanks for posting! I'm glad you've found tomatoware useful.
     
  66. noyp

    noyp Network Guru Member

    hi lance,

    been using tomatoware for sometime now, will it work on ARM routers ? im planning to purchase ac56u due to its great processing power and wonder if tomatoware will run on that environment.

    regards,
    noyp
     
  67. lancethepants

    lancethepants Network Guru Member

    Unfortunately no.

    I've contemplated about porting Tomatoware to arm, since entware for arm does not exist (maybe optware though). Tomatoware would especially be useful and relevant for that platform, particularly because of its greater processing power. Compiling would be much faster compared to mips devices. I've used the raspberry pi, and looking at the specs, these routers should outperform it (by a decent margin).

    My biggest issue will be finding a suitable toolchain. I really like entware's because it is relatively new. I looked at the merlin arm toolchain once for his asuswrt, and it's not even as up-to-date as entware. If I remember right, it's old enough that it wouldn't even compile some things that entware can. I imagine tomato will be starting with the same base, and will be using the same toolchain. Maybe I will have to look at buildroot or openwrt toolchains. Sometimes these embedded system are so patched though, you may not even be able to use an off-the-shelf toolchain.
     
  68. leandroong

    leandroong Addicted to LI Member

    @lancethepants,
    For info, I tried compiling glib-2.28.x, from 0 to 8, all having same source code issue. Dependency required, libiconv, which I managed to compile successfuly. I'm curious if this is entware issue? Look like source code to me.

    edit2: If this get successfully compiled, will try mpd next. Mpd will not be compiled if physical usb audio is not detectable, will do that on my slow router. I'll wait your feedback first ...
     
    Last edited: Mar 20, 2014
  69. lancethepants

    lancethepants Network Guru Member

    Digging back through the MPD thread I was reminded of this post.
    http://www.linksysinfo.org/index.php?threads/mpd-0-18-5-compilation-error-help.69353/#post-238711
    Pretty much I think we're stuck with glib-2.26.1 as being the latest verison of glib2 we'll see for Tomato firmware.

    The entware maintainer ryzhov_al states that glib2 version older than that just won't with ther kernel (which we're stuck with).
    http://wl500g-repo.googlecode.com/svn/trunk/TODO

    Pretty much a limitation of the kernel we're using I think, which we can't do anything about.
    I was able to get newer versions of MPD to compile with newer glib2, but the resulting binaries didn't work I guess.
     
  70. leandroong

    leandroong Addicted to LI Member

    Yes, your binary has problem, It fails to load mpd.conf. Syntax to run, "mpd mpd.conf"
    Edit: mpd, entware repo, size is 395KB
    Edit: entware repo has 2 binary files, mpd-full and mpd-mini
     
    Last edited: Mar 20, 2014
  71. leandroong

    leandroong Addicted to LI Member

    Good new, tomatoware was able to compile glib-2.28.8. I use entware partial configuration as follow:
    Code:
    ./configure --prefix=/opt/tomatoware --enable-shared --enable-static --enable-debug=no --disable-selinux --disable-fam --with-libiconv=gnu glib_cv_stack_grows=no glib_cv_uscore=no
    Edit: now compiling libflac
    Code:
    ./configure --prefix=/opt/tomatoware --disable-cpplibs --disable-sse --disable-3dnow --disable-altivec --disable-doxgen-docs --disable-local-xmms-plugin --disable-xmms-plugin --disable-ogg --disable-oggtest --disable-debug
    Edir2: success. Now compiling mpd

    Edit3: failed
    Code:
    In file included from src/system/SignalFD.cxx:28:0:
    /opt/tomatoware/include/sys/signalfd.h:91:19: error: expected initializer before 'throw'
    src/system/SignalFD.cxx: In member function 'void SignalFD::Create(const sigset_t&)':
    src/system/SignalFD.cxx:33:7: error: '::signalfd' has not been declared
    Makefile:9557: recipe for target 'src/system/SignalFD.o' failed
    make[1]: *** [src/system/SignalFD.o] Error 1
    make[1]: Leaving directory '/media/optware/build/mpd/mpd-0.18.9'
    Makefile:3235: recipe for target 'all' failed
    make: *** [all] Error 2
    /media/optware/build/mpd/mpd-0.18.9 #
    
    edit4: Indeed entware tool-chain issue
     
    Last edited: Mar 21, 2014
  72. lancethepants

    lancethepants Network Guru Member

    I've added experimental arm support to Tomatoware. The entware toolchain also supports arm targets, so I paired it with the kernel from the Asuswrt-Merlin arm project, and made a new toolchain.

    I actually don't yet have an arm router, so I really don't know if this will work (I'm hopeful), and I need someone to test this out for me.

    Download available here. I've only made one version which mounts to /opt for now.
    https://github.com/lancethepants/tomatoware/releases
     
  73. noyp

    noyp Network Guru Member

    hi lance,

    is asterisk included in this release? i'll try it once my usb to serial ttl cable arrived to recover my ac56u.

    regards,
    noyp
     
  74. lancethepants

    lancethepants Network Guru Member

    Yes, the arm version is identical in functionality including asterisk.
     
  75. noyp

    noyp Network Guru Member

    hi lance,
    got an Illegal instruction trying to run htop, asterisk and drops me back to shell prompt also when compiling, im using vic's tomato raf Beta 9014-v1.3a. for ac56u

    [​IMG]
    [​IMG]
     
    Last edited: Apr 3, 2014
  76. lancethepants

    lancethepants Network Guru Member

    darn, well I guess I'll have to buy me an arm router to figure this out easier. Got my tax refund on the way anyway. Thanks for taking a look.
     
  77. noyp

    noyp Network Guru Member

    how about merlin's ac56u fw, will tomatoware work on those builds ?
     
  78. lancethepants

    lancethepants Network Guru Member

    If it doesn't work with one firmware it shouldn't on any firmware. It'll be an issue with my toolchain that I'll need to figure out. I suspect the entware maintainer is going to port entware to arm, so I could use that toolchain if I don't have it by then (if he even ports it).
     
  79. lancethepants

    lancethepants Network Guru Member

  80. leandroong

    leandroong Addicted to LI Member

    Thanks again. No issues with recompilation.
    Nice to have similar function to "opkg list_installed", I want to be able to immediately see what repositories installed on tomatoware ?
     
  81. lancethepants

    lancethepants Network Guru Member

    Sorry, it doesn't have a way to keep track of what you've compiled. Tomatoware is just one single package, minimal enough to give be reasonable development environment
     
  82. heham

    heham Network Newbie Member

    How to make an ipk file after run "make" ?
     
  83. lancethepants

    lancethepants Network Guru Member

    I'm unfamiliar with how ipks are made. I use the entware toolchain, but not the entware ipk packaging system.

    Essentially all an ipk is the end result binary put into a package (with some dependency checking and other stuff). I then recommend making a static binary. This way the binary can easily be transferred and used by itself in different systems without having to package the libraries with it. Everything is included into the binary, so no dependencies and no need for dependency checking like ipks need to use.

    If the the source you're compiling is autoconf based (has configure script), you can *usually* accomplish this with the following.

    Code:
    ./configure LDFLAGS="-static"
    
    If it is just a Makefile, usually throwing "-static" in the LDFLAGS will accomplish the same thing.

    Once compiled, you can check if the binary was made successfully statically with

    Code:
    readelf -d ./binary
    
    If you see this

    then it compiled successfully as a static binary, and now can be easily used in any supported router stand-alone.
    If you need any other assistance I'm happy to help.
     
    Last edited: May 6, 2014
  84. heham

    heham Network Newbie Member

    Thank you!I will use "-static" to compile.
     
  85. noyp

    noyp Network Guru Member

    hi lance,
    do u have any idea where to get linux-headers for kernel 2.6.22.19 i got this error trying to compile dahdi for asterisk meetme application "You do not appear to have the sources for the 2.6.22.19 kernel installed"

    thanks
     
  86. koitsu

    koitsu Network Guru Member

    For full compatibility you should be checking out the official TomatoUSB source code. The relevant bits are in release/src/linux/linux. I do not recommend finding some random linux-headers package or tarball and dropping it into place; there are numerous patches and adjustments applied to the Tomato source (including kernel, as I understand it).
     
  87. lancethepants

    lancethepants Network Guru Member

    Since tomatoware uses the entware toolchain, it has the linux-headers that entware uses (which also is 2.6.22.19).
    In the entware toolchain build process there is quite a bit of patches that entware does on the linux-headers. It probably gets something pretty close to what tomato has.
    For ensured compatibility with tomato firmware, I agree with @koitsu that the headers from tomato would ensure complete compatibility. I don't know how similar or dissimilar the two are. It would be enlightening to perform a diff on the two.
    Entware however does have a pretty good track record, and I think the headers provided would probably suffice.

    I think the application you're trying to compile likely is looking in the standard places for the headers. Entware/Tomaoware a far from being similar to 'standard' setups. Take a look at your configure options, and see if there is an option that allows you to manually specify the location of the headers.

    edit: I was doing some more research and I may see a problem. Dahdi is an optional prerequisite to asterisk. I have not included dahdi, because it is used with telephony hardware, which routers can't interface with. On the web site however it does say this.

    That could also be causing your header issue, because dahdi is not there. I've been debating and have decided on divorcing asterisk from tomatoware, and having it be it's own project. I'm not sure when I'll get around to this though. I can say within a few weeks, and I can look into adding this too.

    For the time being, If you're really ambitious, you could try compiling dahdi, then (re)compiling asterisk, then proceed with your application. The first time I compiled asterisk, I in fact did it on the router.
     
  88. noyp

    noyp Network Guru Member

    thanks koitsu, 'ill try it
     
  89. noyp

    noyp Network Guru Member

    hi lance,
    probably you're right, dahdi looks for standard linux-headers and standard location, i've copied the linux source from git in /mmc/usr/src/linux and it still failed to compile.

    thanks
     
  90. heham

    heham Network Newbie Member

    Sometime i need more library,how to install it ?EX:library gpgme.I have installed it in entware but unuseful.Copy it in tomatoware?

    I have compiled the library on tomatoware and copy the files in tomatoware,it seems worked.
     
    Last edited: May 7, 2014
  91. lancethepants

    lancethepants Network Guru Member

    Glad you figured it out. Yes, you cannot use libraries from entware. Tomatoware comes with a bunch of libraries, and any other library prerequisite you have you must compile on you own with Tomatoware.
     
  92. leandroong

    leandroong Addicted to LI Member

    I found 1 tomatoware advantage over entware compilation. Can't compile transmission nightly build rev 14272 due to upgrade of miniupnpc from 1.8 to 1.9.
     
  93. ryzhov_al

    ryzhov_al Networkin' Nut Member

    Here. It's quite close to Tomato kernel.
     
    Last edited: May 10, 2014
  94. leandroong

    leandroong Addicted to LI Member

    @ryzhov, sorry I dont meant bad. Im just pointing what I discover. First time actually for entware optware that I failed to build and find it weird as to why tomatoware was able to compile it. This is just thought sharing and maybe someone can figure out reason behind. Next time, I will just post on your site regarding entware optware issue and not repeat here in tomato.
     
  95. leandroong

    leandroong Addicted to LI Member

    @lancethepants, I'm testing to test compile "transmission-mipsel-static" on my router. I got halted in the process, error as follow:
    Code:
    mipsel-linux-gcc -I. -I.. -I../include -I/media/optware/build/static/transmissio             n/opt/include -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DL             FCN -DHAVE_DLFCN_H -ffunction-sections -fdata-sections -DL_ENDIAN -DTERMIO -O3 -             mtune=mips32 -mips32 -fomit-frame-pointer -Wall -DSHA1_ASM -DSHA256_ASM -DAES_AS             M   -c -o mem_clr.o mem_clr.c
    mipsel-linux-ar r ../libcrypto.a cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o              cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o              mem_clr.o
    make[1]: mipsel-linux-ar: Command not found
    Makefile:107: recipe for target '../libcrypto.a' failed
    make[1]: *** [../libcrypto.a] Error 127
    make[1]: Leaving directory '/media/optware/build/static/transmission/src/openssl             /openssl-1.0.1g/crypto'
    Makefile:278: recipe for target 'build_crypto' failed
    make: *** [build_crypto] Error 1
    
    2. If I want to compile this on ubuntu pc , how would I implement it?
     
  96. lancethepants

    lancethepants Network Guru Member

    repo 'transmission-mipsel-static' is how I cross compile transmission on x86. You can make a static binary on the router too, and I recommend it. Then it is all self-contained. It can be tricky sometimes, and takes a little bit of googling.

    1. On the router, typically you will run
    Code:
    LDFLAGS="-static" ./configure
    
    In the case of transmission and the toolchain we use, you'll probably need to run
    Code:
    LDFLAGS="-zmuldefs -static" ./configure
    
    Because we get a 'multiple definitions' sort of error. Possibly other hangups. If out, "undefined reference to ...", then sometimes you have to run make and tell it to add libraries it is missing. Google the errors. For example, something like this
    Code:
    make LIBS="-lssl -lcrypto -lz ....."
    

    2. Since you should already have the entware toolchain, you can use that, for cross compilingn on x86.
    Code:
    export PATH=$PATH:/opt/entware/toolchain-entware/bin:/opt/entware/toolchain-entware/mipsel-linux-uclibc/bin
    
    Check your path to see that it matches. Then run the script. If you're trying to compile some svn version, you may run into issues as you've seen. Maybe disable libupnpc. The error you encountered is quite common when cross-compiling. It takes more research and possibly patches to fix. OpenWRT/entware are filled with patches to fix with cross-compilation. That is where I go to see the patches, and how they are compiling things. If it is too new though, you're on your own. Tomatoware can be advantageous, because it compiles natively, and avoids issues sometimes encountered when cross-compiling.
     
    Last edited: May 11, 2014
  97. leandroong

    leandroong Addicted to LI Member

    Thanks for the informative information. I can't get your provided transmission.sh to compile w/out errors. Anyway, it seems better to stick on tomatoware.
    Re-tested compiling transmission, nightly revision, with static, using "LDFLAGS="-static" ./configure --prefix=/opt/tomatoware". Result has dynamic dependency:

     
  98. leandroong

    leandroong Addicted to LI Member

    for ubuntu pc, transmission-mipsel-static, it start compiling after I change PATH to "export PATH=$PATH:/opt/entware-toolchain/bin:/opt/entware-toolchain/mipsel-linux-uclibc/bin"

    Thanks again.
     
  99. lancethepants

    lancethepants Network Guru Member

    I'd forgotten, in some cases, transmission included, you need to use -all-static instead if -static. Many projects use libtool (which I don't care too much for) to help with compilation
     
  100. noyp

    noyp Network Guru Member

    thanks ryzhov_al, ill give it another shot.
     

Share This Page