Hi,
I’m working on a Verdin iMX8MP board from Toradex and trying to build a Yocto image that uses SquashFS as the root filesystem with OverlayFS for writable support** (i.e., a read-only root with a writable overlay layer on top).
Here’s what I’ve done so far:
- I’m using the Toradex BSP based on Yocto and the ‘tdx-reference-multimedia-image’ as my base image.
- In my local.conf, I added
IMAGE_FSTYPES = “squashfs”
IMAGE_INSTALL:append = " squashfs-tools"
DISTRO_FEATURES:append = " overlayfs"
- I inherited overlay support in my image recipe:
inherit overlayfs
OVERLAYFS_WRITABLE_PATHS[root] += “/”
- In my machine configuration (verdin-imx8mp.conf), I added:
OVERLAYFS_MOUNT_POINT[root] = “/”
The image builds successfully as a .tar file for Toradex Easy Installer. I flashed it using the Toradex Easy Installer tool. But when I boot the device, the root filesystem is mounted as ext4, not squashfs. Running mount
or findmnt
shows /
is from /dev/mmcblk2p2 and using ext4.
So I want to know What changes are needed to properly mount the root filesystem as SquashFS with an OverlayFS layer and Is there any extra configuration or init script needed to ensure squashfs gets mounted as root?
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello,
Thank you for your detailed description. You’re on the right track, but there are a few corrections and additional steps needed to ensure your Verdin iMX8MP boots with a SquashFS root, overlaid for write access. Here are the main points to address:
Key Corrections & Recommendations
- Correct IMAGE_FSTYPES setting
You should append squashfs to existing formats (unless you want only squashfs output). To avoid losing compatibility with the Toradex Easy Installer and raw ext4 output, add this to your local.conf
:
IMAGE_FSTYPES_append = " squashfs"
Do not override completely with = "squashfs"
unless you intend to lose other image artifacts.
- Kernel Support
Verify that your kernel builds in SquashFS and OverlayFS support (not as modules):
- U-Boot Boot Arguments
You need to instruct the kernel to use squashfs as the root and specify the correct device and filesystem type (by default it’s set to use ext4).
-
Overlay Partition
OverlayFS requires a writable partition. Usually, /dev/mmcblk0p3
is used for this. Format and mount it for persistent overlay storage. In /etc/fstab
, add:
/dev/mmcblk0p3 /media/data auto defaults,sync,noauto 0 0
This makes /media/data
available for overlays after root is mounted.
-
Systemd Overlay Mount Script
The actual OverlayFS mount needs to happen at boot. You typically create a systemd service to mount the overlay:
- Create directories for
upperdir
and workdir
(e.g., on /media/data
).
- Mount overlay at
/
(root).
- See Toradex SquashFS + OverlayFS blog for a sample systemd service (just adapt directory paths to your scheme).
High-Level Boot Sequence
- Kernel boots with squashfs as root (readonly) from /dev/mmcblk0p2.
- Writable partition (e.g. /dev/mmcblk0p3) is mounted at /media/data.
- OverlayFS is set up via systemd service, combining lower (squashfs root) and upper (writable partition).
Verification
After boot, check:
mount
You should see:
/dev/mmcblk0p2 on / type squashfs (ro,noatime)
/dev/mmcblk0p3 on /media/data type ext4 (rw,relatime,sync)
overlay on / type overlay (rw,relatime,lowerdir=/,upperdir=/media/data/upper,workdir=/media/data/work)
References
Would you like a sample systemd service file for the overlay setup, or more specifics on the U-Boot/script changes?
Best regards,
Toradex AI Assistant.