From: Wolfgang Denk Date: Tue, 30 Dec 2008 22:42:36 +0100 Subject: [U-Boot] Copy environment variables to another board In-Reply-To: <495A0CE8.31716.C0772D@g.modugno.elettronika.it> References: <495A0644.29557.A6846B@g.modugno.elettronika.it>, <20081230105205.C3F45833DBB7@gemini.denx.de> <495A0CE8.31716.C0772D@g.modugno.elettronika.it> Message-ID: <20081230214236.73FE0833DBB7@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear "Giuseppe Modugno", In message <495A0CE8.31716.C0772D@g.modugno.elettronika.it> you wrote: > > > then > > you can just read the sector(s) containing the environment from their > > corresponding /dev/mtd* devices in Linux and copy it to the other > > system. > > So you're proposing to use Linux to copy U-Boot environment. But on a > new board (picked from the shelf) I don't have Linux and I should set > some U-Boot variables to run it. It is difficult to make recommendations when you're providing inconsistent input. In your previous message you wrote: >> I have a board running U-Boot/Linux. U-Boot program, two U-Boot >> environments, Linux kernel and root filesystem for Linux are stored >> in a NOR Flash. Now you claim "I don't have Linux". Can you please decide whether or not you have Linux running on that board? > Another possibility is to printenv on the source board, copy the text > result from the terminal into a text file, append "setenv " at the > top of each lines, substitute = character with space, insert the > quotes where needed and paste the result in the terminal of the > destination board. You could (and probaly should) put the constant part of your definitions into the default environment, and use a script image for the rest. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de egrep patterns are full regular expressions; it uses a fast determi- nistic algorithm that sometimes needs exponential space. - unix manuals