[Fork] FreshTomato-MIPS

Discussion in 'Tomato Firmware' started by kille72, Apr 26, 2018.

  1. kille72

    kille72 LI Guru Member

    [FreshTomato-MIPS]

    Forked off from Tomato-MIPS by Shibby, builds compiled by FreshTomato team
    FreshTomato team: @kille72 @pedro311

    Latest version: 2018.4 - 2018-09-13
    Source code: https://bitbucket.org/pedro311/freshtomato-mips
    Changelog: FreshTomato-MIPS
    Downloads: https://mega.nz/#F!QywknIpa!5JwWNIfEwCOKXqXG0AOh4w

    For the following MIPSR1 and MIPSR2 routers: Asus WL500GP, N10U, N12B1/C1/D1, N15U, N16, N53, N66U, AC66U Netgear WNR3500LV1, WNR3500LV2, R6300V1, WNDR4500V1, WNDR4500V2 Linksys WRT54 series, E800, E900, E1000v2/v2.1, E1200V1, E1200V2, E1500, E2000, E2500, E3000, E3200,
    E4200 Tenda W1800R, N80 Dlink DIR-320.

    Thanks to @shibby20 @AndreDVJ @Jacky444 @koitsu @M_ars @Vindicator @Sean B. @Toastman @RMerlin @tsynik@tvlz @lancethepants @Elfew @Edrikk and all others who helped me with this project.

    Disclaimer: We are not responsible for any bricked routers, nor do we encourage other people to flash alternative firmwares on their routers. Use at your own risk!

     
    Last edited: Sep 13, 2018
  2. eangulus

    eangulus Network Guru Member

    Are there plans to add MIPSR2?

    Sent from my Pixel XL using Tapatalk
     
  3. koitsu

    koitsu Network Guru Member

    It appears both MIPSR1 and MIPSR2 are supported. Please see https://bitbucket.org/pedro311/freshtomato-mips file README.md (or at the bottom of the page), text starting with "For the following MIPS routers". The RT-N16 is listed, which is MIPSR2. Likewise, WRT54 series consists mainly of MIPSR1, and its listed as well.

    README.md should really say "For the following MIPSR1 and MIPSR2 routers".
     
    kmplsv, pharma and kille72 like this.
  4. pomidor1

    pomidor1 Networkin' Nut Member

    FreshTomato-MIPS

    Asus
    WL500GP, N10U, N12B1/C1/D1, N15U, N16, N53, N66U, AC66U Netgear WNR3500LV1, WNR3500LV2, R6300V1, WNDR4500V1, WNDR4500V2 LinksysWRT54 series, E800, E900, E1000v2/v2.1, E1200V1, E1200V2, E1500, E2000, E2500, E3000, E3200, E4200 Tenda W1800R, N80 Dlink DIR-320.

    FreshTomato-MIPS+ E1550+E2500v3+WNDR3700v3+Tenda N6 and FreshTomato-ARM + Dir868L =Adwanced Tomato ? ;-)?
     
  5. eangulus

    eangulus Network Guru Member

    I've looked at the downloads and all folders are currently empty. The other day there was only mipsr1 and I couldnt see MIPSR2.

    Hence why I asked.

    Sent from my Pixel XL using Tapatalk
     
  6. koitsu

    koitsu Network Guru Member

    Well RT-N16 is MIPSR2, so maybe they just haven't built all the firmwares yet? It can take a VERY long time considering all the variances. Just look at Toastman's directories sometimes, esp. the older ND (MIPSR1) and RT (MIPSR2) and RT-N (MIPSR2) dirs -- packed full. Gotta do a complete fresh rebuild for each and every one of those. I wouldn't be surprised if doing all the variances took literally a few days.
     
  7. eangulus

    eangulus Network Guru Member

    Not too worried about timeframe, I'm patient. Was just wondering that seeing MIPS was being built for,that weather R2 and therefore the rt-n16 was going to be supported.

    Now to just wait and keep checking.

    Sent from my Pixel XL using Tapatalk
     
  8. somms

    somms Network Guru Member

    No joy flashing with the E2000 betas uploaded:(

    [​IMG]
    Even after flushing the NVRAM, the smallest sized E2000 freshtomato firmware build 'freshtomato-E2000USB-NVRAM60K_RT-N5x-MIPSR2-2018.1.066-beta-VPN.bin' fails to flash up from Shibby's build tomato-E2000-NVRAM60K-1.28.RT-MIPSR2-140-IPv6-VPN.bin with the following message:
    [​IMG]

    [​IMG]
    The firmware file size difference between the E2000 Shibby build and the smallest two E2000 freshtomato builds shown above is too big!?
     
  9. txnative

    txnative Networkin' Nut Member

    I've installed the freshtomato-F7D4302_RT-N5x-MIPSR2-2018.1.066-beta-Mini.bin, using the belkin ofw gui, I suppose I didn't have to as to using the cfe or tomato gui. I won't be able to do any testing as of yet, I'm running Andre's build for netgear r6300v2 as he had done recently for qos and bwl issues, but I should be able to connect it to my network tomorrow as gateway, ap, routing, qos, bwl. I don't have vpn or anything to intense on my network. I for one do like mini builds, i'm pretty sure everyone has their own preference although I would like to see some in circulation. (My thoughts)
     
  10. ghoffman

    ghoffman LI Guru Member

    thank you for these bui;lds - a lot more happy routers.
    on yuour next build, could you possibly include a k26-MIPSR1 build for old wrt150/wrt300 type routers (also within the 4mb flsh size)?
     
  11. txnative

    txnative Networkin' Nut Member

    I did some reasonable test but since it's not able to handle my current bandwidth, i was unable to fully do some testing using Qos, however wifi was very responsive using some default settings and for the 2.4, changing transmit pwr as me 28, apsd mode to enable, interference mitigation to wlan auto and noise reduction, i had pretty decent performance after switching channels. 5ghz settings were of the same except for interference mode I used wlan manual. Performance was great for the belkin, no issues on initial setting up and typical web browsing. Unfortunately my belkin doesn't have gigabit ports and more effective cpu, however if users are using bandwidth that is under 75/75 and lower this router would do the job except maybe using vpn with it but I don't have vpn to test it that either.
     
  12. pedro311

    pedro311 Networkin' Nut Member

    You compare different versions: my beta with USB support (branch K26RT-N) and Shibby version without it (branch RT).
    Check "K26" sub-folder for that one you need.
     
  13. pedro311

    pedro311 Networkin' Nut Member

    Guys, at last all files uploaded.
    Happy testing! ;)
     
    Wolfgan, Goggy, Elfew and 5 others like this.
  14. txnative

    txnative Networkin' Nut Member

    Will bcm_nat be included for K26RT-N, remember when shibby introduced it a few yrs back as I'm unsure if had been til now? I have a E3200 to install some of your updates and the question reflects to the K26RT-N, however it isn't a deal breaker, but congratulations on pushing out the MIPS. Happy Sunday to ya, pedro regards txnative
     
  15. pharma

    pharma Network Guru Member

    No problems using FreshTomato Firmware 2018.1.066 MIPSR2-beta K26 USB AIO-64K on a RT-N66U.
    Thanks Pedro311, Kille72 and other devs involved in the project.
     
  16. Aardvark

    Aardvark Serious Server Member

    Do the Bandwidth and IP Traffic graphs work for you? I've tried the freshtomato-RT-N66U_RT-AC6x-2018.1.066-beta-AIO-64K and VPN versions, as well as freshtomato-K26USB_RT-N5x-MIPSR2-2018.1.066-beta-AIO-64K. The graph area is mostly blank, as can be seen in the screenshot. I've tried a number of different browsers, a different computer, and yes, I cleared the browser caches.
     

    Attached Files:

    • BW.png
      BW.png
      File size:
      8.4 KB
      Views:
      30
    Last edited: Apr 30, 2018
  17. alcuin

    alcuin Network Newbie Member

    Hi, thank you for trying to build for Belkin F9K1102. Unfortunately, when trying to flash, I get an error "File is too big to fit in MTD". According to wikidevi for Belkin_F9K1102_v1, the proper mtd sizes are:

    # cat /proc/mtd
    dev: size erasesize name
    mtd0: 00030000 00010000 "boot"
    mtd1: 007c0000 00010000 "linux"
    mtd2: 00643250 00010000 "rootfs"
    mtd3: 00010000 00010000 "nvram"

    I am currently running tomato-K26USB-1.28.20180226MIPSR2jethrogb-F9K1102-64K.trx which is 8,097,792 bytes. Let me know if you need any other logs, thanks.
     
  18. Goggy

    Goggy Network Guru Member

    Hi - thank you for your work on the mips-branch. Flashed an WRT54G v2 and ... its working :)
    Booting after flash or clearing nvram takes a lot longer - thought i bricked it after the initial flash ...
    Is it possible that at least some of the builds are named wrong? Tried "freshtomato-K26_RT-MIPSR1-2018.1.066-beta-Mini.zip" (3,8mb) first but it doesnt fit in flash. "freshtomato-K26_RT-MIPSR1-2018.1.066-beta-MiniIPv6.zip" is smaller (3,5mb) and this one worked.
     
  19. Goggy

    Goggy Network Guru Member

    Nope, same here.
     
  20. pedro311

    pedro311 Networkin' Nut Member

    Ok, I will try to understand why it's not working. Thanks for testing.
     
  21. pharma

    pharma Network Guru Member

    I looked and the Bandwidth tables work (which I use) while the graphs do not.
     
  22. Aardvark

    Aardvark Serious Server Member

    Thank you for confirming. Good to know it wasn't due to my stupidity for once. ;) Thanks @pedro311 and @kille72 for bringing new life to our old routers.
     
    Last edited: May 1, 2018
  23. JohnInCu

    JohnInCu New Member Member

    I tried out the 2018.1.066-beta on my Asus RT-N66U and reverted to Shibby 1.28.0000 MIPSR2-140 K26 USB AIO-64K when I found that IPv6 was not working for devices on my network. The router itself got an IPv6 address and could connect to IPv6 services from the shell on the router but all my network devices lost IPv6 connectivity.
     
  24. pedro311

    pedro311 Networkin' Nut Member

    Can someone else confirm that?
     
  25. sszpila

    sszpila Serious Server Member

    Can't confirm. I use hurricane electric 6to4 tunnel and this is from my mobile phone connected to rt-n15u :
    [​IMG]

    Wysłane z mojego Redmi 4X przy użyciu Tapatalka
     
  26. sszpila

    sszpila Serious Server Member

    There is a problem with pppoe reconnecting. When pppoe session ends, it can't be automatically reconnect.
    Log:
    Code:
    May 2 15:10:03 Solniczka daemon.info pppd[588]: LCP terminated by peer
    May 2 15:10:03 Solniczka daemon.info pppd[588]: Connect time 1440.0 minutes.
    May 2 15:10:03 Solniczka daemon.info pppd[588]: Sent 308927832 bytes, received 3477328151 bytes.
    May 2 15:10:03 Solniczka daemon.err miniupnpd[1228]: Failed to get IP for interface ppp0
    May 2 15:10:03 Solniczka daemon.warn miniupnpd[1228]: SendNATPMPPublicAddressChangeNotification: cannot get public IP address, stopping
    May 2 15:10:06 Solniczka daemon.notice pppd[588]: Connection terminated.
    May 2 15:10:06 Solniczka daemon.notice pppd[588]: Modem hangup
    May 2 15:10:16 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:10:26 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:10:36 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:10:46 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:10:56 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:06 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:16 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:26 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:36 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:46 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:11:56 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device 
    May 2 15:12:06 Solniczka daemon.err pppd[588]: Can't get MTU for ˜‰J: No such device
    
    Wysłane z mojego Redmi 4X przy użyciu Tapatalka
     
    Last edited: May 2, 2018
  27. pedro311

    pedro311 Networkin' Nut Member

    That's right, there are no (yet) patches of @tsynik and mine in this beta, which fix it.

    You can try to correct it by setting "Check connections every" to e.g. 2 minutes.
     
    kille72 and pharma like this.
  28. kyrios

    kyrios Networkin' Nut Member

    Is modprobe bcm_nat implemented on this build?
     
  29. pedro311

    pedro311 Networkin' Nut Member

    See the changelog...
     
    pharma, Monk E. Boy and kille72 like this.
  30. Sean B.

    Sean B. LI Guru Member

    Anyone have a list of the build packages for MIPS? I forgot which versions are needed, too used to ARM now.
     
  31. koitsu

    koitsu Network Guru Member

    The packages needed (for Debian 9 64-bit) are in the README.md. They're spread across several steps. Your distro may vary.
     
    Sean B. likes this.
  32. Sean B.

    Sean B. LI Guru Member

    @koitsu , I recall you started a thread on some of the issues you ran into building this fork ( perhaps the ARM fork instead ) but haven't been able to spot it. Was this one of them by chance?

    Code:
    config.status: executing depfiles commands
    config.status: executing libtool commands
    touch libogg/stamp-h1
    make[6]: Entering directory `/home/sean/git/freshtomato-mips/release/src/router/libogg'
    CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/sean/git/freshtomato-mips/release/src/router/libogg/missing aclocal-1.15
    configure.ac:20: warning: macro 'AM_PROG_LIBTOOL' not found in library
    CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/sean/git/freshtomato-mips/release/src/router/libogg/missing autoconf
     cd . && /bin/bash /home/sean/git/freshtomato-mips/release/src/router/libogg/missing automake-1.15 --foreign
    configure.ac:20: error: possibly undefined macro: AM_PROG_LIBTOOL
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    make[6]: *** [configure] Error 1
    make[6]: *** Waiting for unfinished jobs....
    src/Makefile.am:5: error: Libtool library used but 'LIBTOOL' is undefined
    src/Makefile.am:5:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
    src/Makefile.am:5:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
    src/Makefile.am:5:   If 'LT_INIT' is in 'configure.ac', make sure
    src/Makefile.am:5:   its definition is in aclocal's search path.
    make[6]: *** [Makefile.in] Error 1
    make[6]: Leaving directory `/home/sean/git/freshtomato-mips/release/src/router/libogg'
     
  33. koitsu

    koitsu Network Guru Member

    I haven't tried building MIPS, only ARM, which does not contain the exact identical versions of software as MIPS. I didn't run into any complications with libogg, but it was ARM and a different version (2018.2; the date matters in reference to what I say below).

    That looks like some uncomfortable GNU autotools/libtool problem that needs further investigation. Odds are someone needs to change some configure arguments, add some environment variables to the configure line in router/Makefile, or add some patches to configure.in/configure.ac to make libtool detection happy. It's probably a result of GNU autotools versioning differences. I sound like a broken record talking about how bad the GNU autotools/libtool are about compatibility/etc., but this may be another one of those cases. We FreeBSD people loathe the GNU autotools/libtool for this exact reason.

    It looks like commit b61bfd5 (note the date) might be contributing to this, but I can't say for sure. That was from April 20th.

    One thing that I do see happening: a configure script is committed to the repo, but router/Makefile is inducing autoreconf to rebuild everything. This is normally good/proper (kudos!), but it doesn't mean that the version of the GNU autotools/libtool on the system match what configure.ac, Makefile.am, or Makefile.in expect -- resulting in breakage. See my above mini-rant, as it's not without merit.

    In situations like this, sometimes the stock-from-source configure script provided actually does the right thing, while rebuilding it with one's own autoconf causes problems. In other cases, the opposite is true. So in short, I don't know what the solution is aside from really digging in to configure.ac + Makefile.am + Makefile.in and see what's going on and fix it through a patch.

    I looked at the libogg 1.3.3 source code: it does come with a pre-generated configure script. So, you might try hacking router/Makefile to not call autoreconf -fsi and see if that helps. You will need to try this on a fresh repo checkout (since autoconf regenerated the file), so you may need to cd ~/git/freshtomato-mips && git reset --hard && git clean -dxf to "restore" the repo back to what it was originally during the last clone/pull (use git status to verify), then modify router/Makefile and see what happens after that.

    Whether or not this is the correct fix, however, is undetermined (i.e. don't just go blindly committing this if it works). It may be the result of Linux distro variance, if not building on Debian 9.x 64-bit, specifically versions or unique patches/quirks applied to autotools/libtool for that distro that others might not have.
     
  34. txnative

    txnative Networkin' Nut Member

    could be the automake version, which do you have looks like automake-1.15 and do you have the earlier version of 1.13 and maybe you have the later version of bison installed also?
     
    Last edited: May 6, 2018
  35. txnative

    txnative Networkin' Nut Member

    I have installed the freshtomato-E3200USB-NVRAM32K_RT-N5x-MIPSR2-2018.1.066-beta-Mega-VPN.bin and see that the lan,wan and wifi macaddr are not the same as linksys unfortunately i didn't copy as what they were something like 00:16:B6. Qos seem to be enabled as i was able to access it and make changes without having to enabling with a check. The
    5.110 RC27.20012 wl0: Jan 23 2013 14:32:57 version 5.110.27.20012 is the same as Toastman-vpn version that I have reinstalled, I had cleared nvram before and after the install. Were the wifi drivers supposed to have been KRACK fixed? Either way I'll look for the next beta test build.
     
  36. Sean B.

    Sean B. LI Guru Member

    I tried 1.15 and 1.14. There are no versions provided in the readme for the majority of packages, so it's quite the guessing game.
     
  37. koitsu

    koitsu Network Guru Member

    I think it's much more likely it's autoconf, not automake. Really have to look closely at the output.
     
  38. txnative

    txnative Networkin' Nut Member

    That's interesting, you tried automake-1.15 & automake-1.14 but not automake-1-13? Its just that error when I see the automake-1.15 involved kinda brings back having to use 1.13 if 1.14 didn't work.
     
  39. txnative

    txnative Networkin' Nut Member

    For some reason can't edit my reply? Anyway I usually used these instructions from this old link https://bitbucket.org/pl_shibby/tomato-arm/issues/15/compilation-libjson-c-fails#comment-23001476 and incorporate the ideal of what i read into building from the old http://repo.or.cz/w/tomato.git packages I'm sure you may have done the same also. Are you building from pedro mips sources?
     
  40. Sean B.

    Sean B. LI Guru Member

    Autoconf is certainly the one that's throwing the error. But not sure if it's a cause or a symptom. Been trying to determine at what version AM_PROG_LIBTOOL was deprecated for LT_INIT, but it seems to go back quite far.
     
  41. Sean B.

    Sean B. LI Guru Member

    Tried 1.13 earlier as well. Also tried a few versions of autoconf and friends.. with no luck. Packages are different in both versions and some packages all together compared to what I'm used to in ARM.
     
  42. M_ars

    M_ars Network Guru Member

    Hi sean,
    I can/did bulid the vpn target with Mint17.3x64. I will post the packages i have installed in the evening.

    M_ars
     
    Sean B. likes this.
  43. txnative

    txnative Networkin' Nut Member

    I was having problems as you were, what distro were you using? I was using debian 8 amd64, but since i had already have debian stretch on my notebook i was able to compile a K26USB_RT-MIPSR2-2018.1-miniVPN.trx for my F7D4302 without any issues 20mins. Jessie for some reason doesn't have a automake-1.15. It was a guessing game while i was on Jessie as I thought it was just something mixed up and make clean or make distclean wasn't catching something or wrong path, or user being tired? Packages seem to be the almost the same as for ARMs, as Koitsu stated it's in the README.md freshtomato-mips.
     
  44. M_ars

    M_ars Network Guru Member

    @Sean B.

    I use Mint 17.3x64 with the following packages

    Code:
    sudo apt-get install autoconf autogen make automake automake1.9 automake1.11
    sudo apt-get install autopoint binutils bison bzip2 flex gawk xsltproc libxml-parser-perl gcc gcc-multilib
    sudo apt-get install gettext gperf g++ g++-4.4-multilib libc6 libncurses5 libncurses5-dev libstdc++6-4.4-dev
    sudo apt-get install libtool libssl-dev libxml2-dev libelf1 meld mtd-utils m4 mercurial bzr ecj cvs
    sudo apt-get install patch pkg-config shtool sqlite zlib1g-dev re2c texinfo libltdl-dev
    one little patch is missing to make the mips-branch work (sorry i missed/forgot that somehow :rolleyes: )
    https://bitbucket.org/M_ars/freshto...98debd4cb32fdca139496cc1626125?at=mips-master

    I asked @pedro311 to add it :)

    --> vpn targets are working, for exampel "v2e" for WNR3500Lv2 (just testet)

    ARM does also work with that setup
     
  45. Sean B.

    Sean B. LI Guru Member

    At first glance I see automake1.9 and libltdl-dev are ones not listed in the source readme. Perhaps already installed in Debian9.x? I'll give it a try after work, thanks.
     
    M_ars likes this.
  46. Sean B.

    Sean B. LI Guru Member

    Welp, after adding the couple of missing packages and fetching the latest repo commits, MIPS has built successfully. Thanks @M_ars for the package info.

    I was going to give it a test on my old E3000 that's been stuffed away for quite awhile. However, it appears to be pissed off about the whole replaced and stuffed away thing, as it's power light blinks and connections "refused" from web, ssh, telnet etc.
     
    M_ars likes this.
  47. M_ars

    M_ars Network Guru Member

    cool :)
     
  48. dc361

    dc361 Network Guru Member

    Sean.. try plugging in the adapter before you plug it into the E3000. I had a couple of old linksys units that just flashed lights unless you plugged the wall adapter in first.
     
  49. Sean B.

    Sean B. LI Guru Member

    Thanks for the suggestion, but no change. I had the power toggle switch off, plugged the adapter into the wall, then the barrel jack into the router, then switched it on. Same blinky blinky. I can ping it, so something's alive. Haven't had any luck trying to catch it with a tftp flash at boot though. May have to break out the ol' USB<->Serial adapter and see what can be determined.
     
  50. alcuin

    alcuin Network Newbie Member

    Hi, I have a netgear wndr4000. I was running DDWRT r35916, and wanted to see if freshtomato would work. I flashed freshtomato-K26USB_RT-MIPSR2-2018.1.066-beta-VPN.trx, and everything seems to be ok, wifi works. The only thing is under the status, it says for the model that it thinks it's a Netgear WNR3500L/U/v2. What logs do you need to identify the proper model? Thanks.
     
  51. Sean B.

    Sean B. LI Guru Member

    I only see the WNR3500L/U/v2 and WNR2000 v2 listed in the code. So I'd assume the WNR4000 isn't officially support by Tomato. Or are you asking how to identify the board? If so:

    Code:
    nvram show | grep board
    Will show you the related variables of which identify the specific board used in the router.
     
  52. alcuin

    alcuin Network Newbie Member

    Thank you. Yes you're correct, it's not officially supported. The wndr4000 is supported with the generic DDWRT mips mega, so I figured I'd try out the generic Tomato and give it a go. I can always tftp back if I get a soft brick. The Tomato mega is actually too big, so I tried the next biggest fw which was the vpn. Anyhow, here are my nvram values.

    boardrev=0x1101
    boardtype=0xF52C
    size: 29835 bytes (35701 left)
    pci/1/1/boardflags=0x00000200
    pci/1/1/boardvendor=0x14e4
    boardflags2=0x00110402
    boardmfg=NETGEAR
    sb/1/boardflags2=0x00110402
    pci/1/1/boardflags2=0x04000000
    sb/1/boardflags=0x00001310
    boardflags=0x00001310
    boardnum=01
     
  53. Sean B.

    Sean B. LI Guru Member

    Out of curiosity, have you confirmed the USB port is still functional?
     
  54. EpsilonX

    EpsilonX Network Guru Member

    @kille72 @pedro311
    Is it possible to edit the Makefile to MULTIWAN=n, and still have a working firmware..?
     
  55. pedro311

    pedro311 Networkin' Nut Member

    Just try and let us know! ;)
     
    kille72 likes this.
  56. EpsilonX

    EpsilonX Network Guru Member

    Trust me I would...
    It's just I've tried the default Makefile, the modified Makefile...
    Both completed compile, and yet both bricked my RT-N15U... :D
    I'm actually confused why it completed compiling with the default, but still bricked my router...
    Any experience like that..? :rolleyes:
     
  57. alcuin

    alcuin Network Newbie Member

    It is functional under ddwrt r35916, but I did not try usb under tomato.

    Diskspace /tmp/mnt/sda_part1
    50%
    3.6G / 3.6G


    --- /dev/sda
    Block device, size 7.216 GiB (7748222976 bytes)
    DOS/MBR partition map
    Partition 1: 7.215 GiB (7747174400 bytes, 15131200 sectors from 2048, bootable)
    Type 0x07 (NTFS/HPFS)
    Windows BOOTMGR boot loader
    NTFS file system
    UUID 5EDCF96BDCF93E39
    Volume size 7.215 GiB (7747173888 bytes, 15131199 sectors)
    Status: Mounted on /mnt
     
  58. bookreader

    bookreader Reformed Router Member

    Belkin Play Max / N600 HD (F7D4301/F7D8301) v1 the issue since the mutliwan builds has caused the port order to be not accurate. With VLAN 201 needing to be tagged for the WAN, the router can not be used on CenturyLink. http://www.linksysinfo.org/index.php?threads/can-vlan-gui-port-order-be-corrected.70160/page-2

    I tested with the current build; same issue. Not sure if this will be fixed?

    nvram show | grep vlan1ports
    vlan1ports=3 2 1 0 8*

    nvram show | grep version
    board_version=01
    loader_version=1.07e
    os_version=2018.1.066 MIPSR2-beta K26 USB miniVPN
     
  59. Pess0g

    Pess0g Networkin' Nut Member

    Thank you for the firmware and bug fix.
    2018.1.066-beta RT-N NVRAM64K Max Flashed on RT-N12B1.
    With manual configured (other) IPv6 it couldn't get to know the gateway sending ra and create the default routing but worked after those was added by hand.

    With the same ta.key,client crt,server.crt,etc,openvpn failed to handshake with the server due to tls-crypt error.(The client daemon was started by command line and GUI of openvpn was untouched.)

    I didn't like to redo all my work and flashed back to shibby as nvram was cleaned up after the power was cut suddenly.
     
    Last edited: May 18, 2018
  60. kernel

    kernel New Member Member

    Hi guys. I'm trying to port kernel 3.x from dd-wrt to this new fork of Tomato. Succesfully tested kernel through CFE console. But after kernel boot there are errors with nvram, which is /i guess/ not found by rc. Is there any way how to test whole firmware (trx file) right from CFE like vmlinus kernel (boot -addr=xxxx 1.1.1.1:/path/to/kernel)? When I edit & compile 'rc' there must be better way to test it in router than flashing whole firmware.
     
  61. pedro311

    pedro311 Networkin' Nut Member

    I'm not sure of the IPv6 itself (can't test it by myself) - some claim that it works, others say that it doesn't. I'm in dead end...

    There were many changes on OpenVPN client's page: you should clear browser's cache and specially take a look at this commit:
    https://bitbucket.org/pedro311/freshtomato-arm/commits/80da08c298210aa4fc561c7172a101379415f4cf
     
    Pess0g likes this.
  62. Pess0g

    Pess0g Networkin' Nut Member

    This RT-N12 is a client in dev br0 rather than the gateway of my network. I set it with static IPv6 address but it needs to get the address of the gateway by RA. It can also works without doubt if I do everything by hand, putting them in the script. Anyway it should do by itself after receiving the RA packets. I am sorry I forget to take a look at iptables before flashing it back. The gateway is always working as required so the other clients in br0 can get IPv6 prefix.

    I compiled static Openvpn binary of lastest version by myself and deploys it on shibby firmware where openvpn is always being booted by my script instead of GUI and its configuration is set in file instead of nvram. So are the certificates and keys. After upgrading, I just copy all of them onto FreshTomato.
    I don't love set them via GUI since it couldn't make openvpn work properly.For example, the server daemon starts prior to pppoe so that firewall would be reloaded after the server is up.(Firewall restarts as soon as wan is bought up).It is certain all will work just after openvpn server tunnel device gets up again.If sshd_key or passwd or anything about access is changed via GUI,Firewall is reloaded but any openvpn daemon,as long as started by GUI,won't restart. That means any firewall rules set by openvpn up-script would disappear.

    Hope any openvpn user could share his experience to help confirm.
     
    Last edited: May 18, 2018
  63. koitsu

    koitsu Network Guru Member

    I have tried to do this for quite some time on Asus routers and have never gotten it to work. Ever. The interactive CFE has usage syntaxes that don't match reality, and the behaviour also doesn't match reality. Pretty sure I found bugs as well (ex. attempting to load something off the network, the CFE would say it was trying, but packet captures on the physical switch on the other end showed literally NOTHING coming out of the device). I ended up digging through some Broadcom docs to try and figure out what's what, but there were differences there vs. the CFE in Asus as well (maybe it's just a different version vs. the document I was reading).

    So unless someone like @RMerlin has some ideas, the answer is: you really do have to flash the things to test them. Time consuming and very wasteful, I know.
     
  64. RMerlin

    RMerlin Network Guru Member

    No idea if Asus's CFE supports remote booting. I always did all my tests either by flashing, or by doing a binding mount (when testing things like httpd or one of the other, non-rc, services).
     
  65. koitsu

    koitsu Network Guru Member

    The CFE load command is what looks most promising, except it doesn't work. I'll explain:

    Code:
      SUMMARY
    
        Load an executable file into memory without executing it
    
      USAGE
    
        load [-options] host:filename|dev:filename
    
        This command loads an executable file into memory, but does not
        execute it.  It can be used for loading data files, overlays or
        other programs needed before the 'boot' command is used.  By
        default, 'load' will load a raw binary at virtual address 0x20000000.
    
      OPTIONS
    
        -elf         Load the file as an ELF executable
        -srec        Load the file as ASCII S-records
        -raw         Load the file as a raw binary
        -z           Load compessed file
        -loader=*    Specify CFE loader name
        -tftp        Load the file using the TFTP protocol
        -fatfs       Load the file from a FAT file system
        -rawfs       Load the file from an unformatted file system
        -fs=*        Specify CFE file system name
        -max=*       Specify the maximum number of bytes to load (raw only)
        -addr=*      Specify the load address (hex) (raw only)
    
    I remember trying to get this to work so that I could potentially load a firmware off the network via TFTP and then boot it with boot (manual equivalent of PXE booting on PCs). But I could not get load to behave sanely. IIRC, the TFTP method did not work: it would claim to be doing network I/O but literally did nothing (no network traffic seen). Yet, the flash command would work just fine. More on that in a moment.

    I also tried playing with -z for compression ("compessed" -- nice typo, Broadcom) and that didn't seem to work either in other regards. I think I got some other very strange error, almost implying that the CFE couldn't handle compressed data.

    On the flip side, the flash command did work, except that, of course, this downloads a firmware off the network and also flashes it to flash, resulting in excess wear/tear when trying to test firmwares. Ex: flash -noheader 192.168.1.20:firmware.trx flash0 did in fact TFTP transfer the firmware and do what one would expect.

    Code:
      SUMMARY
    
        Update a flash memory device
    
      USAGE
    
        flash [options] filename [flashdevice]
    
        Copies data from a source file name or device to a flash memory device.
        The source device can be a disk file (FAT filesystem), a remote file
        (TFTP) or a flash device.  The destination device may be a flash or eeprom.
    
        If the destination device is your boot flash (usually flash0), the flash
        command will restart the firmware after the flash update is complete
    
      OPTIONS
    
        -noerase     Don't erase flash before writing
        -offset=*    Begin programming at this offset in the flash device
        -size=*      Size of source device when programming from flash to flash
        -ctheader    Check header of CyberTAN
        -noheader    Override header verification, flash binary without checking
    
    What I took away from this experience: the CFE is likely buggy as hell. Broadcom sure releases a lot of junk. For a company that acts like such a jerk about intellectual property and has such a stronghold on the industry, their software sure is "meh".
     
  66. RMerlin

    RMerlin Network Guru Member

    Try doing an "nvram show" while any vars value is longer than 1000 chars. Router will freeze. Apparently, boundary validation is not something BCM programmers believe in...

    I fixed one or two buffer overruns over the years in Broadcom's own code...
     
  67. Sean B.

    Sean B. LI Guru Member

    I know there's MIPS/ARM VM's available unable QEMU and likely VirtualBox. What would be involved in tailoring something, at least bare bones, enough to check these firmwares can boot etc under a VM?
     
  68. RMerlin

    RMerlin Network Guru Member

    Not even remotely possible. You'd need to emulate all the proprietary hardware, the flash mapping including the nvram partition, etc...
     
    Sean B. and koitsu like this.
  69. koitsu

    koitsu Network Guru Member

    Correct. If there was such a thing, it'd be something written by Broadcom (or potentially the device manufacturer relying on something Broadcom gave them) for that exact purpose. Just because a device contains a particular CPU architecture doesn't mean an emulator for that CPU architecture can magically emulate all the rest of the hardware, not to mention implementation quirks or variances (the device manufacturer (ex. Asus, Netgear, Tenda, Cisco/Linksys, etc.) is responsible for that).
     
  70. kernel

    kernel New Member Member

    Thanks for interesting infos. I'm digging through kernel boot procedure since yesterday and I think that there can be a way how to test eg. rc binary right from CFE. Kernel supports something like initramfs, which is cpio archive directly attached to the kernel binary. Kernel after boot extracts this attached cpio archive to ramfs/tmpfs and runs /init. More info can you see in kernels Documentation/filesystems/ramfs-rootfs-initramfs.txt.
     
  71. koitsu

    koitsu Network Guru Member

    I'm familiar with initramfs / initrd (it's been used on normal Linux distros for decades). I would be very, very surprised if this worked on embedded routers, given their lack of bootloader (CFE is not quite the same as GRUB).

    I would suggest you read up on how the kernel is actually started on a Linux distro using initramfs/initrd vs. an embedded Broadcom router. On the latter, the root filesystem argument is hard-coded (IIRC) to something like /dev/mtdblockXX. Things like GRUB and what you're used to seeing on a standard Linux distro running on a PC are not involved. Take a peek at dmesg | grep -i "command line" sometime on a router vs. a normal Linux distro (and preferably a very old distro -- say from 6-7 years ago. No I'm not kidding). Here's what you'll find on routers:

    Code:
    Kernel command line: root=/dev/mtdblock2 console=ttyS0,115200 init=/sbin/preinit earlyprintk debug
    
    And here's the flash partitioning so that you have some idea of what's magical about /dev/mtdblock2:

    Code:
    root@gw:/tmp/home/root# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00080000 00020000 "boot"
    mtd1: 00180000 00020000 "nvram"
    mtd2: 01e00000 00020000 "linux"
    mtd3: 01c5dc14 00020000 "rootfs"
    mtd4: 06000000 00020000 "brcmnand"
    mtd5: 04000000 00020000 "jffs2"
    
    On Linux distros for PCs, GRUB is used to pass these to the kernel, as well as select a list of kernels (you've probably seen this) (and that list is not "dynamically obtained": every time you make a new kernel on a Linux distro, you have to update the bootloader so that it knows of it, which also includes what LBA it starts at, etc. -- if you forget to update the bootloader, you literally brick your system from booting :) ). This isn't how it's done on embedded devices.

    I would suggest seeing maybe how OpenWRT/LEDE does it or how DD-WRT does it. IIRC, they do it the same way as all the other embedded devices do, but I bet it depends on the router/device too. Here's an example:

    Code:
    [ 0.000000] Kernel command line: board=WNDR3700 mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
    
    And the related flash partitioning for that:

    Code:
    [    0.505477] 0x000000000000-0x000000030000 : "uboot"
    [    0.512242] 0x000000030000-0x000000040000 : "uboot_env"
    [    0.518030] 0x000000040000-0x0000007f0000 : "firmware"
    [    0.563673] 0x000000040000-0x0000001c906c : "kernel"
    [    0.570525] 0x0000001c906c-0x0000007f0000 : "rootfs"
    [    0.586168] 0x000000720000-0x0000007f0000 : "rootfs_data"
    [    0.639581] 0x0000007f0000-0x000000800000 : "board_config"
    
    It's important to understand that OpenWRT/LEDE does this VERY differently than Tomato. Notice how there's no NVRAM partition?

    They use something called u-boot, which looks like it might be what you're wanting. OpenWRT's docs indicate that u-boot can actually be configured to do a TFTP transfer of a firmware on start-up, etc.. No idea if it flashes it or just loads it into memory space (I see no reason why it couldn't do the latter):

    https://openwrt.org/docs/techref/bootloader/uboot.config
    http://www.denx.de/wiki/DULG/WebHome

    Just keep in mind that the NVRAM partition on Tomato routers is important. NVRAM on OpenWRT is avoided/left alone because they (rightfully so) prefer to leave those settings managed by the manufacturer and CFE. A good example of why they do this is is stuff like PCI configuration values used to initialise WiFi chips and so on -- something that Tomato has suffered from dealing with (people's WiFi being extremely bad on some devices turned out to be some missing or badly-set NVRAM variables, IIRC. Been a while...).

    Regardless, I look forward to hearing about your efforts. Good luck!
     
  72. kernel

    kernel New Member Member

    Thanks for big response @koitsu . I'm very glad for that.

    I now /a little/ about differences of booting kernel on desktop vs. embedded device. I'm not saying that there is a chance to boot whole firmware from initramfs. There isn't enough initialized memory by CFE for this, I think. From my point of view, when I have kernel with initramfs /which contains libc, libshared, libnvram and rc binary renamed/linked to /init/ kernel should be able to extract it and run. I don't need anything else for now. Only modify and test rc and reading from nvram, without needs of full reflash.

    Kernel command line is not important for me at least for now. Initramfs doesn't need anything in cmd line, don't it? Just "hey kernel, you have initramfs support and cpio archive in yours binary, so do the all magic".

    About NVRAM problem:
    My kernel boots (over LAN by TFTP), takes everything up, mounts squashfs root from flash and runs /sbin/rc, which should init rest. Current problem is, that I don't have initialized /dev/nvram device by kernel /it should be right? at least on Tomato/, it simply doesn't exists. Kernel log says:
    Code:
    startup nvram driver
    found nvram
    max nvram space = 65536
    VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
    Freeing unused kernel memory: 268K
    Interesting, isn't it? Dd-wrt creates this dev during rc init phase (sysinit-broadcom.c) by
    Code:
    mknod("/dev/nvram", S_IFCHR | 0644, makedev(229, 0));
    So they somehow emulates it? Even if I create this dev before rc calls for any nvram value by libnvram, it didn't work. So there can be some incompatibilities between Tomato and Dd-wrt. I need to dig deeper in it. That's the reason why I'm seeking for any way how to test code after kernel boots without need of flashing fw.

    Statement: I now that I'm not skilled enterprise developer and have terrible writting in English. So some of my ideas can be unreal or not very well described.

    Edit: I don't want to steal thread so it will be good to start a new one.
     
    Last edited: May 19, 2018
    Sean B. likes this.
  73. NyNe

    NyNe Networkin' Nut Member

    Just wanted to report that I tried out freshtomato-RT-AC66U_RT-AC6x-2018.1.066-beta-AIO-64K on my RT-AC66U last night and I had no problems getting it to flash, and then doing a 30/30/30 and then additional reboot without issue. I saw both 2.4 and 5 GHz WiFi in the router interface and I could see them when looking for available networks on my laptop and cell phone, but when I tried to connect to either band the router would reboot. I confirmed the router stayed stable if no wireless connection were attempted, but the moment I tried to connect to WiFi the router would reboot.

    I had come from Merlin's firmware (i think 380.69_2 if it matters) and used the router's recovery web interface to flash freshtomato. After redownloading and reflashing and wiping nvram and doing multiple 30/30/30 resets I eventually gave up and went with advancedtomato RT-AC66U_AT-RT-AC6x-3.5-140-AIO-64K and only had to clear nvram from the web interface and reboot once to get everything working.

    I'll keep an eye on this project as it seems very promising and I'd like to give it another try in the future.
     
    Last edited: May 19, 2018
  74. pedro311

    pedro311 Networkin' Nut Member

    Thanks for testing.

    Can anyone else confirm that behaviour on RT-AC66U (on RT-N66U everything's fine)?
     
  75. Pess0g

    Pess0g Networkin' Nut Member

    I am sorry "tls-crypt" error didn't be caused by the firmware
     
  76. grugboro

    grugboro New Member Member

    Hello,

    I checked the changelog at the top of the post and it doesn't note anything about bcm, bcm_nat, NAT acceleration or CTF. Does this mean that FreshTomato will top out at ~120mbits downlink? I really like Tomato, but this would mean I'd cut my 400mbit downlink into a third..
     
  77. pomidor1

    pomidor1 Networkin' Nut Member

    Last edited: May 19, 2018
  78. pomidor1

    pomidor1 Networkin' Nut Member

    deleted
     
  79. Sean B.

    Sean B. LI Guru Member

    Figured it was harder than it sounds, as someone would have done it already. Thanks.
     
  80. Sean B.

    Sean B. LI Guru Member

    Hense why I asked.
     
  81. LastSilmaril

    LastSilmaril Addicted to LI Member

    This is a minor point but, upon installation, the usual update text notification informs me that v2018.2 is out, though it doesn't actually seem to be for MIPS, only for ARM. The link also leads to shibby's site, instead of e.g. to this thread.
     
  82. GhaladReam

    GhaladReam Network Guru Member

    Running FreshTomato Firmware 2018.1.066 MIPSR2-beta K26AC USB AIO-64K on my RT-N66U and I noticed the extra options that were added in the ARM build for Wireless filter lists is not present in the MIPS build. Could it be added?

    [​IMG]
    [​IMG]
     
  83. pedro311

    pedro311 Networkin' Nut Member

  84. Onee-chan

    Onee-chan Network Newbie Member

    When you release the final version, I will test it with pleasure.

    Thanks for your efforts to the developers and the beta testers (Rats)
     
  85. tvlz

    tvlz LI Guru Member

    The Netgear wndr4000 was supported but it looks like there was a problem with it.
    "this commit also remove image for WNDR4000. For some reason image won`t correctly boot on this router. Don't have idea why."


    I made a updated version(4/16/2018) of the Advanced-vlan(advanced-vlan.asp.rt_) file for RT branch routers restoring VID Offset, as those routers can't add VIDs over 16 directly.

    Can-vlan-gui-port-order-be-corrected

    I did send @pedro311 a PM after I updated it to see if he would update to the latest version.
     
    Onee-chan likes this.
  86. harrison

    harrison New Member Member

    I'm trying to compile the n60z target from most recent MIPS from Pedro311. (Debian 9.4)

    I am currently getting the following error any help??:
    Code:
    checking for restartable system calls... configure: error: in `/home/harrison/pedro311mips/release/src/router/mysql':
    configure: error: cannot run test program while cross compiling
    See `config.log' for more details
    Makefile:472: recipe for target 'config.status' failed
    make[6]: *** [config.status] Error 1
    make[6]: Leaving directory '/home/harrison/pedro311mips/release/src/router/mysql'
    Makefile:2076: recipe for target 'mysql' failed
    make[5]: *** [mysql] Error 2
    make[5]: Leaving directory '/home/harrison/pedro311mips/release/src/router'
    Makefile:91: recipe for target 'all' failed
    make[4]: *** [all] Error 2
    make[4]: Leaving directory '/home/harrison/pedro311mips/release/src-rt'
    Makefile:712: recipe for target 'bin' failed
    make[3]: *** [bin] Error 2
    make[3]: Leaving directory '/home/harrison/pedro311mips/release/src-rt'
    Makefile:811: recipe for target 'z' failed
    make[2]: *** [z] Error 2
    make[2]: Leaving directory '/home/harrison/pedro311mips/release/src-rt'
    Makefile:866: recipe for target 'r2z' failed
    make[1]: *** [r2z] Error 2
    make[1]: Leaving directory '/home/harrison/pedro311mips/release/src-rt'
    Makefile:912: recipe for target 'n60z' failed
    make: *** [n60z] Error 2
    
     
  87. Beast

    Beast Network Guru Member

    Is freshtomato-K26USB-MIPSR2-2018.1.066-beta-VPN.zip the correct firmware for an Asus RT-N16 ???
     
  88. mizipppp

    mizipppp New Member Member

    Edit: Nevermind me. The build works for AC66U and wifi works, but I think my 5ghz hardware migh actually be dead. It's saying "wrong password" in every firmware I try.
     
    Last edited: May 22, 2018
  89. Aardvark

    Aardvark Serious Server Member

    Exact same issue here when compiling for N66U AIO (r64z target). VPN target (r64e) DOES compile successfully and works fine when flashed. Using Debian 9.4 and carefully set up the environment per the readme.
     
  90. koitsu

    koitsu Network Guru Member

    The errors people are getting saying "configure: error: cannot run test program while cross compiling" in mysql are due to either:

    a) botched patches in router/patches/mysql (you will see what is done to patch configure there; this looks like more GNU autotools breakage/idiocy, possibly a better solution is to regenerate configure using autoreconf? We've talked about this before, I don't feel like rehashing it), or,

    b) what I've talked about in the past (re: the patch methodology that was implemented by pedro is not reliable). You won't find any working links to my fork working because I deleted it, but the work was simple: stop using define/call and use shell scripts to do the work instead (they were router/patches/apply and router/patches/unapply), guaranteeing 100% reliability.

    This type of thing is going to keep coming up over and over and over until the devs learn about the nuances and pains of GNU autotools. They're used everywhere but they're highly susceptible to breakage. Sometimes autoreconf is needed, other times not. It sucks. But the existing patch methodology being so feeble and delicate means that nobody compiling the firmware is sure what broke or where/how.
     
    Joe A and Aardvark like this.
  91. Edrikk

    Edrikk Network Guru Member

    There is a way to provide constructive feedback to people.

    This feedback is based on comments towards those pushing things forward, and also your comments about contributors (my “meh” code, Pedro’s “crappy job of implementing patching”), potential employment offers (“I’ll only be here a couple of days, don’t get used to my presence”), Broadcom developers (“idiots who don’t know how to code”), etc. etc. etc.

    I’m sure I’m not the first, nor will I be the last to tell you this: There are better, more socially acceptable ways of communicating and giving feedback. Your feedback then has a better chance of being discussed/incorporated vs. being ignored because it belittles the work that someone else took the initiative on and spent their personal time and effort to take on.

    I just checked your linked to post. Beyond insulting Pedro’s work, given that you said “let’s discuss” I’m not sure why you deleted your repository of your I’m sure optimal patching code... I was scratching my head the first time you left as well, because you made a patch for something then as well, but left and immediately deleted your git repo before anyone could pull it.

    In case not clear, I’m saying you need to work on Teamwork, communication, and inter-personal skills.
    Positivity breads positivity, and provides you with opportunities that you otherwise wouldn’t get.
     
    Wolfgan, pedro311 and kille72 like this.
  92. NotVeryClever

    NotVeryClever New Member Member

    I wonder if it might be possible to enable https support for curl to match the ARM version.

    2018.1.066 MIPSR2-beta K26AC USB AIO-64K (RT-AC66U):
    Code:
    # curl --version
    curl 7.59.0 (mipsel-unknown-linux-gnu) libcurl-7.59.0 zlib-1.2.11
    Release-Date: 2018-03-14
    Protocols: file ftp h*tp imap pop3 rtsp smtp tftp
    Features: AsynchDNS IPv6 Largefile libz UnixSockets
    2018.2 K26ARM USB AIO-64K (R8000):
    Code:
    # curl --version
    curl 7.59.0 (arm-unknown-linux-gnu) libcurl-7.59.0 OpenSSL-1.0.2o zlib-1.2.11
    Release-Date: 2018-03-14
    Protocols: file ftp ftps h*tp h*tps imap imaps pop3 pop3s rtsp smb smbs smtp smtps tftp
    Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets HTTPS-proxy
    ("ttp" replaced with "*tp" so forum doesn't find "sneaky URL content".)
     
  93. koitsu

    koitsu Network Guru Member

    Okay, you have a problem with my attitude. Thanks for letting me know...?! :)

    I've been part of open-source projects since the early 90s, and I am known within nearly every circle -- as well in my career line -- for being very brash and direct. I do not mince words, I do not beat around the bush, I don't give "lip service"; there's a reason I'm a systems and network engineer and not in customer support. And as an introvert I'm both self-aware, and well-aware of why. I am not the guy you want interacting with customers, I am the engineer you want designing things and being on the hook for fixing problems. This is either a positive or negative trait depending on how you leverage it. It also matters that I was part of the FreeBSD project for almost 2 decades -- a project requiring thick skin when dealing with other devs. What you learn is to distance yourself personally/socially from the thing and instead focus on the goal (the same goal everyone shared).

    So when it comes to OSS projects, I couldn't care less about the personalities of contributors -- I care more about the code/thing, and about ensuring past mistakes not be repeated. As such, I believe in holding authors responsible for problems they create. I mentally think of bugs like this: "your bug, your fault, your problem". I treat my own OSS that way as well, and expect end-users to rely on me to fix the bugs that I create (features are an entirely separate subject). If my bug caused them pain/annoyance/etc. then it's my due diligence to fix it, and I actually owe them an apology. The general OSS mentality is that "because end-user has access to the source, they can fix it themselves". This is a mentality that I have strongly disagreed with all my life; I do not expect end-users to have the familiarity with the code, skills, or time to dedicate to fixing bugs. This is why you will never, ever hear me say unto users "send patches" as a rebuttal. Yeah, I have a very different view of OSS than most.

    My repository was deleted because the issue was addressed and there was no other purpose of leaving it. I fought the battle to have the patching methodology done with shell scripts, and I lost the battle. kille72/pedro/etc. have every right in the world to do whatever they wish/use whatever methods they wish, I support that fully! Just because they differ from my own doesn't make me right/them wrong or vice-versa! But when I see something that looks an awful lot like something that was supposedly addressed (and in a nebulous way, i.e. I could not find, nor could anyone refer me to, where in GNU make this was actually fixed or where in Debian's distro patches it may have been fixed -- in other words, to me it looked like a strange kludge), I have to shake my head and sigh a bit.

    I do not believe in leaving unused stuff laying around; I don't like wasting resources on BitBucket any more than I like wasting my own local disk space. I experienced way too many issues/oddities with their UI that I was pretty turned off by the service in general, but that's entirely subjective. Nothing gets us old timers more riled up than finding old, unmaintained forks/repos of stuff laying around the Internet.

    If you have other questions, comments, personal issues with me, etc. I'll be more than happy to discuss them with you in PM.
     
    Wolfgan, Joe A, Monk E. Boy and 3 others like this.
  94. Edrikk

    Edrikk Network Guru Member

  95. ingenium

    ingenium New Member Member

    Any chance of making a driver modification to accommodate the Netgear Fuse (Aircard 779S)? It's a Sierra Wireless card internally, but uses a Netgear USB identifier. Adding a line to qmi_wwan.c (drivers/net/usb/qmi_wwan.c in the kernel source) should allow it to work. In section 3, just above the line "/* 4. Gobi 1000 devices */", adding the following should be all that's needed:

    {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */

    Unfortunately since my account is new, I can't post a link to the source of this information.

    I was trying to make the change myself to test it, but I've been unsuccessful at getting it to actually compile.
     
  96. koitsu

    koitsu Network Guru Member

    I managed to find a local repo copy that still had my fix-patch-methodology branch for ARM. This will not apply cleanly to kille72 (ARM or MIPS) as of this writing, but it should be incredibly easy to port if interested. Attached as a file, as well as a link to a gist so you can view it more easily. Feel free to do with this whatever you wish: https://gist.github.com/koitsu/94c3e48f1debf4ea4b8c124db9518f7b

    I want to add that this methodology (which is not of my invention -- doesn't exist in Toastman or Shibby) is quite error-prone (ref#1 and ref#2 for my statement) and can/will break in several edge case scenarios. I've run into this myself both with and without my above methodology -- it's an effect of the "try to figure out if something is pre-patched or not using patch -R" approach, which is fragile (see above references for validation)[1]. One of the most annoying is if you hit Ctrl-C in the middle of a particular phase -- you end up having to fight how router/Makefile is designed, and in 95% of the cases, end up saying "screw it" and clean it up by doing cd ~/base-repo-directory && git reset --hard && git clean -fdxq all because of [2]. We all know this by now, it's the elephant in the room that nobody talks about.

    With FreeBSD Ports, build and patch third-party packages regularly: maybe 80% of all ports/packages have custom patches. Third-party software is built within a temporary directory called WRKDIR, which is where the software is extracted into + patched + compiled within. The same directory also contains the source (called WRKSRC) This is unlike Tomato where the approach was "build inside the router/thing directory"[2].

    An example would be:

    WRKDIR=/some/place/work
    WRKSRC=/some/place/work/minupnpd-2.0.36 (extracted tarball dir, also where patches get applied, etc. -- i.e. identical to what would be in router/miniupnpd)

    With Ports, to track the "states" of the 7 different "phases" of building third-party software, simple dotfiles within WRKDIR are used. They're internally called "cookies" (nothing to do with web cookies) and are created after a successful phase (e.g. $? == 0). These work marvellously with make. How all these "cookies" work internally and how they're used by make is kind of hairy (don't miss line 5379 too).

    The general 7-stage phases go like this: extract, patch, configure, build, stage, install, (optional) package. The targets that use them (also see here, section TARGETS for other magical targets):

    make extract -- extracts the source tarball
    make configure -- do configure and/or autoreconf, etc.
    make install -- install the software system-wide
    make build -- does the make/compile itself
    make patch -- for applying patches
    make stage -- used for generating a file list (plist) of what got generated (list of files that the package manager itself will be aware of)
    make package -- for making an actual FreeBSD package (think .deb but different)
    make clean -- removes WRKDIR

    And the respective dotfiles:

    $WRKDIR/.extract_done -- "make extract" completed successfully
    $WRKDIR/.configure_done -- "make configure" completed successfully
    $WRKDIR/.install_done -- "make install" completed successfully
    $WRKDIR/.build_done -- "make build" completed successfully
    $WRKDIR/.patch_done -- "make patch" completed successfully
    $WRKDIR/.package_done -- "make package" completed successfully
    $WRKDIR/.stage_done -- "make stage" completed successfully

    I'm not saying "hey, someone port FreeBSD ports framework to TomatoUSB!" -- that would never happen (although Linux Gentoo's Portage is heavily based on it). However, the above CONCEPTS are NOT FreeBSD-specific; they're well-established as good form when building third-party software, cross-compiled or not, and work quite well with general make constructs/methodology.

    For TomatoUSB, these different phases could be implemented as a combination of native make (e.g. router/Makefile) and shell scripts (used to do heavier bits). FreeBSD Ports doesn't use shell scripts entirely (though there are some), but instead embeds horrible, awful, nasty, disgusting shell within the Makefile/framework itself, and it's literally impossible to read + highly error prone. Very few at this point understand how it all works.

    Finally, I want to make clear one point: none of this (bad design of how to build/maintain third-party stuff in TomatoUSB) is really the fault of any one person. Original Tomato (WRT54G days) was very small and the software simple/easy, all maintained by one guy (Jon Zarate) -- seriously, go back and look at src/router from those days! As more routers were RTM and more users wanted more features, lots of stuff got dropped into the router/ directory and the Makefile hacked on by lots and lots of people. TMK, nobody along the way ever stopped + said "hold up, this is not good design for long-term use, we need to revamp this"; the closest was Toastman saying "No, I am not adding {feature,program} XYZ because {list of reasons}". His focus was on trying to keep a good/stable/tolerably-sized firmware focused on the RT-N16, with a secondary focus of trying to keep the software and the repo "tolerably sized". Things became even more complicated when commercial companies started taking bits/pieces of Tomato and changing it (sometimes for the better, sometimes not), while introducing routers with new hardware features (USB comes to mind). So today, we now have something big and messy. Again: no one person can be blamed for it, it's just a result of people hacking on more and more, and not so much rearchitecting. This is one area where OpenWRT/LEDE got right with their packaging + modular GUI approach (not that their GUI is amazing, but I'm talking about the underlying design).

    Anyway, that's all from me for now.

    [1] -- Possibly git has something that can handle this better. It DOES have its own native patch format; see git format-patch and git diff. So maybe it could be used for applying and detection instead of classic patch? I haven't looked into it so there's a good chance I could be barking up the wrong tree.

    [2] -- This is very dangerous and always has been. It's bitten the project repeatedly -- not just kille72, but every fork, including original Tomato -- because the resulting compile/work directory is the same directory as what gets committed in git! So people commit all sorts of stuff and have to clean it out periodically (devs here certainly have seen me tell Shibby, Toastman, and others when the repo contains a bunch of junk that it shouldn't -- those devfs or udev (I think?) infinite-looping symlinks were a cute one) and then try to "wrangle it" using .gitignore -- which doesn't scale/work long term when upgrading software (ex. program v1.1's build files might not be the same as program v1.0's).

    It's not just about "leftovers" either, it's also about things like autoreconf rebuilding configure, automake rebuilding Makefile, etc.. which can have dire effects (as said before: sometimes the originals in the source tarball work correctly, while other times they must be rebuilt with autoreconf/automake else they misbehave. Every third-party program is different, because the GNU autotools are notoriously broken and awful and vary in behaviour between even minor version numbers! :( ). You don't want to commit any of this stuff into the git repo, you want to keep the repo as "true/pure" as possible. pedro knows this for sure and he deserves two thumbs up for trying to keep it that way!

    At the same time, the existence of a $WRKDIR/.patch_done can tell make definitively "yes the source within $WRKSRC has patches applied". No longer do you have to "try" a reverse patch; you just "make clean" (rm -fr $WRKDIR) and bam, problem solved. For populating WRKSRC, consider cp -R or rsync -aH.
     

    Attached Files:

    Last edited: May 25, 2018
  97. Sean B.

    Sean B. LI Guru Member

    Good times.
     
    NotVeryClever and Justio like this.
  98. NutsN'bolts

    NutsN'bolts Network Newbie Member

    I haven't checked this forum for a while as i switched to openWRT on my main router...
    It's really awesome that u guys did a fork for MIPS based devices. I'll try this firmware with my old RT-N66 asap <3

    Just a question, are vlan's and ebtables working with the latest beta ?
    I would love to set up a Tomato Guest AP with my old RT-N66U so i would need working vlan's and ebtables to isolate the clients...
     
  99. mizipppp

    mizipppp New Member Member

    I wanna write a new status report and say that everything now works as expected. I gave it another try to reflash/reset configuration and it seemed to have to have fixed my problems. I'm using my Asus AC66U as an AP, so DHCP/DNS etc is turned off. It has a couple of vlans tagged and it works perfectly. No problem with 2,4 or 5ghz either.

    Edit: Is there anywhere I can send a donation to you guys?
     
    Last edited: May 25, 2018
  100. koitsu

    koitsu Network Guru Member

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice