# Mender\_boot\_part is not defined

**URL:** <https://hub.mender.io/t/mender-boot-part-is-not-defined/2553>\
**Category:** General Discussions\
**Tags:** yocto\
**Created:** [September 29, 2020, 3:48pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553 "2020-09-29T15:48:32Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [September 29, 2020, 3:48pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/1 "2020-09-29T15:48:33Z")

</div>

Hello,  
I’m using yocto based mender client.  
Recently I have switched from mender v2.2 to mender v2.3 to test delta updates.  
The mender update is failing with following logs

> ```
> update-store [Download_Enter] -> update-after-store [Download_Leave]
> 
> ```
> 
> 2020-09-29 14:26:51 +0000 UTC info: State transition: update-after-store [Download\_Leave] → update-install [ArtifactInstall]  
> 2020-09-29 14:26:51 +0000 UTC info: Enabling partition with new image installed to be a boot candidate: 30  
> 2020-09-29 14:26:51 +0000 UTC info: State transition: update-install [ArtifactInstall] → reboot [ArtifactReboot\_Enter]  
> 2020-09-29 14:26:51 +0000 UTC info: Collected output (stderr) while running script /var/lib/mender/scripts/ArtifactReboot\_Enter\_50  
> Starting nvidia mender enter reboot redundant boot steps  
> Enabling A/B update mode using nv\_update\_engine  
> Nvidia A/B-Redundancy Update tool Version 1.2  
> enabling A/B redundancy  
> A/B Redundancy has been enabled.

## Error: “mender\_boot\_part” not defined

---

<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:** [September 29, 2020, 6:30pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/2 "2020-09-29T18:30:15Z")

</div>

It looks like your ArtifactReboot\_Enter\_50 script is doing something that required a variable called mender\_boot\_part. Hard to say exactly what.  
Drew

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [September 29, 2020, 6:32pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/3 "2020-09-29T18:32:55Z")

</div>

@anishmonachan, which U-Boot version are you using?

You might be hitting this one, [https://tracker.mender.io/browse/MEN-3970](https://tracker.mender.io/browse/MEN-3970)

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [September 30, 2020, 8:52am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/4 "2020-09-30T08:52:30Z")

</div>

How I can check the uboot version?  
I had set a variable `MENDER_BOOT_PART = "${MENDER_STORAGE_DEVICE_BASE}1"` which seems to have no effect.

---

<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:** [September 30, 2020, 4:51pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/5 "2020-09-30T16:51:45Z")

</div>

I think just running “version” at the UBoot prompt. Also, it normally displays the version in the header when it boots.

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [October 1, 2020, 7:58am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/6 "2020-10-01T07:58:06Z")

</div>

Since I’m using jetson tx2, I’m not able to look at the boot info. From the recipe, I can see that I’m using u-boot 2016.07.

To tell about more about my use case, I’m looking to upgrade mender version 2.3 to test delta updates. Everything was working well with version 2.2.0 which I’ve been using before. Do you think the version v2.2.1 supports delta update or if it is a requirement to use v2.3? I’m using the warrior branch

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 1, 2020, 8:26am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/7 "2020-10-01T08:26:47Z")

</div>

> Since I’m using jetson tx2, I’m not able to look at the boot info. From the recipe, I can see that I’m using u-boot 2016.07.

Then this is the problem, [https://tracker.mender.io/browse/MEN-3970](https://tracker.mender.io/browse/MEN-3970)

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 1, 2020, 8:30am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/8 "2020-10-01T08:30:46Z")

</div>

i dont know anything about your board, but can you run fw\_printenv on the board to confirm the variables exist in uboot env?

fw\_printenv | grep mender\_boot\_part

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [October 1, 2020, 8:35am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/9 "2020-10-01T08:35:01Z")

</div>

here is the ouptut

> ```
> bootcmd=run mender_setup; setenv distro_bootpart ${mender_boot_part}; setenv distro_bootpart_hex ${mender_boot_part_hex}; setenv devnum 0; setenv devtype "mmc"; setenv prefix /boot/; sysboot ${devtype} ${devnum}:${distro_bootpart_hex} any ${scriptaddr} ${prefix}extlinux/extlinux.conf; run mender_try_to_recover
> mender_altbootcmd=if test ${mender_boot_part} = 1; then setenv mender_boot_part 30; setenv mender_boot_part_hex 1E; else setenv mender_boot_part 1; setenv mender_boot_part_hex 1; fi; setenv upgrade_available 0; saveenv; run mender_setup
> mender_setup=if test "${mender_saveenv_canary}" != "1"; then setenv mender_saveenv_canary 1; saveenv; fi; if test "${mender_pre_setup_commands}" != ""; then run mender_pre_setup_commands; fi; if test "${mender_systemd_machine_id}" != ""; then setenv bootargs systemd.machine_id=${mender_systemd_machine_id} ${bootargs}; fi; setenv mender_kernel_root /dev/mmcblk0p${mender_boot_part}; if test ${mender_boot_part} = 1; then setenv mender_boot_part_name /dev/mmcblk0p1; else setenv mender_boot_part_name /dev/mmcblk0p30; fi; setenv mender_kernel_root_name ${mender_boot_part_name}; setenv mender_uboot_root mmc 0:${mender_boot_part_hex}; setenv mender_uboot_root_name ${mender_boot_part_name}; setenv expand_bootargs "setenv bootargs \\"${bootargs}\\""; run expand_bootargs; setenv expand_bootargs; if test "${mender_post_setup_commands}" != ""; then run mender_post_setup_commands; fi
> 
> ```

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 1, 2020, 9:58am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/10 "2020-10-01T09:58:57Z")

