Bug 16109 - do_rootfs step fails with read-only rootfs and systemd-compat-units package
Summary: do_rootfs step fails with read-only rootfs and systemd-compat-units package
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 5.99
Hardware: x86 x86_64
: Medium normal
Target Milestone: 6.0
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-12-19 20:01 UTC by Zach Kozar
Modified: 2026-05-21 15:03 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zach Kozar 2025-12-19 20:01:09 UTC
After upgrading one of my projects from scarthgap to walnascar, I am getting this error when bitbaking my image that uses the read-only-rootfs option:

core-image-vins-1.0-r0 do_rootfs: The following packages could not be configured offline and rootfs is read-only: ['100-systemd-compat-units']


It appears to be caused by this commit: https://github.com/openembedded/openembedded-core/commit/e88f22da19a7f3f9bf23f2a607ffde6b5b1a3265. The post-install script cannot be run because it was changed to run on the target, but this makes the systemd-compat-units recipe incompatible with the read-only rootfs option. I was able to fix this on my build by reverting the change in that commit.
Comment 1 Randy MacLeod 2026-01-08 15:37:42 UTC
Ross to reply. Reverting just leaves the race condition so that's not sufficient.

Next to fix in master and scarthgap, etc.
Comment 2 Ross Burton 2026-01-13 16:42:27 UTC
Reverting that commit will just reintroduce a race condition, so that isn't really a solution because you're swapping a problem for another problem.

Looking at the recipe, none of that logic needs to happen on target. I shall send a patch to rewrite chunks of the recipe.
Comment 3 Ross Burton 2026-01-13 18:48:05 UTC
I have a patch to change how that recipe works, can you test it please?

https://lore.kernel.org/openembedded-core/20260113184632.3953060-1-ross.burton@arm.com/T/#u

Also, are you aware that this package is only needed if you're building images with _both_ systemd and syvinit? That's not the best idea, and I recommend picking one.
Comment 4 Zach Kozar 2026-01-14 21:39:05 UTC
Thanks. I applied your patch and am able to build with both systemd-compat-units and read-only-rootfs. 

And no, I did not know that. I am not using sysvinit, and it is not in my distro features. It looks like my BSP is adding sysvinit into systemd's packageconfig: https://github.com/nxp-imx/meta-imx/blob/walnascar-6.12.34-2.1.0/meta-imx-bsp/recipes-core/systemd/systemd_%25.bbappend. However they are not adding it to the distro features. I added my own systemd bbappend to remove it from the config, and can confirm it no longer pulls in systemd-compat-units. Sorry if this is off topic.
Comment 5 Ross Burton 2026-05-21 15:03:10 UTC
Merged in 4dc01e016210acd15f153b25e609dce5eee9e0bb.