# Mender u-boot env vars missing from manual patch?

**URL:** https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209
**Category:** General Discussions
**Created:** [February 11, 2021, 3:03pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209 "2021-02-11T15:03:01Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [February 11, 2021, 3:03pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/1 "2021-02-11T15:03:01Z")

</div>

Hi, I’m attempting to integrate Mender client into our Yocto Zeus build for a custom iMX6ULL board. Our source for u-boot is set up for EXTERNAL\_SRC, so I have to do the manual patching via

```auto

```

The resulting patchfile (pasted below) seems to be missing the Mender env variables (`mender_setup`, `mender_saveenv_canary`, etc.) that are mentioned in this post:  
[https://hub.mender.io/t/beaglebone-missing-default-u-boot-environment-in-mmc/1505/6](https://hub.mender.io/t/beaglebone-missing-default-u-boot-environment-in-mmc/1505/6)

Should these variables still be added to u-boot env?

Thanks,  
Stu

```auto
diff -r -u /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/old-src/configs/hermes_uboot_emmc_defconfig /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/git/configs/hermes_uboot_emmc_defconfig
--- a/configs/hermes_uboot_emmc_defconfig	2021-02-08 22:20:09.582784106 +0000
+++ b/configs/hermes_uboot_emmc_defconfig	2021-02-08 22:20:54.975950846 +0000
@@ -1,8 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_TARGET_HERMES=y
-CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0xE0000
 CONFIG_DM_GPIO=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/orro/hermes/imximage.cfg"
@@ -33,7 +31,6 @@
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="hermes"
-CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM_74X164=y
@@ -84,3 +81,32 @@
 CONFIG_FASTBOOT_BUF_SIZE=0x40000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_EFI_PARTITION=y
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x100000
+CONFIG_ENV_OFFSET_REDUND=0x200000
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
+# CONFIG_ENV_IS_NOWHERE is not set
+# CONFIG_ENV_IS_IN_EEPROM is not set
+# CONFIG_ENV_IS_IN_FAT is not set
+# CONFIG_ENV_IS_IN_EXT4 is not set
+# CONFIG_ENV_IS_IN_FLASH is not set
+# CONFIG_ENV_IS_IN_NAND is not set
+# CONFIG_ENV_IS_IN_NVRAM is not set
+# CONFIG_ENV_IS_IN_ONENAND is not set
+# CONFIG_ENV_IS_IN_REMOTE is not set
+# CONFIG_ENV_IS_IN_SATA is not set
+# CONFIG_ENV_IS_IN_SPI_FLASH is not set
+# CONFIG_ENV_IS_IN_UBI is not set
+CONFIG_MMC=y
+CONFIG_ENV_IS_IN_MMC=y
+# CONFIG_BOOTCOUNT_BOOTLIMIT is not set
+# CONFIG_BOOTCOUNT_GENERIC is not set
+# CONFIG_BOOTCOUNT_EXT is not set
+# CONFIG_BOOTCOUNT_AM33XX is not set
+# CONFIG_BOOTCOUNT_RAM is not set
+# CONFIG_BOOTCOUNT_I2C is not set
+# CONFIG_BOOTCOUNT_AT91 is not set
+# CONFIG_BOOTCOUNT_ALEN is not set
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
+# CONFIG_BOOTCOMMAND is not set
Binary files /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/old-src/.git/index and /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/git/.git/index differ
diff -r -u /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/old-src/include/config_defaults.h /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/git/include/config_defaults.h
--- a/include/config_defaults.h	2021-02-08 22:20:09.866791406 +0000
+++ b/include/config_defaults.h	2021-02-08 22:20:54.631942004 +0000
@@ -10,3 +10,5 @@
 #define _CONFIG_DEFAULTS_H_
 
 #endif
+#define CONFIG_SYS_MMC_ENV_DEV 1
+#define CONFIG_SYS_MMC_ENV_PART 0
diff -r -u /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/old-src/include/configs/hermes.h /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r2/git/include/configs/hermes.h
--- a/include/configs/hermes.h	2021-02-08 22:20:09.882791817 +0000
+++ b/include/configs/hermes.h	2021-02-08 22:20:54.635942107 +0000
@@ -80,23 +80,16 @@
 	CONFIG_MFG_ENV_SETTINGS \
 	TEE_ENV \
 	"splashimage=0x8c000000\0" \
-	"fdt_addr=0x83000000\0" \
+	"fdt_addr_r=0x83000000\0" \
 	"fdt_high=0xffffffff\0" \
 	"tee_addr=0x84000000\0" \
 	"console=ttymxc0\0" \
 	"bootargs=console=ttymxc0,115200 ubi.mtd=nandrootfs " \
- "root=ubi0:rootfs rootfstype=ubifs " \
+ "rootfstype=ubifs " \
 		BOOTARGS_CMA_SIZE \
 		MFG_NAND_PARTITION \
 		"\0" \
-	"bootcmd=nand read ${loadaddr} 0x4000000 0xc00000;"\
- "nand read ${fdt_addr} 0x5000000 0x100000;"\
- "if test ${tee} = yes; then " \
- "nand read ${tee_addr} 0x6000000 0x400000;"\
- "bootm ${tee_addr} - ${fdt_addr};" \
- "else " \
- "bootz ${loadaddr} - ${fdt_addr};" \
- "fi\0"
+
 
 #else
 #define CONFIG_EXTRA_ENV_SETTINGS \
@@ -108,7 +101,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdt_file=undefined\0" \
-	"fdt_addr=0x83000000\0" \
+	"fdt_addr_r=0x83000000\0" \
 	"tee_addr=0x84000000\0" \
 	"tee_file=undefined\0" \
 	"boot_fdt=try\0" \
@@ -120,7 +113,7 @@
 	"mmcautodetect=yes\0" \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
 		BOOTARGS_CMA_SIZE \
- "root=${mmcroot}\0" \
+ "\0" \
 	"loadbootscript=" \
 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
@@ -149,7 +142,7 @@
 		"fi;\0" \
 	"netargs=setenv bootargs console=${console},${baudrate} " \
 		BOOTARGS_CMA_SIZE \
- "root=/dev/nfs " \
+ "" \
 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
 		"netboot=echo Booting from net ...; " \
 		"${usb_net_cmd}; " \
@@ -204,20 +197,6 @@
 				"fi; " \
 			"fi;\0" \
 
-#define CONFIG_BOOTCOMMAND \
- "run findfdt;" \
- "run findtee;" \
- "mmc dev ${mmcdev};" \
- "mmc dev ${mmcdev}; if mmc rescan; then " \
- "if run loadbootscript; then " \
- "run bootscript; " \
- "else " \
- "if run loadimage; then " \
- "run mmcboot; " \
- "else run netboot; " \
- "fi; " \
- "fi; " \
- "else run netboot; fi"
 #endif
 
 /* Miscellaneous configurable options */
@@ -240,8 +219,6 @@
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* environment organization */
-#define CONFIG_SYS_MMC_ENV_DEV 1	/* USDHC2 */
-#define CONFIG_SYS_MMC_ENV_PART 0	/* user area */
 #define CONFIG_MMCROOT "/dev/mmcblk1p2" /* USDHC2 */
 
 #define CONFIG_IOMUX_LPSR

```

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [February 11, 2021, 3:55pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/2 "2021-02-11T15:55:34Z")

</div>

Hi @sjuengst,

You seem to be missing [this patch](https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-core/recipes-bsp/u-boot/patches/0002-Generic-boot-code-for-Mender.patch). If our docs are missing a step please let me know.

Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [February 11, 2021, 4:52pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/3 "2021-02-11T16:52:03Z")

</div>

I see 4 Mender-provided patches in `build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r4`

```auto
sjuengst@ernie:~/hermes-mender/yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r4$ ls
0001-Add-missing-header-which-fails-on-recent-GCC.patch deploy-u-boot-imx	pkgdata sysroot-destdir
0002-Generic-boot-code-for-Mender.patch fw_env.config.default	pkgdata-pdata-input temp
0003-Integration-of-Mender-boot-code-into-U-Boot.patch hermes pkgdata-sysroot uboot_auto_configure.sh
0004-Disable-CONFIG_BOOTCOMMAND-and-enable-CONFIG_MENDER_.patch image pseudo uboot_auto_patch.sh
add_kconfig_option_with_depends.py license-destdir	recipe-sysroot uboot.env
boolean.py package recipe-sysroot-native u-boot-imx-2020.04
deploy-rpms packages-split src-tar u-boot-imx.spec

```

I assumed that `bitbake -c save_mender_auto_configured_patch u-boot ` would consolidate them into `mender_auto_configured.patch`. Do I have to apply them manually myself and then do `save_auto_configured_patch`?

Thanks,

Stu

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [February 11, 2021, 5:57pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/4 "2021-02-11T17:57:24Z")

</div>

I had MENDER\_UBOOT\_AUTO\_CONFIGURE set to “0” when I first ran `save_mender_auto_configured_patch`. It occurred to me that maybe it should be ‘1’ for generating the patch and then turned off afterwards (the docs don’t say which setting to use). I tried regenerating the patch with MENDER\_UBOOT\_AUTO\_CONFIGURE = “1” and ran into another problem. It seems that the do\_configure\_append() in my u-boot-imx\_2020.04.bbappend is not being executed when I run `save_mender_auto_configured_patch` (none of my board-specific files, \_defconfig, etc. are being installed) so the build fails.

```auto
ERROR: u-boot-imx-1_2020.04-r6 do_mender_uboot_auto_configure: Execution of '/yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/temp/run.do_mender_uboot_auto_configure.2808' failed with exit code 2:
If at any point you get an unexpanded variable, there is probably an argument
you haven't given.
+ SUB_X=-x
+ set -u
+ rm -rf /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/tmp-src
++ dirname /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/tmp-src
+ mkdir -p /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6
+ cp -r /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/git /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/tmp-src
+ cd /yocto-src/build/tmp/work/hermes-poky-linux-gnueabi/u-boot-imx/1_2020.04-r6/tmp-src
+ make 'HOSTCC=gcc -DMENDER_AUTO_PROBING' 'CC=arm-poky-linux-gnueabi-gcc -DMENDER_AUTO_PROBING' hermes_uboot_emmc_config
  HOSTCC scripts/basic/fixdep
  HOSTCC scripts/kconfig/conf.o
  YACC scripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC scripts/kconfig/zconf.tab.o
  HOSTLD scripts/kconfig/conf
***
*** Can't find default configuration "arch/../configs/hermes_uboot_emmc_defconfig"!
***
scripts/kconfig/Makefile:128: recipe for target 'hermes_uboot_emmc_defconfig' failed
make[1]: *** [hermes_uboot_emmc_defconfig] Error 1
Makefile:539: recipe for target 'hermes_uboot_emmc_config' failed
make: *** [hermes_uboot_emmc_config] Error 2
WARNING: exit code 2 from a shell command.

```

I had worked around this the first time around by changing `MACHINE` to `imx6ull14x14evk` (which doesn’t require a do\_configure\_append), but this was unsatisfactory because the evk and hermes defconfigs are different enough to cause the patch to fail. I had to manually clean it up.

Thanks,  
Stu

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [February 11, 2021, 6:32pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/5 "2021-02-11T18:32:56Z")

</div>

@kacf can you help here?  
Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [February 11, 2021, 11:25pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/6 "2021-02-11T23:25:35Z")

</div>

I fixed the build failure by changing my .bbappend to install my hermes board-specific files in do\_mender\_uboot\_auto\_configure\_prepend() instead of do\_configure\_append(), but I’m still missing the 0001- through 0004- Mender-supplied patches even when MENDER\_UBOOT\_AUTO\_CONFIGURE=“1”. So I’m back to the question of whether I’m supposed to apply them manually myself or should they be included in `mender_auto_configured.patch`?

Thanks,  
Stu

---

<div class="post-metadata">

### Author: ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)
#### Post date: [February 12, 2021, 8:56am UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/7 "2021-02-12T08:56:39Z")

</div>

They should not be included in `mender_auto_configured.patch`. Aren’t they listed in your `SRC_URI`? It can be checked with `bitbake -e u-boot-imx` and then grepping for it.

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [April 1, 2021, 10:53pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/8 "2021-04-01T22:53:28Z")

</div>

Getting back to this after some time away. I’ve added

```auto
SRC_URI += "file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"
SRC_URI += "file://0002-Generic-boot-code-for-Mender.patch"
SRC_URI += "file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

```

to my u-boot-imx\_2020.04.bbappend but I don’t see bitbake running the do\_patch() task for u-boot-imx and the patches are not being applied. What am I missing?

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [April 2, 2021, 1:02pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/9 "2021-04-02T13:02:12Z")

</div>

Hi @sjuengst what file did you add those settings in? Can you share the output from `bitbake -e virtual/bootloader`?

Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [April 2, 2021, 5:03pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/10 "2021-04-02T17:03:19Z")

</div>

I’m adding the patches to the u-boot-imx\_2020.04.bbappend in our board’s new layer. The output of bitbake -e virtual/bootloader is too long to post here. Is there a particular section of interest?

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [April 2, 2021, 5:38pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/11 "2021-04-02T17:38:46Z")

</div>

I’d like to see the details on how SRC\_URI is computed if you can snip that section out.  
Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [April 2, 2021, 6:30pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/12 "2021-04-02T18:30:33Z")

</div>

It actually looks like those patches are included 3 times (and does it matter that there are no newlines between them at the end?).

```auto
# [doc] "The list of source files - local or remote. This variable tells the OpenEmbedded build system what bits to pull in for the build and how to pull them in."

# set /yocto-src/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-common.inc:13

# "git://git.denx.de/u-boot.git"

# set /yocto-src/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-imx_2020.04.bb:20

# "${UBOOT_SRC};branch=${SRCBRANCH} "

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:19

# " file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:20

# " file://0002-Generic-boot-code-for-Mender.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:21

# " file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:27

# "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', '1', ' file://0004-Disable-CONFIG_BOOTCOMMAND-and-enable-CONFIG_MENDER_.patch', '', d)}"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:300

# "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', '1', ' file://uboot_auto_configure.sh file://uboot_auto_patch.sh file://add_kconfig_option_with_depends.py file://boolean.py', '', d)}"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:12

# "file://${MACHINE}/arch.arm.Kconfig"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:13

# "file://${MACHINE}/arch.arm.dts.Makefile"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:14

# "file://${MACHINE}/hermes.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:15

# "file://${MACHINE}/orro/hermes/hermes.c"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:16

# "file://${MACHINE}/orro/hermes/mmc.c"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:17

# "file://${MACHINE}/orro/hermes/imximage.cfg"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:18

# "file://${MACHINE}/orro/hermes/Kconfig"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:19

# "file://${MACHINE}/orro/hermes/Makefile"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:20

# "file://${MACHINE}/orro/hermes/plugin.S"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:21

# "file://${MACHINE}/hermes_uboot_defconfig"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:22

# "file://${MACHINE}/hermes_uboot_emmc_defconfig"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:23

# "file://${MACHINE}/hermes.dts"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:24

# "file://${MACHINE}/config_defaults.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:25

# "file://${MACHINE}/env_default.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:26

# "file://${MACHINE}/Makefile.autoconf"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:27

# "file://${MACHINE}/fw_env.c"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:28

# "file://${MACHINE}/config_mender.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:29

# "file://${MACHINE}/config_mender_defines.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:30

# "file://${MACHINE}/env_mender.h"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:31

# "file://${MACHINE}/mender_auto_configured.patch"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:32

# "file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:33

# "file://0002-Generic-boot-code-for-Mender.patch"

# append /yocto-dev/layers/meta-orro/appends/u-boot-imx/u-boot-imx_2020.04.bbappend:34

# "file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:19

# " file://0001-Add-missing-header-which-fails-on-recent-GCC.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:20

# " file://0002-Generic-boot-code-for-Mender.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:21

# " file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:27

# "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', '1', ' file://0004-Disable-CONFIG_BOOTCOMMAND-and-enable-CONFIG_MENDER_.patch', '', d)}"

# _append[mender-uboot] /yocto-src/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-mender-common.inc:300

# "${@bb.utils.contains('MENDER_UBOOT_AUTO_CONFIGURE', '1', ' file://uboot_auto_configure.sh file://uboot_auto_patch.sh file://add_kconfig_option_with_depends.py file://boolean.py', '', d)}"

# set externalsrc.bbclass:74 [__anon_135__ yocto_src_sources_poky_meta_classes_externalsrc_bbclass]

# "file://hermes/arch.arm.Kconfig file://hermes/arch.arm.dts.Makefile file://hermes/hermes.h file://hermes/orro/hermes/hermes.c file://hermes/orro/hermes/mmc.c file://hermes/orro/hermes/imximage.cfg file://hermes/orro/hermes/Kconfig file://hermes/orro/hermes/Makefile file://hermes/orro/hermes/plugin.S file://hermes/hermes_uboot_defconfig file://hermes/hermes_uboot_emmc_defconfig file://hermes/hermes.dts file://hermes/config_defaults.h file://hermes/env_default.h file://hermes/Makefile.autoconf file://hermes/fw_env.c file://hermes/config_mender.h file://hermes/config_mender_defines.h file://hermes/env_mender.h file://hermes/mender_auto_configured.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

# pre-expansion value:

# "file://hermes/arch.arm.Kconfig file://hermes/arch.arm.dts.Makefile file://hermes/hermes.h file://hermes/orro/hermes/hermes.c file://hermes/orro/hermes/mmc.c file://hermes/orro/hermes/imximage.cfg file://hermes/orro/hermes/Kconfig file://hermes/orro/hermes/Makefile file://hermes/orro/hermes/plugin.S file://hermes/hermes_uboot_defconfig file://hermes/hermes_uboot_emmc_defconfig file://hermes/hermes.dts file://hermes/config_defaults.h file://hermes/env_default.h file://hermes/Makefile.autoconf file://hermes/fw_env.c file://hermes/config_mender.h file://hermes/config_mender_defines.h file://hermes/env_mender.h file://hermes/mender_auto_configured.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

SRC_URI="file://hermes/arch.arm.Kconfig file://hermes/arch.arm.dts.Makefile file://hermes/hermes.h file://hermes/orro/hermes/hermes.c file://hermes/orro/hermes/mmc.c file://hermes/orro/hermes/imximage.cfg file://hermes/orro/hermes/Kconfig file://hermes/orro/hermes/Makefile file://hermes/orro/hermes/plugin.S file://hermes/hermes_uboot_defconfig file://hermes/hermes_uboot_emmc_defconfig file://hermes/hermes.dts file://hermes/config_defaults.h file://hermes/env_default.h file://hermes/Makefile.autoconf file://hermes/fw_env.c file://hermes/config_mender.h file://hermes/config_mender_defines.h file://hermes/env_mender.h file://hermes/mender_auto_configured.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch file://0001-Add-missing-header-which-fails-on-recent-GCC.patch file://0002-Generic-boot-code-for-Mender.patch file://0003-Integration-of-Mender-boot-code-into-U-Boot.patch"

```

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [April 2, 2021, 6:51pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/13 "2021-04-02T18:51:07Z")

</div>

You don’t seem to have a git repo in the SRC\_URI definition. My best guess is you have something that is overwriting SRC\_URI rather than appending to it.

Specifically I’d look at these bits:

```
# set /yocto-src/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-common.inc:13
# "git://git.denx.de/u-boot.git"
# set /yocto-src/sources/meta-imx/meta-bsp/recipes-bsp/u-boot/u-boot-imx_2020.04.bb:20
# "${UBOOT_SRC};branch=${SRCBRANCH} "

```

Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [April 2, 2021, 8:55pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/14 "2021-04-02T20:55:28Z")

</div>

Our u-boot-imx repo is EXTERNALSRC. I wonder if that is causing the denx and NXP additions to SRC\_URI to be removed. Other than that, I can’t find any place where SRC\_URI is set rather than appended.

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [April 2, 2021, 9:16pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/15 "2021-04-02T21:16:01Z")

</div>

Honestly I have never tried EXTERNALSRC and I don’t know if patches will be automatically applied in that case. Can you add them manually to your external source checkout?

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [April 2, 2021, 9:50pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/16 "2021-04-02T21:50:52Z")

</div>

Yes, I had actually done this earlier but then decided it would be better to patch it live. I can revert to a pre-patched repo.

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [April 5, 2021, 10:26pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/17 "2021-04-05T22:26:01Z")

</div>

Please let us know if that works. I’m definitely curious to know if patch files in SRC\_URI work with EXTERNALSRC setups.  
Drew

---

<div class="post-metadata">

### Author: ![sjuengst](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/sjuengst/32/633_2.png) [@sjuengst](https://hub.mender.io/u/sjuengst)
#### Post date: [May 26, 2021, 8:39pm UTC](https://hub.mender.io/t/mender-u-boot-env-vars-missing-from-manual-patch/3209/18 "2021-05-26T20:39:47Z")

</div>

Yes, applying the patches manually to external source successfully worked around the issue. Thanks!
