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.
I get error: not an http or ftp url
Fixed: uploaded to another hosting.

Try: tar -zxf ./cfe_n66u-1.0.1.3-4.tgz
Thanks, manual fixed.

So if I use my cfe.original with the extra variables in it, with the new 1.0.1.3-4 tgz, will I get a correct usable 1.0.1.3 cfe?
If cfe.original is an original stock CFE 1.0.1.2 then yes. Anyway, script will check original CFE version before upgrade.

It's safe to update, because cfe.original is 256 kib and cfe.new is 130 kib?
Safe. Take a look at the last third of HEX dump of cfe.original. A garbage here, not real code. You a saving whole CFE flash partition, whole 256Kb with useless tail, thats ok.
 
Last edited:
assuming you have 1.0.1.2 cfe in cfe_old.bin:
1. extract nvram from the origianl cfe to nvram.txt, using offset autodetection

2. edit nvram.txt as you like (replace bl_version and add odmpid, for example)

3. prepare new 1.0.1.3 cfe with no nvram embedded

4. install modified nvram.txt into new cfe, using offset 0x400 and length 4092 (suitable for 1.0.1.3 cfe)

5. do something on your own with cfe_new.bin
Just for the record... I finally managed to access CFE miniWeb Server, I was using IP 192.168.1.1 when it should be my router's IP 192.168.2.1

Concluding, the MIROn method for update the CFE works without flaws, at least for me. Thank you very much for your help, MIROn!!!

Regards,

- lfbb
 
ryzhov_al

Thank you again for your work with the scripts you made.
I updated my 0.3 CFE with the new corrected version and all are fine.

My Dark Knight now is ready to fly with all the available firmwares including dd-wrt.

For the moment i stay on latest version of Merlin's Asus-wrt because is very nice - very stable and has everything i need.
 
ryzhov_al

Thank you! The script worked flawlessly. Thank God, I've saved my cfe.old from 1.0.1.2 and previous upgrade. So far, so good!
 
Hello,

Just to be clear if we saved a copy of our "original" cfe, do I just rename it "cfe.old" and copy it over to the router then run "./cfe_update.sh ./cfe.old"
 
Last edited:
Is not necessary to rename nothing.
All cfe are bin files.

ex. my cfe file-name was cfe.bin
so i run the command matching the same name.

i run ./cfe-update.sh ./cfe.bin and all was ok.....
 
Last edited:
Just took the road less traveled *smile*. Took the 1.0.1.2 cfe posted on ddwrt forum, converted it for my router, and then updated it to 1.0.1.3. Everything looked good, so I flashed it.

Things are just fine now.
 
Been so long since I did this, I no longer remember where to put the cfe.new. I'm logged into the router using winscp on windows xp, which is what I did back in October.
Could some one be so kind as to tell me what directory to put it in? Also the exact command in telnet?
The telnet command is mtd-write -i cfe.new -d pmon, correct?

Figured out the directory.
Is the command correct?

Edit #2. Success, I now get vlanports=1 2 3 4 8*
 
Last edited:
Just took the road less traveled *smile*. Took the 1.0.1.2 cfe posted on ddwrt forum, converted it for my router, and then updated it to 1.0.1.3. Everything looked good, so I flashed it.

Things are just fine now.

Just remember to take a backup of your Config before proceed with cfe upgrade.

steps are....


  • [*]Take a backup of your config...
    [*]Proceed with cfe upgrade...
    [*]Reboot device
    [*]Proceed with nvram clear - delete (Factory Default)
    [*]Reboot device
    [*]Upload the saved config
    [*]End of procedure.....
 
Just remember to take a backup of your Config before proceed with cfe upgrade.

steps are....


  • [*]Take a backup of your config...
    [*]Proceed with cfe upgrade...
    [*]Reboot device
    [*]Proceed with nvram clear - delete (Factory Default)
    [*]Reboot device
    [*]Upload the saved config
    [*]End of procedure.....

Thanks, I backed up everything this time *smile*. You can be sure of that, no more hex editors for me. And just a note for others, since "admin"'s home directory is in /tmp, be sure that you do your backups before you reboot your router. Anything in "admin"'s home directory will be gone after a reboot *smile*.
 
Thanks, I backed up everything this time *smile*. You can be sure of that, no more hex editors for me. And just a note for others, since "admin"'s home directory is in /tmp, be sure that you do your backups before you reboot your router. Anything in "admin"'s home directory will be gone after a reboot *smile*.

Actually, I'm not sure if it was the reboot, or the reset, or the power-cycle, but when I got done with all those, "admin" home directory was empty. Probably the power-cycle, now that I think about it.
 
If cfe.original is an original stock CFE 1.0.1.2 then yes. Anyway, script will check original CFE version before upgrade.

And what if my CFE version is 1.0.1.1?
 
For those questions above about what the default nvram vars actually mean - I suggest you look at at the descriptions in the Asus GPL sourcecode for the AC version CFE, which is included in rmerlins git src

https://github.com/RMerl/asuswrt-me...oadcom/bcm947xx/compressed/rt-ac66u_nvram.txt

The CFE code does compile easily with only a couple of compiler warnings (just need a copy of nvserial from an earlier release), but I don't recommend anyone trying to use it with such a pricey router!
 
And what if my CFE version is 1.0.1.1?
Must be OK, but no one tested.


