public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] How can I save U-Boot env vars to HUSH shell vars.
@ 2014-04-09 21:09 James Chargin
  2014-04-09 21:50 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: James Chargin @ 2014-04-09 21:09 UTC (permalink / raw)
  To: u-boot

I'd like to store the values of environment variables in HUSH shell 
variables and then restore them later. My ultimate goal is to preserve a 
few environment variables through a "env default -f".

I'm working with U-Boot 2010.12. Changing to a newer version is not 
possible at this time.

I realize this is a very old U-Boot. I'm hoping that the relevant parts 
of U-Boot have not changed between that old version and versions you 
might provide help for.

I tried a few things and haven't found the right combination. I think 
the following commands demonstrate my problem.

Given the U-Boot commands

=> setenv e "e ethaddr ipaddr rootpath"
=>
=> printenv e ethaddr ipaddr rootpath
e=e ethaddr ipaddr rootpath
ethaddr=00:00:17:88:09:36
ipaddr=10.3.134.80
rootpath=/home/anyuser/a/device/tr/rootfs
=>
=> for i in $e; do v_$i=$i; done
=>

What I get:

=> showvar
HUSH_VERSION=0.01
v_e=e
v_ethaddr=ethaddr
v_ipaddr=ipaddr
v_rootpath=rootpath
=>

What I want:

=> showvar
HUSH_VERSION=0.01
v_e=e ethaddr ipaddr rootpath
v_ethaddr=00:00:17:88:09:36
v_ipaddr=10.3.134.80
v_rootpath=/home/anyuser/a/device/tr/rootfs
=>

So, how do I re-write the for loop to get the desired results

Thanks for any help,
Jim

-- 
Jim Chargin
AJA Video Systems                       jimc at aja.com
(530) 271-3334                          http://www.aja.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-10 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 21:09 [U-Boot] How can I save U-Boot env vars to HUSH shell vars James Chargin
2014-04-09 21:50 ` Wolfgang Denk
2014-04-09 23:15   ` James Chargin
2014-04-10  6:52     ` Wolfgang Denk
2014-04-10 16:58       ` James Chargin
2014-04-10 18:46         ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox