Hi
I can successfully build an deploy a yocto image build on the hardknott code base for my custom board. I've successfully patched the DRAM updates into u-boot-imx and it works well.
One aspect I am struggling with is how to modify the u-boot-initial-env at build time.
I know after writing the wic to emmc, I can interrupt the boot and modify the default u-boot env there
I know I can use the userland (fw_setenv) to modify the env there
I can see after I build u-boot-env files in the deploy folder called u-boot-initial-env* and these contain the initial environment I can see once I boot.
What I cannot figure out is how to patch these at build time. Clearly it's some update to the u-boot bbappend file but it seems that these files are generated during the build and cannot be patched in the source code.
Presumably there's some easy and obvious way (how may times have I said that with yocto!) but I can't figure it out.
Any pointers please?
Thanks for the response. I'll check it out; The reason I posted here is that most changes similar to this, are in the freescale layer. It's not straightforward understanding if the original change is in u-boot or in the board specific code
u-boot-initial-env is from the u-boot default in header file.
You need to do is to patch the u-boot header as modification and create patch's patch for yocto.
you can refer to 2000-u-boot-append-emmc-LF_v5.10.9_1.0.0.patch or 2000-u-boot-append-LF_v5.10.9_1.0.0.patch in swupdate_yocto_patches_08102021.tgz of following link.
SWUpdate OTA i.MX8MM EVK / i.MX8QXP MEK:
SWUpdate OTA i.MX8MM EVK / i.MX8QXP MEK - NXP Community
you can see the "++" is what I called patch's patch for yocto.
+--- u-boot/include/configs/imx8mm_evk.h.orig 2021-06-15 10:37:39.875399335 +0800
++++ u-boot/include/configs/imx8mm_evk.h 2021-06-15 10:46:21.606685474 +0800
+@@ -8,6 +8,7 @@
+
+ #include <linux/sizes.h>
+ #include <asm/arch/imx-regs.h>
++#include <version.h>
+ #include "imx_env.h"
+
+ #define CONFIG_SPL_MAX_SIZE (148 * 1024)
+@@ -133,7 +134,8 @@
+ "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
+ "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
+ "mmcautodetect=yes\0" \
+- "mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}\0 " \
++ "mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot} " \
++ "cur_slot=${bootslot} U-Boot_ver=${u-boot_version}\0"\
+ "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+ "bootscript=echo Running bootscript from mmc ...; " \
+ "source\0" \
+@@ -169,9 +171,32 @@
+ "else " \
+ "echo WARN: Cannot load the DT; " \
+ "fi; " \
+- "fi;\0"
++ "fi;\0" \
++ "bootslot=dualA\0" \
++ "u-boot_version=null\0" \
++ "usb_port=1\0" \
++ "post_opt=saveenv;\0" \
++ "adjustbootsource=if test ${bootslot} = dualA || test ${bootslot} = singlenormal; then run adjustbootsourceA; fi;" \
++ "if test ${bootslot} = dualB; then run adjustbootsourceB; fi\0" \
++ "altbootusb=echo Boot Fail! Get into usb fastboot download.;fastboot usb ${usb_port}\0" \
++ "altbootsingle=if test ${bootslot} = singlerescue; then run altbootusb; fi; if test ${bootslot} = singlenormal; then run swuboot; fi\0" \
++ "adjustbootsourceB=echo RootFs Slot B; setenv mmcpart 3; setenv mmcroot /dev/mmcblk${mmcdev}p4 rootwait rw\0" \
++ "adjustbootsourceA=echo RootFs Slot A; setenv mmcpart 1; setenv mmcroot /dev/mmcblk${mmcdev}p2 rootwait rw\0" \
++ "altbootRollbackB=echo Rolling back to slot dualB;setenv bootslot dualB;run post_opt;run bootcmd\0" \
++ "altbootRollbackA=echo Rolling back to slot dualA;setenv bootslot dualA;run post_opt;run bootcmd\0" \
++ "altbootdual=if test ${bootslot} = dualA ; then run altbootRollbackB; fi; if test ${bootslot} = dualB ; then run altbootRollbackA; fi;\0" \
++ "swuargs=setenv bootargs console=${console},${baudrate} earlycon=${earlycon},${baudrate} " \
++ "cur_slot=${bootslot} U-Boot_ver=${u-boot_version}\0"\
++ "loadswuimage=mmc read ${loadaddr} 0x4000 0xF000\0" \
++ "loadswufdt=mmc read ${fdt_addr} 0x13000 0x200\0" \
++ "loadswuramdisk=mmc read ${initrd_addr} 0x15000 0x15000\0" \
++ "swuboot=echo swuboot ramdisk;run loadswuimage;run loadswufdt;run loadswuramdisk;run swuargs;booti ${loadaddr} ${initrd_addr} ${fdt_addr}\0" \
++ "altbootcmd=if test ${bootslot} = singlerescue || test ${bootslot} = singlenormal; then run altbootsingle; fi;" \
++ "if test ${bootslot} = dualA || test ${bootslot} = dualB; then run altbootdual; fi\0"
+
Technically, here is the community for i.MX Processors. not for Yocto.
Here is the Yocto official site, you should learn from there.
Yocto Project – It's not an embedded Linux distribution – it creates a custom one for you
hope you can get some progress.