What's new

CFE bootloader update

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Status
Not open for further replies.
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?
 
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?

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 ?
 
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.

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.
 
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:
You can see that the permission to the files are different.

Did you unpack the files to a folder with a linux filesystem?

EDIT:

same for me as for Gingernut:

$ nvram get bl_version

gives me: 1.0.1.2

shouldn't that have been reset during the 30/30/30?


How is it for you now Gingernut, after your reset?

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:
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.
 
Hi All,

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

[root@fedora-clone1 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.
[root@fedora-clone1 n66u]#

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

Tomato v1.28.0000 MIPSR2-101 K26 USB AIO-64K
root@unknown:/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
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
File contains an invalid header
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
System is busy
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
System is busy
root@unknown:/tmp/home/root#

Any idea how to deal with it?

Regards
 
Last edited:
Tomato v1.28.0000 MIPSR2-101 K26 USB AIO-64K
root@unknown:/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
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
File contains an invalid header
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
System is busy
root@unknown:/tmp/home/root# mtd-write -i cfe.new -d pmon
System is busy
root@unknown:/tmp/home/root#

Any idea how to deal with it?

Regards

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.
 
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.

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.
 
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.

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
admin@(none):/tmp/home/root# nvram get bl_version
1.0.1.3
admin@(none):/tmp/home/root#
 
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.

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.
 
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?
 
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.

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.
 
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?

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
 
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

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?
 
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.

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.
 
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.

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.
 
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.
 
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.

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.
 
Status
Not open for further replies.

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top