For those questions above about what the default nvram vars actually mean - I suggest you look at at the descriptions in the Asus GPL sourcecode for the AC version CFE, which is included in rmerlins git src
...
The CFE code does compile easily with only a couple of compiler warnings (just need a copy of nvserial from an earlier release), but I don't recommend anyone trying to use it with such a pricey router!
We tried to port it for RT-N66U without any success, because RT-AC66U got a different flash type and layout. Router falls into a recovery mode without any chance to boot normal way.
 
Really appreciate everyone's work on this, but no success here. I've got RT-N66U hardware version B1 & firmware 1.0.1.2. Running Tomato Firmware v1.28.0500 MIPSR2Toastman-RT-N K26 USB Ext. No connection on WAN during the update.

I downloaded cfe_n66u-1.0.1.3-4.tgz and transferred it to the router using WinSCP. Connected to the router with SSH.

Sent command "tar -xzf ./cfe_n66u-1.0.1.3-4.tgz" No errors & a bunch of files were shown by WinSCP. Copied all files to computer.

Sent comand "./cfe_update.sh /dev/mtd0ro" 2 changes shown. Told it to flash (Y).

It said "File contains an invalid header" followed by "Update completed."

Rebooted. "cat /dev/mtd0ro | grep bl_version" still shows bl_version=1.0.1.2

Below is the full SSH session.

--------------------------------------------------------------------------

login as: root
root@192.168.1.1's password:


Tomato v1.28.0500 MIPSR2Toastman-RT-N K26 USB Ext
root@unknown:/tmp/home/root# cat /dev/mtd0ro | grep bl_version
bl_version=1.0.1.2
root@unknown:/tmp/home/root# tar -xzf ./cfe_n66u-1.0.1.3-4.tgz
root@unknown:/tmp/home/root# ./cfe_update.sh /dev/mtd0ro
[1/4] Dumping default NVRAM settings from original CFE...
nvram header found:
start 0x400
end 0x13c4
len 4036
crc 0xc0
ver 0x01
[2/4] Preparing new CFE...
nvram header created:
start 0x400
end 0x13c8
len 4040
crc 0x48
ver 0x01
[4/5] Checking differences between NVRAM from old and new CFE's
--- nvram_orig.txt 1969-12-31 22:03:21.577714997 -0200
+++ nvram_updated.txt 1969-12-31 22:03:21.677714997 -0200
@@ -4 +4 @@
-bl_version=1.0.1.2
+bl_version=1.0.1.3
@@ -19,0 +20 @@
+odmpid=ASUS
If you see only two differences: one is for 'bl_version' variable change
and second is a new 'odmpid=ASUS' variable then all goes well!
[5/5] Flashing new CFE...
Do you want to flash a new CFE bootloader that? [y,n]y...flashing...
File contains an invalid header
Update completed. Old CFE is stored to cfe.old file, a new one - to cfe.new
It's strongly recommended to store them, just in case.
Please note, your personal MAC addresses in there, do not distribute them.
root@unknown:/tmp/home/root#
 
Really appreciate everyone's work on this, but no success here. I've got RT-N66U hardware version B1 & firmware 1.0.1.2. Running Tomato Firmware v1.28.0500 MIPSR2Toastman-RT-N K26 USB Ext. No connection on WAN during the update.

I downloaded cfe_n66u-1.0.1.3-4.tgz and transferred it to the router using WinSCP. Connected to the router with SSH.

Sent command "tar -xzf ./cfe_n66u-1.0.1.3-4.tgz" No errors & a bunch of files were shown by WinSCP. Copied all files to computer.

Sent comand "./cfe_update.sh /dev/mtd0ro" 2 changes shown. Told it to flash (Y).

It said "File contains an invalid header" followed by "Update completed."

Rebooted. "cat /dev/mtd0ro | grep bl_version" still shows bl_version=1.0.1.2

Below is the full SSH session.

--------------------------------------------------------------------------

login as: root
root@192.168.1.1's password:


Tomato v1.28.0500 MIPSR2Toastman-RT-N K26 USB Ext
root@unknown:/tmp/home/root# cat /dev/mtd0ro | grep bl_version
bl_version=1.0.1.2
root@unknown:/tmp/home/root# tar -xzf ./cfe_n66u-1.0.1.3-4.tgz
root@unknown:/tmp/home/root# ./cfe_update.sh /dev/mtd0ro
[1/4] Dumping default NVRAM settings from original CFE...
nvram header found:
start 0x400
end 0x13c4
len 4036
crc 0xc0
ver 0x01
[2/4] Preparing new CFE...
nvram header created:
start 0x400
end 0x13c8
len 4040
crc 0x48
ver 0x01
[4/5] Checking differences between NVRAM from old and new CFE's
--- nvram_orig.txt 1969-12-31 22:03:21.577714997 -0200
+++ nvram_updated.txt 1969-12-31 22:03:21.677714997 -0200
@@ -4 +4 @@
-bl_version=1.0.1.2
+bl_version=1.0.1.3
@@ -19,0 +20 @@
+odmpid=ASUS
If you see only two differences: one is for 'bl_version' variable change
and second is a new 'odmpid=ASUS' variable then all goes well!
[5/5] Flashing new CFE...
Do you want to flash a new CFE bootloader that? [y,n]y...flashing...
File contains an invalid header
Update completed. Old CFE is stored to cfe.old file, a new one - to cfe.new
It's strongly recommended to store them, just in case.
Please note, your personal MAC addresses in there, do not distribute them.
root@unknown:/tmp/home/root#


You must use stock firmware or Merlins when doing the upgrade, tomato does not allow writing to CFE.

@ ryzov_al: This is something you should add to the first post.
 
Last edited:
Status
Not open for further replies.

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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