Question about using dd-wrt on EA6500v2

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2
Author Message
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1939

PostPosted: Fri Jul 22, 2022 22:49    Post subject: Reply with quote
The CFE - Common Firmware Environment (bootloader) - boots the firmware image, stores certain hardware parameters, etc. and is basically like the BIOS in a PC. Has nothing to do with the .rc_startup script that DD-WRT saves to nvram.

https://en.wikipedia.org/wiki/Common_Firmware_Environment

https://xinu.cs.mu.edu/index.php/Common_Firmware_Environment

https://www.linux-mips.org/wiki/Common_Firmware_Environment

https://www.spectroom.com/1023391822-common-firmware-environment

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Sponsor
u2n
DD-WRT Novice


Joined: 19 May 2017
Posts: 20
Location: TN<>MI, US

PostPosted: Sat Jul 23, 2022 2:45    Post subject: Reply with quote
ZenInTexas wrote:
dale_gribble39 wrote:
The .rc_startup script is the startup script that is stored in nvram, not the CFE bootloader

I think he intended to have it stored in the CFE. So when an a nvram reset occurs the CFE will populate nvram...

Yes, that's it.

Back when tinkering with this, I noticed that any variables could be initialized in the cfe to any value. Then after flashing the new cfe, whenever a reset occurred, nvram would be initialized as configured (not as original).

Also noticed that one had to be very careful with all modified variables because this is the bootloader -- there's no fallback (except serial recovery).

EDIT
Forget this! Found the old files and made a new CFE, flashed it and observed rc_startup does not retain the assigned value on boot. Then found it made no difference whether the code was even run; router started exhibiting old behavior of self-rebooting triggered by wi-fi connections.

Unwilling to spend any more time with this, I jumped ship to Fresh Tomato, first time ever in well over 10 years w/ dd-wrt on any router model.

Code:
nvram show | wc
size: 34574 bytes (30962 left)

Works great, back to solid usability, and no messing w/ nvram.

_________________
My old self (phonetics-R-fun)


Last edited by u2n on Sat Aug 13, 2022 23:49; edited 1 time in total
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1939

PostPosted: Sat Jul 23, 2022 2:47    Post subject: Reply with quote
Please elaborate on how you inserted that script into the CFE bootloader. Thanks.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
u2n
DD-WRT Novice


Joined: 19 May 2017
Posts: 20
Location: TN<>MI, US

PostPosted: Sat Jul 23, 2022 3:49    Post subject: Reply with quote
dale_gribble39 wrote:
Please elaborate on how you inserted that script into the CFE bootloader. Thanks.

It's all documented in that old thread (linked a few posts back), check it out!

Some of the info came from XV's posts in the ea6900 thread, but everything needed is linked.

In the second of my three-post group (IIRC), there was a spreadsheet comparing line-by-line the initialized nvram variables from the different sources, and what I used.

If you'd like to play, all the files should still be there for download. As I remember, the (tiny) CFE builder program had a workspace where variables and values were pasted (from file), then a button hit to convert to binary. The resulting file was flashed to the bootloader partition (again, IIRC).

In case your household also runs only on linux, do prepare to boot Windows for the CFE Build program. That's the only drawback to the process.

_________________
My old self (phonetics-R-fun)
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1939

PostPosted: Sat Jul 23, 2022 4:10    Post subject: Reply with quote
This is what we're discussing:

u2n wrote:
-snip-
In retrospect, I would initialize in the CFE the rc_startup variable with the key command
Code:
for line in $(nvram show | grep =$ ); do var=${line%*=}; nvram unset $var; done

since the router won't ever run (or even flash) current builds reliably without it.

Nowhere in those posts linked do you insert that script into the bootloader, whatsoever. The script goes into startup or into a usb drive and loads on boot, but nowhere in any of those linked anything does it say where you inserted it into the CFE bootloader. You flashed a modified XWRT-Vortex bootloader to the router, but you never inserted the script into the CFE, and there is no way that you can that I am aware of. So, again, please elaborate on how this is possible. Thanks.

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
u2n
DD-WRT Novice


Joined: 19 May 2017
Posts: 20
Location: TN<>MI, US

PostPosted: Sat Jul 23, 2022 12:00    Post subject: Reply with quote
dale_gribble39 wrote:
I'm sorry, I've downloaded the zip file from the second of three posts (labeled "CFE") linked in your earlier post here, but I still don't understand how to get that code snippet permanently into the router, as you mentioned was possible.


No worries, let's make it easy. For a dry run, open the attached text file (extracted from that zip) and paste the following on its own separate line:
Code:
rc_startup=for line in $(nvram show | grep =$ ); do var=${line%*=}; nvram unset $var; done

Do the other edits mentioned (which are easy, but important), save, done.

Tip: Pick a place in the variable list for insertion of that line that makes sense to you, since it's your own CFE.

Do note that variable defs at the CLI would enclose the string in single quotes, but as seen on the vlan1ports= line, spaces don't break the def so the entire line is taken at boot.

Now to actually build the CFE, simply copy and paste that file's content's into the Builder's window following instructions in that thread.

Flashing it is the scary part, but no reports of problems after these years so...go for it if you like.



cfe_u2n_12-17.txt
 Description:

Download
 Filename:  cfe_u2n_12-17.txt
 Filesize:  3.95 KB
 Downloaded:  32 Time(s)


_________________
My old self (phonetics-R-fun)
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1939

PostPosted: Sat Jul 23, 2022 13:06    Post subject: Reply with quote
Mis-quoting me is a bully move; I never typed those words. I'm fully aware of the process of modifying the CFE in depth. Thanks for the explanation in detail for those following along.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
u2n
DD-WRT Novice


Joined: 19 May 2017
Posts: 20
Location: TN<>MI, US

PostPosted: Sat Jul 23, 2022 18:42    Post subject: Reply with quote
dale_gribble39 wrote:
Mis-quoting me is a bully move; I never typed those words. I'm fully aware of the process of modifying the CFE in depth. Thanks for the explanation in detail for those following along.

No bull or bully moving intended. Perhaps just a suggestion on how further help may be requested, seeing that we're all volunteers here. Courteous inquiry is always more welcome.

So, glad to help, please post your results if you go forward with this -- but maybe in a new thread since we've rather hijacked this one. Smile

_________________
My old self (phonetics-R-fun)
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1939

PostPosted: Sat Jul 23, 2022 19:08    Post subject: Reply with quote
Well, "yutoon", I hate to burst your arrogant bubble, but your tone is all wrong here. It's best we part ways. If only I liked men. Please note the lack of the word, "other" and take that under advisement before proceeding. It's not in your best interest to be any more condescending here. I already knew the answers to my questions. Thanks for understanding.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum