Modifying uEnv.txt at build time

Hi,

I am trying to modify uEnv.txt during build time for our custom carrier board.
The Aim is to : change the dtb filename to boot primarily and adding distroboot cmd in boot argument
to enable default usb booting.

I have tested both by manually editing the uEnv.txt but now we want to integrate this in the build process. I am not sure which bb file I should modify by a custom bbappend .

Also can we achieve the following :

  1. We have two dtb files dtb-1 and dtb-2 .
  2. The uboot will try to look for dtb-1 and if it fails to find it then it will try to find dtb-2.
  3. Then uboots loads the dtb and continues the boot process.

Hi @xdaco

Could you provide the version of the software of your module?

Thanks and best regards,
Jaski

Dear @xdaco .

Greetings and Thank you for contacting the Toradex Community!

We currently extract the uEnv.txt from the u-Boot Binary:http://git.toradex.com/cgit/meta-toradex-bsp-common.git/tree/recipes-bsp/u-boot/u-boot-toradex-env.inc?h=rocko

When you need to append the custoim config, it would be better to fork u-boot and modify the environment:
http://git.toradex.com/cgit/u-boot-toradex.git/log/?h=2016.11-toradex.
Alternatively, you could also add a u-boot-toradex_%.bbappend to the yocto layer. Then you would need to add FILESEXTRAPATHS_prepend := “${THISDIR}/${PN}:” and put the uEnv.txt into the directory u-boot-toradex. After that, you do do the following to bbappend file as well:

do_install_append() {
  cp ${S}/uEnv.txt ${D}/boot/uEnv.txt
}

As for the second part, its possible to perform using something like the following:

load mmc 0:1 ${fdt_addr_r} dtb-1 || load mmc 0:1 ${fdt_addr_r} dtb-2

I hope this answer helps.

Thank you and best regards,
Janani.

We are using bsp version 2.8b

@saijanani.tx

Thanks a lot . I think it is easy to add the modified uEnv.txt in our custom yocto layer.

Dear @xdaco ,

Thank you for your feedback and reach us at the community if you have more questions!

Best Regards,
Janani