How to get back nocat: Captive Portal feature, which was retired in FreshTomato-ARM 2018.4

Discussion in 'Tomato Firmware' started by tbrautaset, Oct 11, 2018.

?

Anyone using Captive Portal?

  1. Oh yes, it's so cool to have internet cafe solution with a great welcome page at home !

    6 vote(s)
    42.9%
  2. Absolutely silly, do not need anything like that!

    8 vote(s)
    57.1%
  1. tbrautaset

    tbrautaset Network Newbie Member

    This thread may help others who want to make changes at their own, when features like in my case were retired.

    What I've done so far is following this HOW TO COMPILE FRESH TOMATO on Debian 9.x / 64bit

    Ok, tools are configured and the source code is downloaded. How do I add what's removed and compile it so I get my own 2018.4 version with this feature? In my case, this was nocat: Captive Portal.

    Can anyone help to create a simple recipe that contains how to add this feature and how to compile so I end up with a .trx file that can be used?
     
  2. Sean B.

    Sean B. LI Guru Member

    I would suggest as the easy, and certainly simplest, way is to clone the FreshTomato source via git from here . Then either checkout the last version which included nocat, or if there's updates you want from after that version then revert the commit in which nocat was removed.
     
    Last edited: Oct 12, 2018
  3. Yim Sonny

    Yim Sonny Serious Server Member

    This might be a very simple task for one of the developers who work with this stuff. You might want to ask how much of a donation they would consider accepting for the time spent on your custom job. I bring this up because I also have several items that I would like to have customized into the firmware and have considered asking this same question for my own projects.
     
  4. tbrautaset

    tbrautaset Network Newbie Member

    Did as you wrote and and downloaded from the correct repo, regardless of whether I do not see the difference, except that the first one only has mips compiled from the same source code ?


    Created a directory and downloaded what I'm assuming is 2018.3, and when the feature was removed and the 2018.4 source code to look for differences:

    git clone https://bitbucket.org/kille72/freshtomato-arm/commits/878f26dd69b9af677ef55632d315ba21f3bd31ce 2018.3 \ - \ 2018.06.22

    git clone https://bitbucket.org/kille72/freshtomato-arm/commits/741eab041884191e31e810ee55a3681334422027 Retiring \ Captive \ Portal \ feature \ - \ 2018.08.07

    git clone https://bitbucket.org/kille72/freshtomato-arm/commits/bede7f78930737a152d9adb7e82d8706f1f67dd3 2018.4 \ - \ 2018.09.10


    Anyone who knows how to get the right configuration for make, so can build this for Asus RT-AC3200 model ?
     
  5. AndreDVJ

    AndreDVJ LI Guru Member

    Looking at these three commands, you did exactly the opposite of what Sean advised...
    • First of all, you need to clone a repository using Git.
    Code:
    git clone https://bitbucket.org/kille72/freshtomato-arm.git
    • Then you need to checkout the correct branch for your router
    Code:
    git checkout shibby-arm7
    • Then you need to get into ~/release/src-rt-7.x.main/src/ and compile the ac3200z target.
    I don't really know the correct sequence to have the image versioned correctly, so I'm unable to help you at this point.

    The easiest thing to do is to undo the change manually, because the nocatsplash source code is still in the tree. If you found the change, then I assume you know what the git diff in there is telling you.

    In fact, I am assuming lots of things, because TomatoUSB building is a major PITA on its own. Resolving configuration and compilation issues you must research a little.

    My only advice is to not issue git commands against your local repository without knowing exactly what you're doing.
     
    tbrautaset and Sean B. like this.
  6. Sean B.

    Sean B. LI Guru Member

    I would strongly suggest checking out the captive portal options that you can use via optware/entware-ng rather than your current courses of action.
     
    RogueScholar and tbrautaset like this.
  7. Sean B.

    Sean B. LI Guru Member

    @tbrautaset , after taking a look at the source, reinstating nocat turned out to take no more than the addition of " NOCAT=y " in 2 lines inside of 1 makefile. I went ahead and ran a build of 2018.5 AIO with NoCat enabled, you can download it here if you'd like. I must state that, while nothing during the build process indicated anything abnormal, I cannot test this firmware file as I do not have an RT-AC3200. Therefor if you use it, you are expressly doing so at your own risk.
     
  8. tbrautaset

    tbrautaset Network Newbie Member

    Starting a conversation, to not bother everyone in this thread;).
     
  9. Justio

    Justio Networkin' Nut Member

    :(
     
  10. Yim Sonny

    Yim Sonny Serious Server Member

    I believe that the apple sized hole in your head has suddenly been elevated to a whole new significance.
     
  11. tbrautaset

    tbrautaset Network Newbie Member

    Much possible, it has :D
     
  12. tbrautaset

    tbrautaset Network Newbie Member

    After trying Sean B.'s .trx I hope to know how it was made, started a conversation.

    Meanwhile, tried compiling different commits, but I always get these messages when trying to make ac3200z, ac3200e is ok, but I use AIO


    checking for restartable system calls... configure: error: in `release/src-rt-6.x.4708/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[5]: *** [config.status] Error 1
    make[5]: Leaving directory 'release/src-rt-6.x.4708/router/mysql'
    Makefile:2266: recipe for target 'mysql' failed
    make[4]: *** [mysql] Error 2
    make[4]: Leaving directory 'release/src-rt-6.x.4708/router'
    Makefile:123: recipe for target 'all' failed
    make[3]: *** [all] Error 2
    make[3]: Leaving directory 'release/src-rt-7.x.main/src'
    Makefile:1087: recipe for target 'bin' failed
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory 'release/src-rt-7.x.main/src'
    Makefile:1106: recipe for target 'z' failed
    make[1]: *** [z] Error 2
    make[1]: Leaving directory 'release/src-rt-7.x.main/src'
    Makefile:1185: recipe for target 'ac3200z' failed
    make: *** [ac3200z] Error 2



    Have tried to do as AndreDVJ and Sean B. informed me :

    git clone https://bitbucket.org/kille72/freshtomato-arm.git
    git checkout shibby-arm7

    Edited Makefile : sed -i -e 's/BTCLIENT=/NOCAT=y BTCLIENT=/g'

    Entered release/src-rt-7.x.main/src, ran make ac3200z, possible i lack some parameters such as image version? What more than make ac3200z?

    Errors I get is similar to those in this thread, but my path includes sbin ...
     
    Last edited: Oct 25, 2018
  13. Monk E. Boy

    Monk E. Boy Network Guru Member

    I think you might be having build environment errors. There are threads in the forum about how to create a working build environment for Tomato, it's kind of touchy & particular. mysql errors have definitely been mentioned more than a few times. The more you put in the firmware the harder it is to get it all built.
     
    tbrautaset likes this.
  14. tbrautaset

    tbrautaset Network Newbie Member

    Thanks Monk E. Boy, searched threads about build environment and put together what I think I needed of information. This is what worked for me, finally: (Not much news for most, here are my edited notes ...)



    Using VirtualBox Version 5.2.20 r125813 with Extension Pack Version 5.2.20r125813, downloaded and used : http://ftp.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/mini.iso (39 MB)


    Created a new virtual machine, in Expert Mode :


    Name : Debian-FreshTomato-ARM
    Type : Linux
    Version: Debian (64-bit)
    Memory size : 4096 MB
    Create a virtual hard disk now, VDI (Virtualbox Disk Image) & Dynamically allocated -- > 20 GB

    Settings :

    Number of CPUs: 2
    NIC 1: MAC: , Attachment: Bridged Interface
    Audio: disabled
    XHCI: enabled


    Debian GNU/Linux installer boot menu = Install

    - Select a language = English
    - Select your location = <your location>
    - Configure locales = United States - en_US.UTF-8
    - Configure the keyboard = <your keyboard map>
    - Configure the network, Hostame = freshtomato-arm, Domain name (blank for none) =
    - Choose a mirror of the Debian archive, Debian archive mirror country = <your mirror>, Debian archive mirror = <your nearest>, HTTP proxy information (blank for none) =
    - Set up users and passwords = build, on all 6 choices
    - Partition disks, Partitioning method = Guided - use entire disk, Select disk to partition = SCSI3 (0,0,0) (sda) - 21.5 GB ATA VBOX HARDISK, Partitioning scheme = All files in one partition (recommended for new users), Finish partitioning and write changes to disk="Press enter key", Write the changes to disks = Yes
    - Configuring popularity-contest = No
    - Software selection, Choose software to install = Uncheck Debian desktop enviroment, uncheck print server, check SSH server, uncheck standard system utilities,and tab to Continue
    - Install the GRUB boot loader on a hard disk = Yes, Device for boot loader installation = /dev/sda (ata-VBOX_HARDDISK_VB.................)

    In the VirtualBox window, select Devices > Optical Drives > Remove disk from virtual drive, VirtualBox -Question, Would you like to try to force ejection of this disk? = Force Unmount

    - Finish the installation, Installation complete = Continue


    Continue with SSH localy (Without Guest Additions, yet):

    ssh build@freshtomato-arm
    build@freshtomato-arm's password:build


    As root :

    su

    apt install build-essential net-tools sudo -y>/dev/null 2>&1;adduser build sudo;shutdown -r now


    Continue as user:


    sudo apt install autoconf m4 flex libtool sqlite gettext unzip zlib1g-dev gperf automake groff lib32stdc++6 libncurses5-dev gawk gitk zlib1g-dev autopoint shtool autogen mtd-utils gcc-multilib gconf-editor lib32z1-dev pkg-config libssl-dev automake libxml2-dev intltool libglib2.0-dev libstdc++5 texinfo dos2unix xsltproc libcurl4-openssl-dev libxml2-dev libgtk2.0-dev libnotify-dev libevent-dev mc git texlive -y;sudo apt remove libicu-dev -y>/dev/null 2>&1;sudo apt autoremove -y>/dev/null 2>&1

    wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb;sudo apt-get install ~/libbison-dev_2.7.1.dfsg-1_amd64.deb ~/bison_2.7.1.dfsg-1_amd64.deb -y>/dev/null 2>&1;rm libbison-dev_2.7.1.dfsg-1_amd64.deb bison_2.7.1.dfsg-1_amd64.deb;sudo apt-mark hold bison libbison-dev

    sudo dpkg --add-architecture i386;sudo apt update -y;sudo apt install libelf-dev:i386 libelf1:i386 -y>/dev/null 2>&1

    git clone https://bitbucket.org/kille72/freshtomato-arm.git;sudo ln -s ~/freshtomato-arm/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3 /opt/brcm-arm;echo 'PATH="$PATH:/opt/brcm-arm/bin:/sbin"' >>.profile;mkdir ~/2018.4\ -\ 2018.09.10/;cp -pR freshtomato-arm freshtomato-arm.orig;cd freshtomato-arm;git checkout shibby-arm7;git checkout bede7f789;git reset --hard;git status;sudo shutdown -r now

    cd ~/freshtomato-arm/release/src-rt-6.x.4708/router;sed -i -e '/Ru/d;277s/for port in 80 443/for port in 80/' nocat/libexec/iptables/initialize.fw;sed -i -e 's| ),.*| ),|;/tou/d' rc/nocat.c;sed -i -e's/https:\/\/w/http:\/\/w/g' shared/defaults.c;cd ../../src-rt-7.x.main/src/;sed -i -e 's/BTCLIENT=/NOCAT=y BTCLIENT=/g' Makefile;make ac3200e;mv image/freshtomato* ~/2018.4\ -\ 2018.09.10/.

    cd ../../../;git reset --hard;git clean -dxf;cd release/src-rt-6.x.4708/router;sed -i -e '/Ru/d;277s/for port in 80 443/for port in 80/' nocat/libexec/iptables/initialize.fw;sed -i -e 's| ),.*| ),|;/tou/d' rc/nocat.c;sed -i -e's/https:\/\/w/http:\/\/w/g' shared/defaults.c;cd ../../src-rt-7.x.main/src/;sed -i -e 's/BTCLIENT=/NOCAT=y BTCLIENT=/g' Makefile;make ac3200z;mv image/freshtomato* ~/2018.4\ -\ 2018.09.10/.

    ls -l ~/2018.4\ -\ 2018.09.10/

    total 34520
    -rw-r--r-- 1 build build 24039424 Oct 19 21:32 freshtomato-RT-AC3200-ARM-2018.4-AIO-64K.trx
    -rw-r--r-- 1 build build 11309056 Oct 19 21:05 freshtomato-RT-AC3200-ARM-2018.4-VPN-64K.trx

    If at first don't succeed ? Get error: cannot run test program while cross compiling ? Try again the last lines above starting with cd ../../../;git reset --hard;git clean -dxf; etc.


    When the build(s) finished, install Guest Additions : (Active on next reboot)


    sudo apt dist-upgrade -y;sudo apt install module-assistant dkms -y;yes Y | sudo m-a prepare


    In the VirtualBox window, select Devices > Insert Guest Additions CD image.

    sudo mkdir /mnt/cdrom;sudo mount /dev/sr0 /mnt/cdrom;sudo sh /mnt/cdrom/VBoxLinuxAdditions.run

    sudo umount /mnt/cdrom;cd /mnt/cdrom/;eject;exit


    Done.


    In the end, I got this output from make ac3200z :


    ctools/trx_asus -i image/linux-lzma.trx -r RT-AC3200,3.0.0.4,image/freshtomato-RT-AC3200-ARM-2018.4-"VPN-64K".trx

    Creating ASUS RT-AC3200 firmware to image/freshtomato-RT-AC3200-ARM-2018.4-VPN-64K.trx

    TRX Image:
    Total Size .... : 11309056 (11044.0 KB) (10.8 MB)
    CRC-32 ........ : 90B88F9D



    -----------------
    2018.4 K26ARM USB VPN-64K ready
    -----------------


    If anyone can benefit from my notes, great!


    This will be tested, expects it to be similar to Sean B.'s .trx if it does, how do I troubleshoot when it probably goes into the bootloop ?
     
    Last edited: Oct 30, 2018
    Monk E. Boy, rs232 and Justio like this.
  15. AndreDVJ

    AndreDVJ LI Guru Member

    This looks like an image resultant from ac3200e target, not ac3200z.
     
    tbrautaset likes this.
  16. Sean B.

    Sean B. LI Guru Member

    I believe my build suffered a fault do to remaining packages I had installed for building Toastman. I just haven't had time to investigate further.
     
    tbrautaset likes this.
  17. tbrautaset

    tbrautaset Network Newbie Member

    I've probably made a mistake, anyway, I've edited my notes above and tried to run make ac3200z again and now it looks better:


    ctools/trx_asus -i image/linux-lzma.trx -r RT-AC3200,3.0.0.4,image/freshtomato-RT-AC3200-ARM-2018.4-"AIO-64K".trx

    Creating ASUS RT-AC3200 firmware to image/freshtomato-RT-AC3200-ARM-2018.4-AIO-64K.trx

    TRX Image:
    Total Size .... : 24039424 (23476.0 KB) (22.9 MB)
    CRC-32 ........ : 7E3D40A2



    -----------------
    2018.4 K26ARM USB AIO-64K ready
    -----------------


    Waiting for the 2018.5 release where pedro311 wrote that possibly NOCAT will return!


    Of course, my build did exactly the same as yours;bootloop, no error messages that indicate why ?
     
    Last edited: Oct 24, 2018
  18. Sean B.

    Sean B. LI Guru Member

    Hmm, troubling. @kille72 , @pedro311 .. what are you opinions? 2 separate build systems running 2 different distro's, both landing firmware that causes a bootloop. The only change being a revert of commit 741eab0.

    Perhaps adding NoCat back in, a long with any additions sense its removal, has breached a size limit?

    @tbrautaset , what are the firmware file sizes of all 3 firmware files? The firmware without nocat that you were running, the firmware I built, and the firmware you built.
     
    Last edited: Oct 20, 2018
    tbrautaset likes this.
  19. tbrautaset

    tbrautaset Network Newbie Member

    2018.4 FreshTomato team build = 24 MB (23,961,600 bytes) - without nocat
    2018.5 Your build = 24.1 MB (24,076,288 bytes) - with nocat
    2018.5 My build = 24.1 MB (24,088,576 bytes) - with nocat - Reverts commit 4249f23 and 741eab0, the latter is the one that makes up the total.


    I managed to get in on the router for a few seconds and got this:

    Last line in the log:

    Jan 1 01:01:04 daemon.info dnscrypt-proxy [1406]: Server certificate with serial # 1538418601 received

    and

    Total / Free NVRAM: 64.00 KB / 2048 (3.13%) before it booted again.
     
  20. AndreDVJ

    AndreDVJ LI Guru Member

    I don't like this...
     
  21. tbrautaset

    tbrautaset Network Newbie Member

    Now running 2018.3 with nocat, and the consumption is:

    Total / Free NVRAM 64.00 KB / 1976 (3.02%)
     
  22. AndreDVJ

    AndreDVJ LI Guru Member

    There were changes to NVRAM variables and newer builds do take more space by default. You're likely causing daemons to crash as the newer build try to set required newer values and it doesn't find any space left.
     
    tbrautaset likes this.
  23. Sean B.

    Sean B. LI Guru Member

    Perhaps a VPN build with NoCat enabled, rather than an AIO?
     
    tbrautaset likes this.
  24. Sean B.

    Sean B. LI Guru Member

    Ran a VPN build with NoCat enabled out of curiosity to it's size. Significantly smaller file size at 11.4MB, likely a large reduction in NVRAM usage as well. @tbrautaset , you can download it here if you want to try it out and save yourself the build time.
     
    tbrautaset likes this.
  25. tbrautaset

    tbrautaset Network Newbie Member

    If that is the case and since it runs well on 2018.3 AIO & VPN, how can I build 2018.4 that will be 2018.4 build and not 2018.5 ?! or is not possible because of the way kille72 merges and updates his git repo ?

    Thank you very much, but unfortunately the same behavior, bootloop, will try to build the same build that you made for me, but with reverted commits 4249f23 and 741eab0. Wondering if there is anything in the git repo that caused this ..
     
  26. Sean B.

    Sean B. LI Guru Member

    Did you happen to note what the NVRAM usage was when you tried the VPN build?

    I would suggest, if you have the time, is to run 2 specific builds. First would be to checkout 2018.3 and run an AIO build. If this firmware works without boot looping, it eliminates the build system and packages used for compilation as a possible source of the problem. Then checkout the master again and run an AIO build ( do not change anything, such as adding nocat back in ). If that one does boot loop, it confirms the issue is rooted in code change(s) between 2018.3 and now.

    **NOTE** When using git, don't forget to verify your source tree is completely clean after each build. When switching checkouts or restoring one after a build use:

    Code:
    git reset --hard
    git status
    Anything listed from git status has been modified/created locally and must be deleted manually, then run the reset command and status command again to verify everything is clear.
     
    Last edited: Oct 21, 2018
    tbrautaset likes this.
  27. tbrautaset

    tbrautaset Network Newbie Member

    Here are some nvram statistics:


    Current Version: 2018.3 K26ARM USB AIO-64K
    Free Memory: 229.88 MB (aprox. size that can be buffered completely in RAM)

    Total / Free Memory 249.55 MB / 229.91 MB (92.13%)
    Total / Free NVRAM 64.00 KB / 2048 (3.13


    Current Version: 2018.4 K26ARM USB VPN-64K
    Free Memory: 233.79 MB (aprox. size that can be buffered completely in RAM)

    Total / Free Memory 249.62 MB / 233.02 MB (93.35%)
    Total / Free NVRAM 64.00 KB / 2048 (3.13%)



    Current Version: 2018.5 K26ARM USB VPN-64K
    Free Memory: 232.89 MB (aprox. size that can be buffered completely in RAM)

    Total / Free Memory 249.62 MB / 233.90 MB (93.70%)
    Total / Free NVRAM 64.00 KB / 2048 (3.13%)



    All my challenges started when I was to upgrade to version 2018.4 and expected my existing setup to work with nocat: Captive Portal feature


    Can you see if I'm missing something the way I do it in this post above?
     
  28. Sean B.

    Sean B. LI Guru Member

    I don't see how the AIO and VPN builds could have exactly the same NVRAM usage. Have you cleared the NVRAM using the hard buttons? If not I'd suggest doing so by turning off the router, holding down the WPS button and turning on the router. Continue holding down the WPS button until the router either reboots or begins to blink the power light. Reboot router if it didn't do it itself and see if anything has changed.
     
    tbrautaset likes this.
  29. tbrautaset

    tbrautaset Network Newbie Member


    A few steps back first...


    NVRAM usage 2018.5 K26ARM USB VPN-64K build with reverted commits 4249f23 and 741eab0 = Total / Free NVRAM 64.00 KB / 2048 (3.13%)


    2018.3 K26ARM USB AIO-64K is the current and all good version running now, and before the upgrades as my daily driver with NOCAT !!

    Free Memory: 229.88 MB (aprox. size that can be buffered completely in RAM)

    Total / Free Memory 249.55 MB / 229.91 MB (92.13%)
    Total / Free NVRAM 64.00 KB / 2048 (3.13

    This firmware works without boot looping :)


    The issue is rooted in code change(s) between 2018.3 and now.


    Gonna try this when my family is not hardcore online, coming back with the results. Thank you so far :)
     
    Last edited: Oct 21, 2018
  30. tbrautaset

    tbrautaset Network Newbie Member

    Something I wonder why in this example:


    git clone https://bitbucket.org/kille72/freshtomato-arm.git


    Cloning into 'freshtomato-arm'...
    remote: Counting objects: 243916, done.
    remote: Compressing objects: 100% (115122/115122), done.
    remote: Total 243916 (delta 124919), reused 240995 (delta 122276)
    Receiving objects: 100% (243916/243916), 642.27 MiB | 23.01 MiB/s, done.
    Resolving deltas: 100% (124919/124919), done.
    Checking out files: 100% (109366/109366), done.


    freshtomato-arm$ git checkout v2018.3;git branch;git clean -fdxq && git reset --hard;git checkout shibby-arm7
    Note: checking out 'v2018.3'.


    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.

    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:

    git checkout -b <new-branch-name>

    HEAD is now at 878f26dd6... update CHANGELOG
    * (HEAD detached at v2018.3)
    shibby-arm
    HEAD is now at 878f26dd6 update CHANGELOG
    Checking out files: 100% (42853/42853), done.
    Previous HEAD position was 878f26dd6... update CHANGELOG
    Branch shibby-arm7 set up to track remote branch shibby-arm7 from origin.
    Switched to a new branch 'shibby-arm7'



    freshtomato-arm/release/src-rt-7.x.main/src$ make ac3200z V1=1.28.0000 V2=3.5-140


    ctools/trx_asus -i image/linux-lzma.trx -r RT-AC3200,3.0.0.4,image/freshtomato-RT-AC3200-ARM-2018.5.0013.5-140-"AIO-64K".trx

    Creating ASUS RT-AC3200 firmware to image/freshtomato-RT-AC3200-ARM-2018.5.0013.5-140-AIO-64K.trx

    TRX Image:
    Total Size .... : 24088576 (23524.0 KB) (23.0 MB)
    CRC-32 ........ : 76ED45AD



    -----------------
    2018.5.001 3.5-140 K26ARM USB AIO-64K ready
    -----------------


    Why 2018.5, where is 2018.3 ??

    How do I create a clean build 2018.3 without any interference from the source code after this build ??
     
  31. Sean B.

    Sean B. LI Guru Member

    The version tags are part of the shibby-arm branch, not shibby-arm7, The arm7 branch is made up of periodic merges from the arm branch. Run this:

    Code:
    git checkout shibby-arm7
    git checkout 10fe170
    git reset --hard
    git status
    Verify git status returns clear. This will put you at the closest arm->arm7 merge following the bump commit to 2018.3 .
     
    tbrautaset likes this.
  32. rs232

    rs232 Network Guru Member

    @tbrautaset

    I just wanted to say well done! I'm always impressed with people that commit to a topic with such a determination. I admit I wouldn't have put 1c on your initial request to reimplement the captive portal. I know you're not there yet but your commitment and determination proved me wrong. We really need more people like you to actually get things done.

    hat off
     
    RogueScholar and tbrautaset like this.
  33. tbrautaset

    tbrautaset Network Newbie Member

    @rs232

    Thank you very much, always nice with good feedback! Especially when TomatoUSB building is a major PITA on its own, something AndreDVJ was quite right in that it was. Luckily, have received a lot of help here on the forum by reading other posts and getting many great tips by @AndreDVJ, @Sean B., @Monk E. Boy, and had to teach myself a lot about building and compiling in relationship with FreshTomato-ARM and Asus RT- AC3200.
     
  34. tbrautaset

    tbrautaset Network Newbie Member

    This was great information, if i do git checkout bede7f789 and want the + remaining commits till e0682db98 how do I do that? Have tried git checkout e0682db98, but then it fails with no .mak file.., admitting that I'm struggling with git and getting clean build folders = several dry runs, something I still do as one can read in my previous posts above in this thread. Understand that I have to do something about my nvram config, here are the top 20 that takes up space :


    nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20

    size: 63544 bytes (1992 left)

    3359 https_crt_file
    2145 qos_orules
    1089 sshd_hostkey
    719 adblock_blacklist
    624 sshd_dsskey
    300 macnames
    274 sch_c1_cmd
    240 portforward
    202 sshd_ecdsakey
    193 wl2.2_maclist
    193 wl2.1_maclist
    193 wl0.2_maclist
    193 wl0.1_maclist
    191 wl2_maclist
    191 wl1_maclist
    191 wl0_maclist
    190 wl_maclist



    Next, I’ll try my new builds with nvram cleared and possibly with WPS clearing to see if there's any difference regarding nvram size and bootloop :rolleyes:


    Still waiting for the 2018.5 release where @pedro311 wrote that possibly NOCAT will return!
     
    Last edited: Oct 29, 2018
  35. Sean B.

    Sean B. LI Guru Member

    Before you build, are you confirming your source tree is clean and correct via " git status "?
     
    tbrautaset likes this.
  36. Sean B.

    Sean B. LI Guru Member

    I made a script that makes clearing the source tree between builds quick and easy. Put it in a file one directory above your tomato git repo. IE: If your repo root dir is /home/me/git/freshtomato-arm/ .. then put the file in /home/me/git/ . Let's say you named the file " clearsource " , next you'd run "chmod +x clearsource" so it's executable. Whenever you need to clear the source tree, change directory to the repo root ( IE: /home/me/git/freshtomato-arm/ ) and run: ../clearsource

    Code:
    #!/bin/sh
    COUNT=0
    
    echo "WARNING! This will delete any and all local changes to this repo. Continue? Y/N"
    read answer
    
    if [ "$answer" == "${answer#[Yy]}" ]
      then
        echo "Exiting."
        exit 1
    fi
    
    # Reset the repo
    
    echo "Resetting repo.."
    
    git reset --hard >/dev/null
    
    echo "   done."
    
    echo "Checking source tree for remaining garbage.."
    
    if [ "$(git status --porcelain)" == "" ]
      then
        echo "   Repo source tree is sterile."
        echo "done."
        exit 0
      else
        echo "   Cleaning.."  
    fi
    
    # Cleanup any remaning modified or untracked files
    
    for line in $(git status --porcelain | cut -c4-); do
    rm -rf $line && COUNT=$((COUNT+1))
    done
    
    echo "   Deleted $COUNT modified/untracked files"
    echo "   done."
    
    # Reset the repo one more time
    
    echo "Resetting repo again and verifying status.."
    
    git reset --hard >/dev/null
    
    if [ "$(git status --porcelain)" == "" ]
     then
       echo "   Repo source tree is sterile."
       echo "done."
       exit 0
     else
       echo "ERROR: Git status does not report a clean source tree."
       exit 1
    fi
     
    Last edited: Oct 25, 2018
    Justio and tbrautaset like this.
  37. tbrautaset

    tbrautaset Network Newbie Member

    Eh yes or maybe not ?, VPN builds are running ok while AIO builds stops with error messages and it all seems very random. Obviously, I do not understand this at all.

    Either way, in a brand new build enviroment AIO build fails, to correct this I'm running git reset - hard and git clean -dxf in freshtomato-arm directory and run make again, then all is ok. But It must be wrong for a first time build, since there is nothing to clean .?.

    The only difference between first failed attempt and the second successful attempt is a binary index file under .git directory that changes in size and in last attempt a file called ORIG_HEAD appears in the same directory.



    All new and fresh AIO builds are like this one and starts with:

    Cloning into 'freshtomato-arm'...
    remote: Counting objects: 243916, done.
    remote: Compressing objects: 100% (115153/115153), done.
    remote: Total 243916 (delta 124918), reused 240966 (delta 122245)
    Receiving objects: 100% (243916/243916), 642.21 MiB | 21.34 MiB/s, done.
    Resolving deltas: 100% (124918/124918), done.
    Checking out files: 100% (109366/109366), done.
    Checking out files: 100% (39285/39285), done.
    Branch shibby-arm7 set up to track remote branch shibby-arm7 from origin.
    Switched to a new branch 'shibby-arm7'
    Checking out files: 100% (3541/3541), done.
    Note: checking out '2284bdf'.

    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.

    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:

    git checkout -b <new-branch-name>

    HEAD is now at 2284bdf84... Merge branch 'shibby-arm' into shibby-arm7

    Checking out files: 100% (147901/147901), done.
    HEAD is now at 2284bdf84 Merge branch 'shibby-arm' into shibby-arm7
    HEAD detached at 2284bdf84
    nothing to commit, working tree clean

    make[1]: Entering directory '/home/build/freshtomato-arm/release/src-rt-7.x.main/src'
    ...>

    And ends with:

    ..>
    configure: error: cannot run test program while cross compiling
    See `config.log' for more details
    Makefile:472: recipe for target 'config.status' failed
    make[5]: *** [config.status] Error 1
    make[5]: Leaving directory '/home/build/freshtomato-arm/release/src-rt-6.x.4708/router/mysql'
    Makefile:2254: recipe for target 'mysql' failed



    Thank you for the nice script!!, not sure what the problem is regarding AIO builds ?


    Ran your script on a failed AIO build :


    ~/freshtomato-arm$ ../clearsource
    WARNING! This will delete any and all local changes to this repo. Continue? Y/N
    Y
    ../clearsource: 7: [: Y: unexpected operator
    Resetting repo..
    done.
    Checking source tree for remaining garbage..
    ../clearsource: 23: [: ?? release/src-rt-6.x.4708/btools/fpkg
    ?? release/src-rt-6.x.4708/router/.config
    ?? release/src-rt-7.x.main/src/image/
    ?? release/src-rt-7.x.main/src/linux/linux-2.6.36/config_e: unexpected operator
    Cleaning..
    Deleted 8726 modified/untracked files
    done.
    Resetting repo again and verifying status..
    ../clearsource: 47: [: unexpected operator
    ERROR: Git status does not report a clean source tree.



    Possible my challenges do not lie in having garbage in my source directories, but in the git repo ?

    Can accept that a build crashes at first try, but this seems a bit odd ...
     
    Last edited: Oct 25, 2018
  38. tbrautaset

    tbrautaset Network Newbie Member

    Starting with nvram cleared and this " for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done; nvram commit " in the startup script, and carefully then see what I can configure is the only solution:oops:, any average consumption of nvram before bootloop ?

    Too bad ASUS kept the nvram size at 64K when they added to the third radio, which takes up at least one extra 6K nvram space for its support:(
     
  39. AndreDVJ

    AndreDVJ LI Guru Member

    No idea, until my R8000 becomes my main router, which is pending since April 2017.

    What I can tell so far:
    • You could save almost 700 bytes by getting rid of all Adblock blocklists per example.
    • Perhaps clean up QoS rules if you don't use QoS.
    • Why that many Virtual Wireless interfaces enabled?
    I'd give a thought if you need that many resources enabled at once.
     
  40. Sean B.

    Sean B. LI Guru Member

    The spacing got mangled via copy/paste.
     
  41. Sean B.

    Sean B. LI Guru Member

    @tbrautaset , if you haven't already, I'd suggest reporting your boot-loop issue in the main FreshTomato-arm thread. There is a report for an R8000 bootlooping via 2018.4 , downloaded pre-compiled firmware.
     
  42. tbrautaset

    tbrautaset Network Newbie Member

    Thank you for the tips on optimizing nvram consumption, the reason for so many virtual wireless interfaces? Have kids who think it's fun to have their own SSID.
    My minimal Linux installation did not understand the operators in the script, work fine with posix default to not have dobble operators == Again thanks for the script :)
    Think my challenges are related to my poor git knowledge and / or something special related when making builds for the ARM7 / Asus RT-AC3200 ?

    Made builds of all @kille72's committed merges from 976cc15 2018-06-30 to e003463 2018-10-27 and tried all 19 and ended up with 9239e43 including nocat by reverting commits 4249f23 and 741eab0 successfully with the same nvram configuration I had before starting this thread, waiting for the 2018.5 release where @pedro311 wrote that possibly NOCAT will return! ;)

    Thank you to all who have contributed, I' m pleased with the end result :cool:
     
    Last edited: Oct 30, 2018
  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