-1

I want to create writable rootfs using Yocto. I tried with meta-readonly-rootfs-overlay layer and just included it into stm32mp135f yocto build process but seems like it is not making a writable readonly rootfs.

I tried with meta-readonly-rootfs-overlay layer with mickeldore branch and just included it into stm32mp135f yocto build process but seems like it is not making a writable readonly rootfs.

1
  • how can it be writeable and readonly at the same time? Commented Feb 6, 2024 at 19:07

1 Answer 1

0

You need to add an Image Features, the one you are looking for is read-only-rootfs.

A complete guide is in the docs: Creating the Root Filesystem.

You need to set either IMAGE_FEATURES or EXTRA_IMAGE_FEATURES with the added feature.

  • IMAGE_FEATURES if you set it in your image recipe (IMAGE_FEATURES += "read-only-rootfs")
  • EXTRA_IMAGE_FEATURES if you set it in the local.conf (EXTRA_IMAGE_FEATURES += "read-only-rootfs"

I missed a part of the question, on the overlay.

You can use the overlay class provided by Yocto: overlayfs.bbclass. It provides a way to setup an external partition as an overlay, making it writable for your scripts/binaries/configuration. You can also use overlayfs-etc.bbclass if you only want to overlay /etc.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes I tried that and its creating rootfs totally readonly but I need to create a writable rootfs like a overlay filesystem does so that symlinked file/scripts could work.
@stack-shailu I have updated my answer with details on the overlay part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.