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

Need help - Compile error on AdvancedTomato

Discussion in 'Tomato Firmware' started by moti_lyb, Sep 9, 2017.

  1. moti_lyb

    moti_lyb New Member Member

    I am trying to compile AdvancedTomato for my R7000 to enable iptables TPROXY.

    I have been trying to follow the steps to compile the firmware but finally stuck in a Linux module (or kernal?) call "rc".

    What I have done:
    1. Setup a VM, host OS is Linux 16.04
    2. Install the packages required in the AdanvancedTomato FAQ.
    3. Clone the sourcecode from Github
    4. Link the toolchains in the sourcecode to /opt/toolchains, and add the bin directories under the toolchains to the PATH.
    5. after that I cd ~/tomato/release/src-rt-6.x.4708, and enter command "make r7000z" to compile R7000 firmware.
    6. There was a lot of output on the screen and then exit with error and looks like the module causing the error is "rc".

    Has been troubleshooting this for a few days but all ended up with the same error... Also tried to download the sourcecode of 140 but same. Guess I have setup the environment wrongly but I'm just not find that out...

    Any comment or help will be appreciated.


    Following is error message (cut those not related to the error).

    Code:
    compile@ubuntu:~/tomato$ cd release
    compile@ubuntu:~/tomato/release$ cd src*
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$ echo $PATH
    /opt/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin:/opt/toolchains/hndtools-armeabi-2011.09/bin:/home/compile/bin:/home/compile/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$ make r7000z
    
    ...
    ...
    ...
    
     rc
    make[5]: Entering directory '/home/compile/tomato/release/src-rt-6.x.4708/router/rc'
     [rc] CC rc.o
     [rc] CC init.o
    init.c: In function ‘restore_defaults’:
    init.c:167:6: warning: unused variable ‘model’
    init.c:166:6: warning: unused variable ‘unit’
    init.c:165:48: warning: unused variable ‘tmp’
    init.c:165:7: warning: unused variable ‘prefix’
    init.c: In function ‘find_sercom_mac_addr’:
    init.c:453:2: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:332:12: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
    init.c:454:2: warning: pointer targets in passing argument 1 of ‘fopen’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:239:14: note: expected ‘const char * __restrict__’ but argument is of type ‘unsigned char *’
    init.c:459:4: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:332:12: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
    init.c:460:3: warning: pointer targets in passing argument 2 of ‘nvram_set’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/include/bcmnvram.h:154:12: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
    init.c:461:3: warning: pointer targets in passing argument 1 of ‘invalid_mac’ differ in signedness
    init.c:443:19: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
    init.c: In function ‘init_nvram’:
    init.c:1711:4: warning: implicit declaration of function ‘wl_defaults’
    init.c:1712:4: warning: implicit declaration of function ‘bsd_defaults’
    init.c:1713:4: warning: implicit declaration of function ‘set_bcm4360ac_vars’
    init.c:1787:4: warning: implicit declaration of function ‘set_r8000_vars’
    init.c: In function ‘restore_defaults’:
    init.c:170:4: warning: ‘restore_defaults’ is used uninitialized in this function
     [rc] CC interface.o
    interface.c: In function ‘start_vlan’:
    interface.c:239:3: warning: pointer targets in passing argument 2 of ‘ether_atoe’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shutils.h:114:12: note: expected ‘unsigned char *’ but argument is of type ‘char *’
     [rc] CC network.o
    network.c: In function ‘start_lan’:
    network.c:979:3: warning: pointer targets in passing argument 1 of ‘ether_etoa’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shutils.h:122:15: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
     [rc] CC wan.o
    wan.c: In function ‘start_wan_if’:
    wan.c:927:3: warning: suggest parentheses around assignment used as truth value
    wan.c:987:3: warning: pointer targets in passing argument 1 of ‘ether_etoa’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shutils.h:122:15: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
    wan.c: At top level:
    wan.c:47:13: warning: ‘make_secrets’ defined but not used
     [rc] CC services.o
    services.c: In function ‘start_dnsmasq’:
    services.c:92:6: warning: unused variable ‘service’
    services.c:91:15: warning: unused variable ‘do_6rd’
    services.c:91:6: warning: unused variable ‘do_6to4’
    services.c:90:24: warning: unused variable ‘mtu’
    services.c:90:17: warning: unused variable ‘ipv6’
    services.c:90:8: warning: unused variable ‘prefix’
    services.c: In function ‘start_ntpc’:
    services.c:1595:14: warning: unused variable ‘servers’
    services.c: In function ‘stop_samba’:
    services.c:2186:2: warning: implicit declaration of function ‘enable_gro’
    services.c: At top level:
    services.c:2193:6: warning: conflicting types for ‘enable_gro’
    services.c:2186:2: note: previous implicit declaration of ‘enable_gro’ was here
     [rc] CC dhcp.o
    dhcp.c: In function ‘dhcp6c_state_main’:
    dhcp.c:531:11: warning: assignment discards qualifiers from pointer target type
     [rc] CC firewall.o
     [rc] CC ppp.o
    ppp.c: In function ‘ipup_main’:
    ppp.c:106:4: warning: suggest parentheses around assignment used as truth value
     [rc] CC telssh.o
    telssh.c: In function ‘create_passwd’:
    telssh.c:24:2: warning: pointer targets in passing argument 1 of ‘base64_encode’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shared.h:375:12: note: expected ‘unsigned char *’ but argument is of type ‘char *’
     [rc] CC wnas.o
    wnas.c: In function ‘nas_starter’:
    wnas.c:99:3: warning: implicit declaration of function ‘is_sta’
    wnas.c: At top level:
    wnas.c:71:12: warning: ‘nas_starter’ defined but not used
     [rc] CC listen.o
     [rc] CC redial.o
     [rc] CC led.o
     [rc] CC qos.o
    qos.c: In function ‘ipt_qos’:
    qos.c:61:6: warning: unused variable ‘qosImqDeviceNumberString’
     [rc] CC forward.o
     [rc] CC misc.o
    misc.c: In function ‘run_userfile’:
    misc.c:160:2: warning: pointer targets in initialization differ in signedness
    misc.c:169:4: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:332:12: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
    misc.c: In function ‘write_ct_timeout’:
    misc.c:287:3: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:332:12: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
    misc.c:290:2: warning: pointer targets in passing argument 1 of ‘f_write_string’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shared.h:334:12: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
    misc.c: In function ‘read_ct_timeout’:
    misc.c:308:3: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
    /home/compile/140/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin/../arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/stdio.h:332:12: note: expected ‘char * __restrict__’ but argument is of type ‘unsigned char *’
    misc.c:309:2: warning: pointer targets in passing argument 1 of ‘f_read_string’ differ in signedness
    /home/compile/tomato/release/src-rt-6.x.4708/router/shared/shared.h:333:12: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
     [rc] CC mtd.o
    mtd.c: In function ‘mtd_write_main_old’:
    mtd.c:236:9: warning: unused variable ‘crc’
    mtd.c:235:21: warning: unused variable ‘cth’
    mtd.c:234:9: warning: unused variable ‘sig’
     [rc] CC buttons.o
    buttons.c: In function ‘buttons_main’:
    buttons.c:37:11: warning: ‘reset_mask’ may be used uninitialized in this function
     [rc] CC restrict.o
     [rc] CC gpio.o
     [rc] CC sched.o
     [rc] CC new_qoslimit.o
     [rc] CC arpbind.o
     [rc] CC tomatoanon.o
     [rc] CC blink.o
     [rc] CC bcmutils.o
     [rc] CC blink_5g.o
     [rc] CC mwan.o
    mwan.c: In function ‘mwan_status_update’:
    mwan.c:282:7: warning: unused variable ‘tmp’
     [rc] CC pbr.o
     [rc] CC usb.o
     [rc] CC ddns.o
     [rc] CC cifs.o
     [rc] CC jffs2.o
     [rc] CC vpn.o
     [rc] CC tinc.o
     [rc] CC pptpd.o
    pptpd.c: In function ‘write_pptpd_dnsmasq_config’:
    pptpd.c:342:6: warning: unused variable ‘i’
     [rc] CC pptp_client.o
    pptp_client.c: In function ‘pptp_client_table_add’:
    pptp_client.c:389:5: warning: implicit declaration of function ‘get_cidr’
     [rc] CC nocat.o
     [rc] CC nginx.o
    nginx.c: In function ‘build_nginx_conf’:
    nginx.c:307:4: warning: ‘return’ with no value, in function returning non-void
     [rc] CC mysql.o
     [rc] CC transmission.o
    transmission.c: In function ‘start_bittorrent’:
    transmission.c:31:11: warning: unused variable ‘ps’
     [rc] CC nfs.o
    nfs.c: In function ‘start_nfs’:
    nfs.c:12:11: warning: ‘fp’ may be used uninitialized in this function
     [rc] CC snmp.o
     [rc] CC ups.o
    ups.c: In function ‘start_ups’:
    ups.c:13:11: warning: unused variable ‘fpc’
    ups.c:12:11: warning: unused variable ‘fpm’
     [rc] CC tor.o
     [rc] CC rc
    init.o: In function `sysinit':
    init.c:(.text.sysinit+0x2c44): undefined reference to `wl_defaults'
    init.c:(.text.sysinit+0x2c48): undefined reference to `bsd_defaults'
    init.c:(.text.sysinit+0x2c4c): undefined reference to `set_bcm4360ac_vars'
    init.c:(.text.sysinit+0x2ec0): undefined reference to `wl_defaults'
    init.c:(.text.sysinit+0x2ec4): undefined reference to `bsd_defaults'
    init.c:(.text.sysinit+0x2ec8): undefined reference to `set_r8000_vars'
    collect2: ld returned 1 exit status
    Makefile:120: recipe for target 'rc' failed
    make[5]: *** [rc] Error 1
    make[5]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708/router/rc'
    Makefile:2970: recipe for target 'rc' failed
    make[4]: *** [rc] Error 2
    make[4]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708/router'
    Makefile:127: recipe for target 'all' failed
    make[3]: *** [all] Error 2
    make[3]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:1079: recipe for target 'bin' failed
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:1098: recipe for target 'z' failed
    make[1]: *** [z] Error 2
    make[1]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:1119: recipe for target 'r7000z' failed
    make: *** [r7000z] Error 2
    
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$
     
  2. Sean B.

    Sean B. LI Guru Member

    I believe Shibbys source ( which Advanced Tomato uses ) still uses the same compile setup as Toastmans builds and the other Tomato variants. In which case your path addition, and probably symlink sense it would match the path addition, are formatted incorrectly and linked to the wrong source directory. The symlink needs to be to /opt/brcm-arm from ~/tomato/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 and the path addition needs to be /opt/brcm-arm/bin. As follows:

    Code:
    ln -s ~/tomato/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 /opt/brcm-arm
    export PATH="${PATH}:/opt/brcm-arm/bin"
    And make sure the build packages you installed are exactly the same version as required.

    Also, just in case you've tried doing it some other way, to enable TPROXY all you have to do is change line #523 ( may not be the same line # from Shibby source, but you can find it ) in "~/tomato/release/src-rt-6.x.4708/linux/linux-2.6.36/config_base" from this:

    Code:
    # CONFIG_NETFILTER_TPROXY is not set
    To this:

    Code:
    CONFIG_NETFILTER_TPROXY=y
    And add this in between other lines around the #562 area.. just mixed in somewhere with the other xt_match lines:

    Code:
    CONFIG_NETFILTER_XT_MATCH_SOCKET=y
    I enabled TPROXY in my builds way back when I started messing with Tomato. Not sure why any of the Dev's haven't enabled it by default, as it's quite useful.
     
    Last edited: Sep 10, 2017
    moti_lyb likes this.
  3. AndreDVJ

    AndreDVJ Addicted to LI Member

    I switched to Debian 9, and so far most trouble-free distro I am using. I was unable to compile newer versions of nano and libcurl with Debian 8.

    @Sean B. hijacking the thread with unrelated stuff - Any benefits of enabling TPROXY in Tomato? I'm pretty ignorant with networking tools on Linux to be honest.
     
  4. Sean B.

    Sean B. LI Guru Member

    If you do any type of sniffing/transparent proxy/redirects etc, yes very much so. For me, I use squid proxy on the router and transparently proxy the kid's web activities for logging. Here's a brief overview snippit from some docs:

    And unlike REDIRECT, you can specify the destination IP and port.. for instance if you want to run a proxy on a full linux box rather than run the software on the router itself.
     
    Last edited: Sep 10, 2017
    AndreDVJ likes this.
  5. AndreDVJ

    AndreDVJ Addicted to LI Member

    I made these changes to config_base, is this required as well?
    Code:
    CONFIG_NETFILTER_XT_TARGET_TPROXY=y
    I was prompted by this while compiling:
    Code:
    "TPROXY" target support (EXPERIMENTAL) (NETFILTER_XT_TARGET_TPROXY) [N/m/y/?] (NEW)
     
  6. Sean B.

    Sean B. LI Guru Member

    Yes, netfilter socket matching is required. Almost forgot, had to edit it in to my previous post.

    And yes, just hit y when prompted. There's likely a way to prevent the prompt, probably with oldconfig or a kconfig in a different section of the source tree. I didn't bother to track it down, as I just hit y at the prompt.
     
  7. moti_lyb

    moti_lyb New Member Member

    Thanks Sean!

    I tried to redo the symlink as per your recommendation but still got the same failure.
    Also tried to check the version for packages - the bison was upgraded to 3.0 so I downgraded it back to 2.7.1, but still got the same failure.

    After that I tried to make some changes to the source code - the error was in sysinit function of router/rc/init.c, and after commenting below lines which is causing the error, the compilation moved ahead...

    However this does not make much sense to me... looks like the codes below is for R8000/RTAC3200, however I compile the firmware for R7000 with command "make r7000z". OK, I might not understand the codes fully but guess there should have been same failure with the codes if someone else tries to compile the source code but looks like no one reported the issue... but anyway looks like it has been worked around...

    Code:
    case MODEL_RTAC3200:
                 ....
                 ....
                //wl_defaults();
                //bsd_defaults();
                //set_r8000_vars();
            }
            break;
    
    case MODEL_R8000:
                 ....
                 ....
                //wl_defaults();
                //bsd_defaults();
                //set_bcm4360ac_vars();
            }
            break;
    Code:
     [rc] CC rc
    init.o: In function `sysinit':
    init.c:(.text.sysinit+0x2c44): undefined reference to `wl_defaults'
    init.c:(.text.sysinit+0x2c48): undefined reference to `bsd_defaults'
    init.c:(.text.sysinit+0x2c4c): undefined reference to `set_bcm4360ac_vars'
    init.c:(.text.sysinit+0x2ec0): undefined reference to `wl_defaults'
    init.c:(.text.sysinit+0x2ec4): undefined reference to `bsd_defaults'
    init.c:(.text.sysinit+0x2ec8): undefined reference to `set_r8000_vars'
    collect2: ld returned 1 exit status
    Makefile:120: recipe for target 'rc' failed
    make[5]: *** [rc] Error 1
     
  8. moti_lyb

    moti_lyb New Member Member

    And thanks for the config_base. For the TPROXY, I believe it is still "EXPERIMENTAL" in Linux kernel so guess that's why it is not included by default.
     
  9. moti_lyb

    moti_lyb New Member Member

    So no one encounter the same error as me on the "rc" module?

    Sean and AndreDVJ, do you mind sharing the links of source code you downloaded and the router model you build the firmware?
     
  10. Sean B.

    Sean B. LI Guru Member

    You're welcome. And it was experimental.. back in say maybe 2012? Somewhere around there.. when the 2.6.36 kernel came out. The kernel we have to use thanks to Broadcom is rather old.
     
  11. Sean B.

    Sean B. LI Guru Member

    I use Toastman's source as the base for my builds.. ARM branch, built for an RT-AC68P

    http://repo.or.cz/tomato.git/tree/281dfcdda889f30e5bdb4aa91f160bd105fbc6ae
     
  12. AndreDVJ

    AndreDVJ Addicted to LI Member

    Compilation is failing at your end because you checked out the wrong branch, meant for SDK7 routers (R8000 & AC3200). I verified and set_r8000_vars function only exists in the SDK7 (shibby-arm7) branch.

    I actually own a repo: https://bitbucket.org/AndreDVJ/advancedtomato-arm

    I build for R7000 and R8000 as I own these routers.

    EDIT:

    Ensure you have git installed. Makes your life much easier including resetting local repository to a clean state.

    Try these inside tomato-arm repository: i.e. ~/tomato-arm/release/

    1) git clean -fdxq && git reset --hard
    2) git checkout shibby-arm
     
    moti_lyb likes this.
  13. Sean B.

    Sean B. LI Guru Member

    Impressive catch! Nice job.
     
  14. moti_lyb

    moti_lyb New Member Member

    Thanks again both!

    ok, let me tried to checkout the right branch. I had an impression I did checkout the arm7 when I tried to fix some other issues as I thought the R7000 is under arm7 branch... That might be the cause.

    Btw, is there a way I can compile specific the 140 release under Jacky's repository. What I need is just to enable TPROXY, and a stable release is preferrable. I have git clone the sourcecode and also download the zip file of 140 release of AdvancedTomato. Can I simply copy the files in 140 release to the folder I cloned from the online respository?
     
  15. Sean B.

    Sean B. LI Guru Member

    run the command: git tag
    Find the tag with the version you want.. maybe something like adv-tomato-v140
    run the command: git checkout whatever-the-tag-was
     
    moti_lyb likes this.
  16. moti_lyb

    moti_lyb New Member Member

    Finally the issues I see in the rc module went away, after clean the repository and reset it back to arm from arm7.

    Thanks Sean and AndreDVJ! I really appreciate every help you have offered to me:)!
     
  17. Sean B.

    Sean B. LI Guru Member

    Glad you've got it working. Was I correct on the symlink and path? Curious if Shibby source is any different than what I'm used to.
     
  18. moti_lyb

    moti_lyb New Member Member

    I believe it is a combination of both symlink+path and git version.
    I checked out the correct arm version, and ln ~/tomato/release/src-rt-6.x.4708/toolchains to /opt/toolchains. The build failed again in the "rc" module again with different error.

    The compilation now fails on "mysql" after a long run due to some error of cross chain compilation and I am looking into this now.
     
  19. moti_lyb

    moti_lyb New Member Member

    but now I am confused. under the advancedtomato, there are two branches, arm and arm7. The R7000 is under arm. My thought is to use the arm branch in v140 to compile, but after I checkout v140, looks like the snapshot is for arm7, so I got the error of set_r8000 again. Is what I am trying to do is practical?


    Code:
    compile@ubuntu:~/tomato$ git branch -r
      origin/HEAD -> origin/arm
      origin/arm
      origin/arm7
    compile@ubuntu:~/tomato/release$ git tag
    AdvancedTomato_Intergration
    v127
    v128
    v130
    v131
    v132
    v138
    v140
    
     
    Last edited: Sep 10, 2017
  20. AndreDVJ

    AndreDVJ Addicted to LI Member

    Try checking out arm branch:
    Code:
    git checkout arm
    Then reset the repository to a clean state:
    Code:
    git clean -fdxq && git reset --hard
    Then go to the HEAD of repository (most recent commit)
    Code:
    git pull
    This should get you started. I checked Jacky's repo and relevant code for R8000 and AC3200 are present only in the arm7 branch.
     
  21. Sean B.

    Sean B. LI Guru Member

    That is not the correct path or symlink.. check my initial post.

    First, log out/log back in or just reboot to clear your path ( providing you didn't at it to your profile, if you did.. remove that before rebooting ). Then, run these commands exactly as shown ( use sudo where needed though ).

    Remove the symlink you have already made:

    Code:
    rm /opt/toolchains
    make the correct symlink:

    Code:
    ln -s ~/tomato/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 /opt/brcm-arm
    set the correct path:

    Code:
    export PATH="${PATH}:/opt/brcm-arm/bin"
    Compile.

    You will get build errors if the link and path are not correct, as non of the executables in the source's toolchain will run if they aren't.
     
  22. moti_lyb

    moti_lyb New Member Member

    I thought I have fixed the issue of git branches and the build environment but looks like I am not...

    Following is what I have, so guess I have got the correct git branch and the symlink and path?

    Code:
    compile@ubuntu:~/tomato$ git checkout arm
    Already on 'arm'
    Your branch is up-to-date with 'origin/arm'.
    compile@ubuntu:~/tomato$ git clean -fdxq && git reset --hard
    HEAD is now at 5999e91 IPv6 fix by awesome @tvlz
    compile@ubuntu:~/tomato$ git pull
    Already up-to-date.
    compile@ubuntu:~/tomato$ cd rel*
    compile@ubuntu:~/tomato/release$ cd src*
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$ ls /opt -al
    total 12
    drwxr-xr-x  2 root root 4096 Sep 10 17:57 .
    drwxr-xr-x 26 root root 4096 Sep  6 09:31 ..
    lrwxrwxrwx  1 root root   94 Sep 10 08:45 brcm-arm -> /home/compile/tomato/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$ echo $PATH
    /opt/brcm-arm/bin:/opt/brcm-arm1/bin:/home/compile/bin:/home/compile/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    
    I don't why but I am getting another error again in the "rc" now as below.... ever tried to checkout v138 but still got the same error (v140 seems to be arm7 and I don't know how to make it to arm so tried on v138 which does not have the set_r8000 in source code).

    could you please shed some light on what is going wrongly? Thanks...

    Code:
     [rc] CC tor.o
     [rc] CC rc
       text       data        bss        dec        hex    filename
     331612       1364      13032     346008      54798    rc
    make[5]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708/router/rc'
    ( cd iptables-1.4.x ; ./autogen.sh )
    Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /projects/hnd/tools/linux/hndtools-arm-linux-2.6.36-uclibc-4.5.3/share/autoconf /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /opt/brcm-arm/bin/autoreconf line 40.
    BEGIN failed--compilation aborted at /opt/brcm-arm/bin/autoreconf line 40.
    Makefile:1026: recipe for target 'iptables-1.4.x/configure' failed
    make[4]: *** [iptables-1.4.x/configure] Error 2
    make[4]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708/router'
    Makefile:127: recipe for target 'all' failed
    make[3]: *** [all] Error 2
    make[3]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:962: recipe for target 'bin' failed
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:981: recipe for target 'z' failed
    make[1]: *** [z] Error 2
    make[1]: Leaving directory '/home/compile/tomato/release/src-rt-6.x.4708'
    Makefile:1002: recipe for target 'r7000z' failed
    make: *** [r7000z] Error 2
     
  23. moti_lyb

    moti_lyb New Member Member

    I downloaded repository AndreDVJ published last night and tried to compile just now. And unluckily I got the same error... my setup as below. Guess something else in the environment was wrong now... I am rolling back from a copy of my VM now to try again... if you have any comment, please don't hesitate to share:).

    Code:
    lrwxrwxrwx 1 root root 91 Sep 10 19:01 brcm-arm -> /home/compile/att/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3
    compile@ubuntu:~/att/release/src-rt-6.x.4708$ echo $PATH
    /opt/brcm-arm/bin:/home/compile/bin:/home/compile/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
     
  24. moti_lyb

    moti_lyb New Member Member

    OK, the issue is fixed by below::):)

    Code:
    sudo ln -s /home/compile/tomato/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 /opt/brcm-arm
    And in the PATH, it is

    Code:
    compile@ubuntu:~/tomato/release/src-rt-6.x.4708$ echo $PATH
    /home/compile/bin:/home/compile/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/brcm-arm/bin
    
    Looks like the absolute path must be used when doing the symlink, e.g. /home/compile/tomato....:oops:
     
    Last edited: Sep 11, 2017
  25. Sean B.

    Sean B. LI Guru Member

    You had /opt/brcm-arm/bin at the front of your path in your previous post about it not working. The order of paths is important, as it is a first found first used system for executing binaries.. so when the instructions show PATH="${PATH}:/opt/brcm-arm/bin .. it doesnt mean ignore the instruction and just toss it in wherever, especially after I've repeated it several times. C'mon man, we don't mind helping those that are less experienced, that's all good, but if you're not going to pay attention to what's said and/or keep asking for help while chopping up the instructions each time, you're gonna piss people off. Not tryin to be a dick, just food for thought.
     
  26. moti_lyb

    moti_lyb New Member Member

    Sean, agree with you. The compilation is far more complex in regards of the path dependency than what I have thought. I did not ignore the instructions purposely... some of the instruction I got from the web are in the front and some are in the end. Thought it is just to pass path to the make scripts.

    Putting the /opt/brcm-arm/bin in the front could be one of the reasons I met so many error in the compilation. And after moving /opt/brcm-arm/bin to the end of $PATH and using the absolute path in symlink DID fix the issues and finally I got my first Tomato firmware built a few hours ago and it is now running on my R7000 now!

    Thank you and AndreDVJ again!
     

Share This Page