</div>

Whilst there is code there to set the variables, I’m not seeing any actual defined uboot variables.

for example my output on uboot 2017.03:

```
mender_altbootcmd=if test ${mender_boot_part} = 1; then setenv mender_boot_part 2; setenv mender_boot_part_hex 2; else setenv mender_boot_part 1; setenv mender_boot_part_hex 1; fi; setenv upgrade_available 0; saveenv; run mender_setup
mender_boot_part=2 <<<< here
mender_boot_part_hex=2 <<< and here
mender_setup=if test "${mender_pre_setup_commands}" != ""; then run mender_pre_setup_commands; fi; setenv mender_kernel_root /dev/mmcblk1p${mender_boot_part}; if test ${mender_boot_part} = 1; then setenv mender_boot_part_name /dev/mmcblk1p1; else setenv mender_boot_part_name /dev/mmcblk1p2; fi; setenv mender_kernel_root_name ${mender_boot_part_name}; setenv mender_uboot_root mmc 1:${mender_boot_part_hex}; setenv mender_uboot_root_name ${mender_boot_part_name}; setenv expand_bootargs "setenv bootargs \\"${bootargs}\\""; run expand_bootargs; setenv expand_bootargs; if test "${mender_post_setup_commands}" != ""; then run mender_post_setup_commands; fi

```

So to me, it doesn’t look like the uboot variables are getting defined in yours. Given that you are running and older uboot like myself, I suggest going back and checking that the meta-mender-core uboot patches are getting applied correctly. For example in mine they were not so I had to analysis what the patches were doing one by one and rework the patches in my own yocto layer to work with my uboot.

It look like the defines for my version of meta-mender are in:

> meta-mender-core/recipes-bsp/u-boot/patches/

and the defines in:

> meta-mender-core/recipes-bsp/u-boot/patches/0002-Generic-boot-code-for-Mender.patch

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 1, 2020, 10:53am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/11 "2020-10-01T10:53:41Z")

</div>

