Skip to main content
A read-only root filesystem prevents modifications to the root filesystem at runtime. This helps protect system files against unintended or unauthorized changes and improves the security of the system. By default Qualcomm Linux root filesystem is read-write. It supports configuring the root filesystem as read-only by using the Yocto Project read-only-rootfs image feature.

Enable the read-only root filesystem

To enable a read-only root filesystem, add read-only-rootfs to IMAGE_FEATURES in the image recipe. In meta-qcom-distro/recipes-products/images/qcom-minimal-image.bb, do the following changes:
The read-only-rootfs image feature configures the generated root filesystem to be mounted as read-only at runtime.
[!NOTE] Packages included in an image with read-only-rootfs must complete the required configuration during image creation. Packages that require delayed post-installation operations which modify the root filesystem at runtime can cause the image build to fail.

Build the image

Set up the Qualcomm Linux build environment for the required target. For instructions to set up the build environment, see the Qualcomm Linux Build Guide. Build the required image. For example:
The generated image contains the root filesystem configured for read-only operation.

Verify the read-only root filesystem

After flashing and booting the image on the target, connect to the device. Run the following command to check the mount options of the root filesystem: