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

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

CFE bootloader update

Discussion in 'ASUS N Routers & Adapters' started by ryzhov_al, Oct 13, 2012.

Thread Status:
Not open for further replies.
  1. fritsp1989

    fritsp1989 Regular Contributor

    Joined:
    Sep 4, 2012
    Messages:
    101
    Location:
    NL/Limburg/Weert
    I can comfirm this!

    Normal boot =37 sec
    Boot with nvram variable = 56 sec +/-
     
  2. Koenig

    Koenig Occasional Visitor

    Joined:
    Oct 14, 2012
    Messages:
    43
    OK, so now I have erased the nvram through this command:

    $ mtd-erase -d nvram

    Then I immidiately pulled the powercord, waited about 30 sec, then put the cord back and started watching the leds.

    It booted up, stopped for a while then it rebooted again, here my first thought was "Bootloop" but it just continued throughout the second boot.
    Then I logged in and everything was reset to default, so I restored my settings and now it is working as it should.

    I suppose this was the ultimate test that the updated cfe is actually working.

    I also did a:

    $ nvram get bl_version

    From that I got: 1.0.1.3

    Should probably mention that during all of this I used shibbys tomato AIO 64kB build 101

    I also booted it into recovery-mode and accessed the cfe's small webserver without any issues.


    Now I ask myself, what would have happened if I had done the same thing with the old cfe and a firmware that used a "kernelhack"....?
    wouldn't the same thing have happened?
     
  3. fritsp1989

    fritsp1989 Regular Contributor

    Joined:
    Sep 4, 2012
    Messages:
    101
    Location:
    NL/Limburg/Weert
    Yeah now i am wondering is this CFE is 64k enabled then how does it work with the merlin WRT because that uses a kernel hack.
    Same count for the shibby build a kernel hack.
    I think i made a big mistake flashing this cfe actually, no one seems to dare to flash this new CFE so they will stick the 64k kernel hacked versions.
    So i dont really think anybody is going to release a firmware for us that really uses the CFE we now have.

    I am thinking about just going to flash ddwrt onto it an see what happens, i would be able to recover trough the mini web server dont i ?
     
  4. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    32,146
    Location:
    Canada
    That has no incidence at all. The RT-AC66U also has a 64 KB CFE, and it works just fine. The code only handle cases where only 32 KB are detected.
     
  5. RogerSC

    RogerSC Part of the Furniture

    Joined:
    Oct 18, 2009
    Messages:
    2,276
    Did this today...

    The most time-consuming part of this for me was installing Virtual Box (just for fun, I normally use VMware player but wanted to try Virtual Box), then openSUSE linux, and then getting scp working between linux and the router *smile*. Turns out that sshd, even though it was initially running, was essentially dead.

    The rest (rebuilding the bootloader and reflashing it) was a piece of cake with all the information here. I certainly was glad I had saved my router settings, since I needed to erase the nvram before it would update the cfe version...the version after I initially flashed it was 1.0.1.2, then it was empty. After I erased the nvram, though, it finally changed to 1.0.1.3. So after I restored my old settings, everything is great now.
     
    Last edited: Oct 17, 2012
  6. Gingernut

    Gingernut Senior Member

    Joined:
    Sep 18, 2009
    Messages:
    271
    Mine says 1.0.1.3 now but I did a full back to CFE defaults wipe.

    This is how I did it:

    Unplug router.

    Press an hold WPS button on routers back and plug router back in.

    Wait about 30 seconds and then release the WPS button.

    Reconfigure settings.
     
    Last edited: Oct 17, 2012
  7. Pierino

    Pierino Very Senior Member

    Joined:
    Jul 13, 2012
    Messages:
    901
    Location:
    Columbus Ohio
    Could someone write up a more detailed guide please?
    I tried to do this by using a Linux mint 13 live cd and the latest Ubuntu.
    I opened up a terminal window, telnet into the router, copied and pasted the command line from the OP to get the original.cfe but it doesn't work.
    I tried with and without the $ sign.

    I have no experience with Linux.
     
  8. carolus1977

    carolus1977 New Around Here

    Joined:
    Oct 17, 2012
    Messages:
    2
    Hi All,

    I followed the all steps from the first post to build new CFE image and no errors were reported.

    [[email protected] n66u]# ./cfe_update.sh cfe.original cfe.new
    [1/4] Dumping default NVRAM settings from your CFE...
    nvram start 0x400
    nvram end 0x1388
    nvram len 3956
    nvram crc 0xcf
    nvram ver 0x01
    [2/4] Modifying NVRAM settings (silent step)...
    [3/4] Creating new CFE...
    4092+0 records in
    4092+0 records out
    4092 bytes (4.1 kB) copied, 0.00382228 s, 1.1 MB/s
    [4/4] Checking differences between NVRAM from old and new CFE's
    1c1
    < bl_version=1.0.1.2
    ---
    > bl_version=1.0.1.3
    16a17
    > odmpid=ASUS
    If you see only two differences: one is for 'bl_version' and second is a new 'odmpid=ASUS' variable then all step are done! New CFE image 'cfe.new' is prepared for flash.
    [[email protected] n66u]#

    But while I tried to flash it some errors were raised.

    Tomato v1.28.0000 MIPSR2-101 K26 USB AIO-64K
    [email protected]:/tmp/home/root# ll
    -rw-r--r-- 1 root root 133428 Oct 16 22:12 cfe.new
    -rw-r--r-- 1 root root 262144 Oct 15 22:14 cfe.original
    [email protected]:/tmp/home/root# mtd-write -i cfe.new -d pmon
    File contains an invalid header
    [email protected]:/tmp/home/root# mtd-write -i cfe.new -d pmon
    System is busy
    [email protected]:/tmp/home/root# mtd-write -i cfe.new -d pmon
    System is busy
    [email protected]:/tmp/home/root#

    Any idea how to deal with it?

    Regards
     
    Last edited: Oct 17, 2012
  9. Koenig

    Koenig Occasional Visitor

    Joined:
    Oct 14, 2012
    Messages:
    43
    I read at another forum regarding this, and someone mentioned that tomato does not allow writing to the cfe-partition.

    http://www.linksysinfo.org/index.php?threads/cfe-bootloader-update-on-asus-rt-n66u-router.47698/

    Post number 12.
     
  10. RogerSC

    RogerSC Part of the Furniture

    Joined:
    Oct 18, 2009
    Messages:
    2,276
    By the way, now that I've used Virtual Box, I don't need to use it again. I haven't tried VMware Player with Linux on my home system yet, but the way that openSUSE looked on Virtual Box, it was about the worst VM I've ever used, and I've used a lot (mostly with VMware Player, Workstation, and ESX server). Next time I don't need to use Virtual Box, I'll just use VMware Player.
    In fact, that's the next thing that I'll do, I can't believe that openSUSE has gone down that much in quality since I last used it.
     
  11. carolus1977

    carolus1977 New Around Here

    Joined:
    Oct 17, 2012
    Messages:
    2
    Thx for you replay. I've just tried the same on merlin and then 30/30/30 reset procedure and now it's just fine:).

    ASUSWRT RT-N66U_3.0.0.4 Tue Sep 25 02:53:14 UTC 2012
    [email protected](none):/tmp/home/root# nvram get bl_version
    1.0.1.3
    [email protected](none):/tmp/home/root#
     
  12. RogerSC

    RogerSC Part of the Furniture

    Joined:
    Oct 18, 2009
    Messages:
    2,276
    The rest of the story...same installation of openSUSE 12.2 using VMware Player is so so much better. Install was much faster, and the VM is great, much more stable desktop behavior, and the whole VM runs so much more reasonably. No more Virtual Box for me, but I had to try it. Maybe my experience was unique, though.
     
  13. Revenent

    Revenent Occasional Visitor

    Joined:
    Mar 24, 2012
    Messages:
    11
    2 questions:

    1. Does anybody have the source to nvserial? Was hoping to make a Windows version to avoid having to go through a Linux VM just for one thing.
    2. Did you guys just use a USB drive to drag the original CFE off, or was there a way to copy files off the router I didn't know about?
     
  14. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    32,146
    Location:
    Canada
    Might depend on a lot of factors (for instance, did you install the VBox Tools to enable actual paravirtualization at the kernel level?). Not sure either at the level of support VBox has for OpenSuse.

    I do all my firmware development using Ubuntu 12.04 under VirtualBox.
     
  15. fritsp1989

    fritsp1989 Regular Contributor

    Joined:
    Sep 4, 2012
    Messages:
    101
    Location:
    NL/Limburg/Weert
    You can use WINSCP you can just drag and drop the files of the router see it as a router browser or something haha.

    Going the part for the VMbox isnt the hard way believe me its the part where you will find out what you did right and what you did wrong.

    So please just use linux for this kind of CFE manipulation, it can break a lot if did wrong
     
  16. Revenent

    Revenent Occasional Visitor

    Joined:
    Mar 24, 2012
    Messages:
    11
    Hmm.

    WinSCP didn't work - I've tried all the options. I'm running stock .4.220 - do I need to do something to make it work with WinSCP?

    As for the hard way - I'm a sucker for punishment. :)

    If all nvserial is doing is just injecting the strings back into the CFE binary, it shouldn't be hard to figure out. Does it do any checksumming along the way? Modify anything else in that blob region?
     
  17. RogerSC

    RogerSC Part of the Furniture

    Joined:
    Oct 18, 2009
    Messages:
    2,276
    I did a standard install, nothing extra, didn't uncheck anything, either. I should have gotten all the standard VBox stuff, then. It certainly didn't like openSUSE (install took a lot longer than I thought it should), or KDE (acted very strangely, not at all like a real system or like it does with Player). I did configure more memory than it suggested...it suggested about 750MB., and I selected 2GB), but that shouldn't make it worse.

    I should try Ubuntu with VBox, but openSUSE is so well-behaved with Player, I really don't have a reason to do that *smile*.

    Have to admit that I was amazed that it was so bad.
     
  18. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    32,146
    Location:
    Canada
    VBox Guest Addon tools need to be installed after you have completed the OS install, otherwise the network, disk I/O, video and mouse pointer will be emulated rather than run native. This makes a huge difference in terms of performance. Under "Devices" there is a menu entry saying "Install Guest Addons" that will mount a virtual CD image under the Guest OS, where you will be able to install the guest tools to optimize your VM performance.
     
  19. Pierino

    Pierino Very Senior Member

    Joined:
    Jul 13, 2012
    Messages:
    901
    Location:
    Columbus Ohio
    I finally extracted my original.cfe, moved it to the same folder where I extracted the archive, but when I run "./cfe_update.sh cfe.original cfe.new", it tells me it can't find cfe_update.sh even though I see it in the folder.
     
  20. RogerSC

    RogerSC Part of the Furniture

    Joined:
    Oct 18, 2009
    Messages:
    2,276
    Chances are that you need to say:

    ./cfe_update.sh ./cfe.original ./cfe.new

    Since "." (current directory) is not usually in $PATH. You can add it to $PATH, but there are some security implications.
     
Thread Status:
Not open for further replies.