From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Fri, 4 Jul 2008 16:51:12 +0200 Subject: [U-Boot-Users] Reading memory into environment variable In-Reply-To: References: <1215165809.22831.1261837119@webmail.messagingengine.com> Message-ID: <20080704145112.GA8227@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >> 1. Read disk file into RAM >> 2. Implement custom "mem2env" command to read memory into environment >> variable, with destination variable as ${bootargs} I've done the same (on u-boot-1.2.0) to read an upgrade script from a network file or usb pen. I called the command "setenvram" (bad choice, Wolfgang would refuse it). I'm sure later I found something similar in mainline, but now I can't find it any more. I may have overlooked another command. Although it's not ready for prime time, I paste it here. If useful I can make a proper patch against current git. /* set environment variable from ram -- ARub */ int do_setenvram(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { unsigned long len, i; char *addr; if (argc != 4) { printf ("Usage:\n%s\n", cmdtp->usage); return 1; } addr = (char *)simple_strtol(argv[2], NULL, 16); len = simple_strtol(argv[3], NULL, 16); if (!addr || !len) { printf ("Usage:\n%s\n", cmdtp->usage); return 1; } addr[len] = '\0'; for (i=0; i