How can I change (or remove) ethaddr from u boot?

Hi,

I have a linux based system where I incorrectly assigned the MAC address within U Boot.
Unfortunately "setenv ethaddr" is disabled in this version (Can't overwrite "ethaddr")

Is there an alternative way to remove this environment variable without using the standard command?

Any ideas would be appreciated.

Many thanks,

James
LVL 4
James AtkinSenior Principle Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dr. KlahnPrincipal Software EngineerCommented:
If you can boot to linux, you can modify the flash memory environment variables with the firmware tools package programs fw_printenv and fw_setenv.  Under Debian, these are part of the u-boot-tools package.

https://developer.ridgerun.com/wiki/index.php/Setting_up_fw_printenv_to_modify_u-boot_environment_variables
0
James AtkinSenior Principle Software EngineerAuthor Commented:
Thanks for the suggestion.
Unfortunately has the core U Boot 'setenv' function blocks changes to the ethaddr parameter, the linux fw_setenv command also fails in the same way.

I am hoping that it can be done at an even lower level using flash write/erase and memory commands but I'm open to ideas...
0
Dr. KlahnPrincipal Software EngineerCommented:
You'll need to locate the protection bits and change that section.  See the discussion at the link below:

https://lists.denx.de/pipermail/u-boot/2007-July/023386.html

Note that some systems locate the MAC address in the online controller chip during boot and use that instead, which overrides the setting of ethaddr.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

James AtkinSenior Principle Software EngineerAuthor Commented:
That is what I suspected.

I believe the correct addresses for my device would be:

protect off 0x10020000 0x1003FFFF
erase 0x10020000 0x1003FFFF
setenv ethaddr 00:11:22:33:44:55

however I still get the same error.

Does it carry out the check for the existing setting from RAM instead?

I'm sure the parameter is not read from the device as the address it is showing is the one i initially set.
0
Dr. KlahnPrincipal Software EngineerCommented:
In that situation I'd get a new flash image for the system and reflash the whole thing.  You now have a system where a block has been erased and the contents of it are unknown.  From here it is far too easy to blow out the firmware completely and end up with a brick.
0
James AtkinSenior Principle Software EngineerAuthor Commented:
Thanks for all the help :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.