# Rpi3: cannot switch boot partition based on the mender\_\* u-boot variables

**URL:** https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281
**Category:** General Discussions
**Created:** [November 25, 2019, 9:53am UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281 "2019-11-25T09:53:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dreamtripper](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dreamtripper](https://hub.mender.io/u/dreamtripper)
#### Post date: [November 25, 2019, 9:53am UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/1 "2019-11-25T09:53:30Z")

</div>

I am unable to switch the boot partition using the parameters that are described in the Integration Checklist.

When I set:

**mender\_boot\_part=3**  
**mender\_boot\_part\_hex=3**

I still get booted into partition 2.

Given the same paramters (mender\_boot\_part=3), when I execute the commands contained in boot.scr at the u-boot command prompt manually:

**fdt addr {fdt\_addr} && fdt get value bootargs /chosen bootargs\*\* \*\*run mender\_setup\*\* \*\*mmc dev {mender\_uboot\_dev}**  
**load {mender\_uboot\_root} {kernel\_addr\_r} /boot/uImage**  
**bootm {kernel\_addr\_r} - {fdt\_addr}**

I still get booted into mender\_boot\_part 2 (instead of mender\_boot\_part 3).

I inspected bootargs after mender\_setup:

**bootargs=8250.nr\_uarts=1 bcm2708\_fb.fbwidth=656 bcm2708\_fb.fbheight=416 bcm2708\_fb.fbswap=1 vc\_mem.mem\_base=0x3ec00000 vc\_mem.mem\_size=0x40000000 dwc\_otg.lpm\_enable=0 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait**

and it contains the wrong root (it should have been p3).

Q1: Where does this get set?

I went ahead and modified bootargs so as to point to the desired root partition, and the system hangs at the “Starting kernel …” message from U-Boot. This I understand even less.

Q2: Is there any resource that describes in more detail how the U-Boot integration mechanism works?

Out distribution is based on OpenEmbedded/Yocto thud. We are using a Raspberry Pi 3 B for this test. It includes the meta-mender-raspberrypi layer, as well as meta-mender-demo and meta-mender-core.

Maybe it is worth mentioning that we are using a MACHINE name different than “raspberrypi3”; also we are using a PREEMPT\_RT kernel.

---

<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: [November 25, 2019, 2:03pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/2 "2019-11-25T14:03:47Z")

</div>

What is the content of your `cmdlinet.txt` file on the boot partition?

---

<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: [November 25, 2019, 2:06pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/3 "2019-11-25T14:06:00Z")

</div>

> [@dreamtripper](#):
>
> Maybe it is worth mentioning that we are using a MACHINE name different than “raspberrypi3”

This might a problem unless you inherit the `rpi` override. This one,

> <https://github.com/agherzan/meta-raspberrypi/blob/master/conf/machine/include/rpi-base.inc#L5>

---

<div class="post-metadata">

### Author: ![dreamtripper](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dreamtripper](https://hub.mender.io/u/dreamtripper)
#### Post date: [November 25, 2019, 3:20pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/4 "2019-11-25T15:20:40Z")

</div>

Thanks for pointing this out! I just verified that `SOC_FAMILY="rpi"` since in our `MACHINE` definition we `require conf/machine/include/rpi-base.inc`.

---

<div class="post-metadata">

### Author: ![dreamtripper](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dreamtripper](https://hub.mender.io/u/dreamtripper)
#### Post date: [November 25, 2019, 3:26pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/5 "2019-11-25T15:26:22Z")

</div>

`# cat cmdline.txt dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait`

---

<div class="post-metadata">

### Author: ![dreamtripper](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dreamtripper](https://hub.mender.io/u/dreamtripper)
#### Post date: [November 25, 2019, 4:31pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/6 "2019-11-25T16:31:51Z")

</div>

We found a solution: apparently the linux kernel was not being `bbappended` by meta-mender-raspberrypi. We now `require recipes-kernel/linux/linux-raspberrypi-mender.inc` directly and it works! 🙂

---

<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: [November 25, 2019, 6:53pm UTC](https://hub.mender.io/t/rpi3-cannot-switch-boot-partition-based-on-the-mender-u-boot-variables/1281/7 "2019-11-25T18:53:51Z")

</div>

Thanks for reporting back
