Is there a support for OverlayFS?


I’m looking into your work on Overlay with (linux-toradex and your Yocto layers) and I noticed that you are applying the overlay mentioned here.

My question is, is there support for the overlayFS ?

I want to have /sys/kernel/config/device-tree/overlays mounted and with that I want to load dtbo files in runtime which are written using the overlay syntax.

Thanks in advance,

Hi @bhstalel !

Welcome to Toradex Community!

Please, inform the BSP version or TorizonCore version that you are targeting.

Best regards,

I’m not using any TorizonCore, I’m just asking a basic Kernel question about linux-toradex,
I noticed that Toradex uses device tree overlays in uboot stage using command fdt
I’m asking if there is support for overlayfs in userspace just like linux-raspberry ?

Hi @bhstalel , our Linux BSP V5.x supports OVERLAY_FS.

root@verdin-imx8mm-06803943:~# zcat /proc/config.gz |grep OVERLAY_FS. It is built as a kernel module.

Here is an example.

root@verdin-imx8mm-06803943:~# mount -t overlay -o lowerdir=/home/root/src,upperdir=/home/root/upper,workdir=/home/root/work overlay /home/root/test
root@verdin-imx8mm-06803943:~# mount -l |grep overlay
overlay on /home/root/test type overlay (rw,relatime,lowerdir=/home/root/src,upperdir=/home/root/upper,workdir=/home/root/work)

Thanks for the reply,

The commands you provided worked for me.
Can you share an example of how to apply a .dtbo using you method?

Thanks for the support,

Device tree overlay is different from OverlayFS. U-boot reads /boot/overlays.txt to load required dtbo and applies it to device tree. It is explained here.

Thanks for the reply,

I know the U-boot method, but I’m asking about the overlayFS, because the command you provided ‘mount -t overlay’ is related overlayFS, so how to apply dtbo fragment in Linux userspace not in U-boot.


Hi @bhstalel , I got what you mean. You want dynamical loading device tree overlays into the kernel. For that you should enable CONFIG_OF_OVERLAY and CONFIG_CONFIGFS in kernel configuration. However, CONFIG_OF_OVERLAY is not enabled in our default kernel config. You can download and rebuild kernel according to this page.

Thanks for the reply,

One more thing, I know that dtbo can be applied at two different stages:

  • boot time (through u-boot fdt command)
  • run time (using Linux overlayfs)

Is there an example of how to load dtbo at run time?


Here is an example. But our standard BSP doesn’t support this feature officially. You have to reconfigure the kernel before trying.