From: Giuseppe Modugno Date: Mon, 05 Jan 2009 09:33:10 +0100 Subject: [U-Boot] Copy environment variables to another board In-Reply-To: <20081230214236.73FE0833DBB7@gemini.denx.de> References: <495A0644.29557.A6846B@g.modugno.elettronika.it>, <495A0CE8.31716.C0772D@g.modugno.elettronika.it>, <20081230214236.73FE0833DBB7@gemini.denx.de> Message-ID: <4961D3D6.22933.3E9CEE@g.modugno.elettronika.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 30 Dec 2008 at 22:42, Wolfgang Denk wrote: > 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? I'm sorry for the misunderstanding. Linux really runs on my board, but only after I store the kernel and the root filesystem on the Flash memory. And to do these operations, I must have a good U-Boot environment. So I have a source board with a good U-Boot environment and Linux, and a destination board (picked from the shelf) with just U-Boot and its default environment (no Linux runs on it). I can copy the good U-Boot environment from the source board to a file by using Linux, but I can't use Linux on the destination board to store the good environment in the memory. I think the best solution is to use Linux on the source board to copy the good U-Boot environment in a image file. On the destination board, I can download (by tftp) the image and store it on the Flash at the correct address. In this way, I'll use only U-Boot on the destination board to retrieve the good environment. From that, I can install kernel and root filesystem. > > 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. Just now I'm reading about the scripting capabilities of U-Boot. It's interesting. Starting from which U-Boot version they are available? Just another question. I have two redundant U-Boot environments. Should I copy both of them in two different images, or are they the same and I can copy the first into the second? Regards, Giuseppe