The behavour @anishmonachan is seeing is because of [this commit](https://github.com/mendersoftware/mender/commit/9ae8baf75bf3be3a31e5861ae5a60bb821ee475f) which exists in 2.3.0 client.

It turned out that the updated syntax is not backwards compatible (not at least to beginning of time 🙂 ) and I am pretty sure that 2016.07 U-Boot does not support this syntax.

What happens when U-boot does not support that syntax, the variable is cleared instead of set, which is explains why they are missing. We do not yet have a 2.3.x release with a fix, but there will be one I assume as it is being worked on here, [https://tracker.mender.io/browse/MEN-3970](https://tracker.mender.io/browse/MEN-3970)

The options you have are:

- patch Mender client in your environment, and revert the mentioned commit.
- stay on 2.2.x Mender client

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [October 1, 2020, 11:01am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/12 "2020-10-01T11:01:38Z")

</div>

Thanks for your suggestion @mirzak .  
But the question is 2.2.x supports mender delta update or not?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 1, 2020, 11:04am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/13 "2020-10-01T11:04:59Z")

</div>

> [@anishmonachan](#):
>
> But the question is 2.2.x supports mender delta update or not?

Not the version of delta updates that is available in Mender Enterprise, I believe. So I think you are left with one option.

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [October 1, 2020, 11:08am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/14 "2020-10-01T11:08:50Z")

</div>

@dellgreen I went back to the mender tutorial for yocto. I saw that I have to add

> MENDER\_FEATURES\_ENABLE\_append = " mender-uboot"

in local.conf to enable mender uboot. After that I have following output

> bootcmd=run mender\_setup; setenv distro\_bootpart ${mender\_boot\_part}; setenv distro\_bootpart\_hex ${mender\_boot\_part\_hex}; setenv devnum 0; setenv devtype “mmc”; setenv prefix /boot/; sysboot ${devtype} ${devnum}:${distro\_bootpart\_hex} any ${scriptaddr} ${prefix}extlinux/extlinux.conf; run mender\_try\_to\_recover  
> mender\_altbootcmd=if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part 30; setenv mender\_boot\_part\_hex 1E; else setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; fi; setenv upgrade\_available 0; saveenv; run mender\_setup  
> mender\_boot\_part=1  
> mender\_boot\_part\_hex=1  
> mender\_setup=if test “${mender\_saveenv\_canary}” != “1”; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test “${mender\_pre\_setup\_commands}” != “”; then run mender\_pre\_setup\_commands; fi; if test “${mender\_systemd\_machine\_id}” != “”; then setenv bootargs systemd.machine\_id=${mender\_systemd\_machine\_id} ${bootargs}; fi; setenv mender\_kernel\_root /dev/mmcblk0p${mender\_boot\_part}; if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part\_name /dev/mmcblk0p1; else setenv mender\_boot\_part\_name /dev/mmcblk0p30; fi; setenv mender\_kernel\_root\_name ${mender\_boot\_part\_name}; setenv mender\_uboot\_root mmc 0:${mender\_boot\_part\_hex}; setenv mender\_uboot\_root\_name ${mender\_boot\_part\_name}; setenv expand\_bootargs “setenv bootargs \”${bootargs}\“”; run expand\_bootargs; setenv expand\_bootargs; if test “${mender\_post\_setup\_commands}” != “”; then run mender\_post\_setup\_commands; fi

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 1, 2020, 11:46am UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/15 "2020-10-01T11:46:20Z")

</div>

yes that looks better now from the outset, i also have “mender-uboot” set in “MENDER\_FEATURES\_ENABLE\_append”, After all that you also now need to watch out for/fix the subsequent problem that @mirzak has pointed out which looks like they will get erased again when you use the mender-client 2.3.x, 🙂

---

<div class="post-metadata">

**Author:** ![anishmonachan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/anishmonachan/32/802_2.png) [@anishmonachan](https://hub.mender.io/u/anishmonachan)\
**Post date:** [October 1, 2020, 2:55pm UTC](https://hub.mender.io/t/mender-boot-part-is-not-defined/2553/16 "2020-10-01T14:55:33Z")

</div>

@mirzak @dellgreen  
patching and adding variable MENDER\_FEATURES\_ENABLE\_append = " mender-uboot" solved this issue 🙂

Thank you very much 🙂
