From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Fri, 04 Jul 2008 16:36:16 +0200 Subject: [U-Boot-Users] Reading memory into environment variable In-Reply-To: <1215165809.22831.1261837119@webmail.messagingengine.com> (mcj's message of "Fri, 04 Jul 2008 11:03:29 +0100") References: <1215165809.22831.1261837119@webmail.messagingengine.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Martin, > I wish to read the kernel command line parameters in from a disk file > located e.g. on a FAT file system. My current idea is to implement it > like this: > > 1. Read disk file into RAM > 2. Implement custom "mem2env" command to read memory into environment > variable, with destination variable as ${bootargs} > > As far as I can see, I am not reinventing any wheels by doing this, but > does anyone know a better way? I've seen the dbox guys doing something similar, although IIRC that solution wasn't quite generic and was hacked into board specific code. Thinking about it some more, if you can use mkimage somewhere in userspace, you could create a script file, load that to ram and execute it. This is very generic and not limited to setting environment variables. Thinking about that some more, maybe we could teach "autoscr" also to run commands from a memory address without it being wrapped with mkimage. This is also very generic but prone to errors... Cheers Detlev -- 0x2B | ~0x2B -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de