Skip to contentSkip to conversation

Updating u-boot environment

U-Boot-Users Muhammad Yahya 2 participants 6 messages Jan 25, 2005 – Jan 26, 2005

lore
Share & tools
lore
#0 lore raw

I need to write a program or shell script that can update u-boot environment (e.g. MAC address).
Any pointers in how this may be done ?

Thanks!

#1 lore raw
Quoted 1 line · In message <[email protected]> you wrote:

I need to write a program or shell script that can update u-boot

environment (e.g. MAC address).

Quoted 1 line

Any pointers in how this may be done ?

A program or shell script in U-Boot? No program needed, as the "setenv" command is a builtin. Youc an put calls to the "setenv" or "askenv" in a text file (= shell script), use the mkimage tool (-T script) to make script image from it,. load it and run it using the "autoscr" command.

Under Linux, you can use the fw_setenv tool provided in tools/env/

Note that ithe MAC address is normally write protected, i. e. it cannot be changed once set. This is *intentional*.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Send lawyers, guns and money..."  - Lyrics from a Warren Zevon song
#2 lore raw
Quoted 19 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:

I need to write a program or shell script that can update u-boot

environment (e.g. MAC address).

Quoted 3 lines

Any pointers in how this may be done ?

A program or shell script in U-Boot? No program needed, as the "setenv" command is a builtin. Youc an put calls to the "setenv" or "askenv" in a text file (= shell script), use the mkimage tool (-T script) to make script image from it,. load it and run it using the "autoscr" command.

Quoted 11 lines

Under Linux, you can use the fw_setenv tool provided in tools/env/

Note that ithe MAC address is normally write protected, i. e. it cannot be changed once set. This is *intentional*.

Best regards,

Wolfgang Denk

Thank you for your response. I need to provide an interface to the folks at our manufacturing facility so that they can enter the MAC address for the MPC embedded controller and I can write it to the u-boot enviroment. Is is possible to write a "script" that can take user input and then write the MAC address ? I cannot seem to find a u-boot command that can take input from the user.

Thanks!
Muhammad

#3 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

Thank you for your response. I need to provide an interface to the folks at our manufacturing facility so that they can enter the MAC address for the MPC embedded controller and I can write it to the u-boot

U-Boot has such an interface builtin. It is the "setenv" command. It is trivial to write script (for example using "expect") to automate such command sequences.

And I already mentioned several other potential solutions for such a task.

Quoted 3 lines

enviroment. Is is possible to write a "script" that can take user input and then write the MAC address ? I cannot seem to find a u-boot command that can take input from the user.

Quoted 2 lines · Did you read my previous message? I

"setenv" command is a builtin. Youc an put calls to the "setenv" or "askenv" in a text file (= shell script), use the mkimage tool (-T

Did you look up what the "setenv" and "askenv" are doing? Especially "askenv"??

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"An open mind has but one disadvantage: it collects dirt."
                                                    - a saying at RPI
#4 lore raw
Quoted 28 lines · Wolfgang Denk
Quoted 5 lines · In message <[email protected]> you wrote:

Thank you for your response. I need to provide an interface to the folks at our manufacturing facility so that they can enter the MAC address for the MPC embedded controller and I can write it to the u-boot

U-Boot has such an interface builtin. It is the "setenv" command. It is trivial to write script (for example using "expect") to automate such command sequences.

And I already mentioned several other potential solutions for such a task.

Quoted 5 lines

enviroment. Is is possible to write a "script" that can take user input and then write the MAC address ? I cannot seem to find a u-boot command that can take input from the user.

Did you read my previous message? I wrote:

Quoted 8 lines
Quoted 4 lines

"setenv" command is a builtin. Youc an put calls to the "setenv" or "askenv" in a text file (= shell script), use the mkimage tool (-T

Did you look up what the "setenv" and "askenv" are doing? Especially "askenv"??

Unfrotunately, I cannot find askenv in the u-boot version I am using; that is why I was asking if there is analternative to get input from user.

Quoted 7 lines

Best regards,

Wolfgang Denk

#5 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

Unfrotunately, I cannot find askenv in the u-boot version I am using; that is why I was asking if there is analternative to get input from user.

Add it to your board config file, recompile, and install the new image. What exactly is the problem?

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
An optimist believes we live in the best world possible; a  pessimist
fears this is true.