0

I'm using Yocto to build custom image for Raspberry Pi 4b. In generated fitImage there is a section:

bootscr-uEnv.txt {
      description = "U-boot script";
      data = /incbin/("uEnv.txt");
      type = "script";
      arch = "arm";
      compression = "none";
      hash-1 {
           algo = "sha256";
      };
};

When my system is loaded via ethernet, u-boot reads uEnv.txt file from sd card (this file contains ip adddress of server from where fitImage will be downloaded). Then fitImage is downloaded and system boot's up. So my question is: What is the purpose of embedding uEnv.txt in fitImage file? Is this uEnv.txt file included in fit Image is actually read before kernel starts?

Thanks

grandzello
  • 43
  • 4

1 Answers1

0

Once your fitImage has been downloaded, U-Boot has a couple of choices of things to do prior to running the bootcmd (whatever you've specified):

  1. Run a U-Boot script in boot.scr.
  2. Load U-Boot environment variable(s) from uEnv.txt.

If you've configured a boot.scr file via Yocto (which is what it looks like), then you are supplying U-Boot environment info via bootscr-uEnv.txt. If you download a fitImage with a uEnv.txt in it, that is likely to be unpacked, overwrite any existing uEnv.txt, and the environment instantiated prior to running the bootcmd. I'd have to see your Yocto setup and the stuff in the fitImage to comment any further.

You might also want to take a look at uEnv.txt vs boot.scr.

Frank Hoeflich
  • 538
  • 2
  • 9