# RootFS switch in cmdline.txt not happening on Pi 4

**URL:** https://hub.mender.io/t/rootfs-switch-in-cmdline-txt-not-happening-on-pi-4/6580
**Category:** General Discussions
**Tags:** yocto, raspberry-pi-4, kirkstone
**Created:** [February 23, 2024, 8:45am UTC](https://hub.mender.io/t/rootfs-switch-in-cmdline-txt-not-happening-on-pi-4/6580 "2024-02-23T08:45:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pyxlwuff](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pyxlwuff](https://hub.mender.io/u/pyxlwuff)
#### Post date: [February 23, 2024, 8:45am UTC](https://hub.mender.io/t/rootfs-switch-in-cmdline-txt-not-happening-on-pi-4/6580/1 "2024-02-23T08:45:21Z")

</div>

I seem to be currently having an issue with Mender on Kirkstone where the RootFS switch after an update doesn’t seem to be happening. Initially I thought this was part of the problem a few others were experiencing with the `kirkstone` branch, but after testing known good versions of meta-mender, this doesn’t seem to be the case and is likely something that I’m doing wrong instead (hence the separate thread). The WebUI also falsely reports the update as being a success too, updating the current software field, despite no switch taking place.

Versions i’ve tested:

- [This PR](https://github.com/mendersoftware/meta-mender/pull/2078)
- Kirkstone (latest branch)
- Kirkstone v2023.12
- Kirkstone v2023.10
- Kirkstone v2023.08

This is what my local.conf looks like which inherits `MENDER_FULL` that uses `uboot_uefi_grub` as the mender\_bootloader\_integration:

```auto
MACHINE = "raspberrypi4"

## MENDER CONFIG
MENDER_ARTIFACT_NAME = "testimageartifact"
INHERIT += "mender-full"
ARTIFACTIMG_FSSTYPE = "ext4"

MENDER_SERVER_URL = "https://hosted-mender-instance"
MENDER_STORAGE_TOTAL_SIZE_MB = "16000"
MENDER_BOOT_PART_SIZE_MB = "500"
MENDER_DATA_PART_SIZE_MB = "2500"

## Raspberry Pi Config

VIDEO_CAMERA = "1"
ENABLE_I2C = "1"
KERNEL_MODULE_AUTOLOAD:rpi += "i2c-dev i2c-bcm2708"
GPU_MEM = "128"

PREFERRED_PROVIDER_virtual/psplash = "plymouth"

```

Output of `grub-mender-grubenv-print` before an attempted rootFS update:

```auto
bootcount=0
mender_boot_part=2
upgrade_available=0

```

After an attempted rootFS update:

```auto
bootcount=0
mender_boot_part=3
upgrade_available=1
mender_uboot_seperator=
mender_boot_part_hex=3

```

My cmdline.txt (stays the same after a rootfs update):  
`dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait loglevel=1`

Any ideas?

---

<div class="post-metadata">

### Author: ![pyxlwuff](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pyxlwuff](https://hub.mender.io/u/pyxlwuff)
#### Post date: [February 23, 2024, 1:25pm UTC](https://hub.mender.io/t/rootfs-switch-in-cmdline-txt-not-happening-on-pi-4/6580/2 "2024-02-23T13:25:50Z")

</div>

Found in `meta-mender-raspberrypi/recipes-bsp/bootfiles/rpi-cmdline-mender.inc` that the CMDLINE is meant to be replaced on image creation from `root=/dev/mmcblk0p2` to `root=${mender_kernel_root}`. Seems that for some reason this change isn’t happening. Manually setting it in my cmdline.txt however causes a `Waiting for root device ${mender_kernel_root}...`. So it seems like something within the bootloader isn’t being set / happening that’s meant to handle the switching

~~Some googling seems to suggest this is u-boot specific though so I’m not sure if it wholly applies to the default uboot grub hybrid that ships by default in `meta-mender`~~ Seems like `${mender_kernel_root}` is also for the uboot-grub hybrid as well, just a bit different. This [README](https://github.com/mendersoftware/grub-mender-grubenv/blob/master/grub.d/README-mender.md) on `grub-mender-env` also suggests there should be two copies of a cfg file but all I’ve been able to find with mine is one in `/boot/EFI/BOOT/grub.cfg`?

---

<div class="post-metadata">

### Author: ![pyxlwuff](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@pyxlwuff](https://hub.mender.io/u/pyxlwuff)
#### Post date: [February 25, 2024, 8:47pm UTC](https://hub.mender.io/t/rootfs-switch-in-cmdline-txt-not-happening-on-pi-4/6580/3 "2024-02-25T20:47:13Z")

</div>

It seems that in a tremendous moment of sheer brainfart over the past few days, I never realised that `meta-mender-raspberrypi` is in fact its _own_ Yocto layer that needs to be imported 🫠 🫠. `${mender_kernel_root}` shows up in cmdline.txt like it should after importing it.
