"Mounted root does not match boot loader environment" error with overlayroot setup

When using the overlayroot package on Debian to mount a rw overlay on top of a ro rootfs, the rootfs update module fails with the following error:

"Mounted root does not match boot loader environment ($1)!"

See this line: mender/support/modules/rootfs-image at 9fc5b2fec4b525ee045cc93c0a030d94aa308394 · mendersoftware/mender · GitHub

Is this a bug? Does mender actually care about how the root is mounted after handing it over to the kernel / initramfs?

Can this check be disabled? Or can it be changed to instead check that the passive partition is not mounted?

Thanks!

Another option to check wether the active partition is the correct one could be to check what was passed to kernel via /proc/cmdline. Something like:

ROOT_DEVICE=$(findfs $(grep -o '\(^\| \)root=[^ ]*' /proc/cmdline | cut -d= -f2-))

Put up a PR for the /proc/cmdline approach:

I assume the delta update module would need a similar fix?

Hi @adbjo,

Thanks so much for the detailed analysis and follow up contribution. I’ve answered there, as I think the code is the main relevant thing here and we should focus on that.

Concerning the delta update module, I think a similar patch might be useful, but can’t judge this right now. Deltas being a Pro+ feature, I would encourage to file this through support@mender.io to get started, I’ll keep an eye open for it there and eventually poke the relevant folks then.

Greetz,
Josef