[U-Boot-Users] Can a standalone app modify an environment variable?

Wolfgang Denk wd at denx.de
Wed Aug 16 21:52:43 CEST 2006


Dear Ed,

in message <GPECLCIGPLHEOMGPMCPAEEIIDOAA.edjubenville at adelphia.net> you wrote:
> Is it possible to modify environment variables from a standalone application
> in u-boot?

Yes, of course. You will have to add the getenv / setenv functions to
the list of exported interfaces.

> I've written a standalone app that reads and prints a 48-bit ethernet MAC
> address from a Dallas/Maxim DS2502-E48 chip on a custom board.  I would like
> the app to directly modify the "ethaddr" environment variable, rather than
> relying on the user to retype the printed MAC address into a setenv command.

Note that this may not be  possible  -  in  most  configurations  the
"ethaddr"  environment  variable  is  read-only,  i.  e. it cannot be
modified or deleted once set.

> that does seem to be applicable.  Are environment variables somehow
> accessible through the "global_data" pointer declared in exports.h?

No.

Best regards,

Wolfgang Denk

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




More information about the U-Boot mailing list