Welcome! Log In Create A New Profile

Advanced

Restoring Uboot Environment from a Text file

Posted by laprjns 
Restoring Uboot Environment from a Text file
March 23, 2015 06:29PM
Recently updated one of my Dockstars with the latest uBoot (2014.07) and also flash the new uBoot environment image. Now I can't boot into the Jeff's rescue system that is installed in flash. I do have a serial cable so I can connect and talk to it . I am able to use setenv to do a line by line reset of the environment variable, but would prefer to avoid typing and copy and paste errors and just flash the old environment which is backed up in a text file. Is there a way to convert the text file to and image and flash it back to the Dockstar?


Thanks
Re: Restoring Uboot Environment from a Text file
March 23, 2015 06:47PM
laprjns,

There are 2 options. Create a script to use in serial console (non permanent) or create an env image to be flashed to NAND.

However, with the new u-boot 2014.07-tld-2, you have the 3rd option. Instead, you can use the uEnv.txt to load your new envs while in serial console, and then save it. Which version do you have installed?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/23/2015 06:47PM by bodhi.
Re: Restoring Uboot Environment from a Text file
March 25, 2015 06:35PM
Bodhi,
First, thank you for all the work, help and advice that you provide to us in this forum. Can't imagine how time you put into this.

> Which version do you
> have installed?
2014.07-tld-2


> ... create an env
> image to be flashed to NAND.

This is what I want to do. I have a text file of my old environment, have installed uboot-tools on my Salix (Slackware derivative) powered laptop and ready to run mkenvimage on the old environment text file. The only thing I don't know is the size of the environment image needed for the -s argument of mkenvimage. I can't seem to find it anywhere?
Re: Restoring Uboot Environment from a Text file
March 25, 2015 06:54PM
laprjns,

> Bodhi,
> First, thank you for all the work, help and advice
> that you provide to us in this forum. Can't
> imagine how time you put into this.

You're welcome! ...I spend my coffee breaks time posting on this forum :)

> . The only thing I don't know is the
> size of the environment image needed for the
> -s argument of mkenvimage. I can't
> seem to find it anywhere?

It's one block (128K) but it's in decimal:
mkenvimage -s 131072 -o u-boot-env.img u-boot-env.txt

So if you double check , it should come out to 128K:
ls -lh u-boot-env.img

Also, as I mentioned, you could test your envs with uEnv.txt first for correctness, and then create the image.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/25/2015 06:56PM by bodhi.
I am loading uboot from QEMU and i had env.txt and env.bin
How to start uboot with the new environmrnt using QEMU ??
Re: Restoring Uboot Environment from a Text file
June 23, 2017 03:59PM
SURAJ,

> I am loading uboot from QEMU and i had env.txt and
> env.bin
> How to start uboot with the new environmrnt using
> QEMU ??

I've not done this so don't know if it is possible.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: