How do I apply device tree overlays when building an image using the volumio-os repo?

I’ve been trying to build an image for the khadas VIM3L platform using the volumio3-os script and the BSP provided for the khadas-platform for a custom 4.9.206 kernel with USB-OTG enabled.
As far as I know, in order to enable USB-OTG two things are needed:

  1. My custom kernel has to be compiled with the appropriate module (the CONFIG_USB_OTG).
  2. The appropriate dtb overlays have to be loaded.

I’ve managed to get point 1), so at the moment I’ve been struggling with getting to load the appropriate overlay.
I’m following the instructions provided in khadas website and have the appropriate overlay already compiled.

What I want to know now is where this overlay file should go in the khadas-platform filesystem and what modifications should I make in the boot script in order to load such overlay.

Hi Gabriel,

I’m no volumio expert… More of a tinkerer :slight_smile:

I’ve been interested in a VIM3L image too, but I didn’t even manage to get the volumio-os building script running for the moment…


I think I managed to load the appropriate overlay successfully and enable the USB-OTG functionality. Besides the options used to compile a kernel with USB-OTG, these are the modifications I made to get it working:

  1. Added the compiled dts (otg-device.dtbo) into the platform-khadas/vims/boot/dtb/overlays/kvim3l/ folder.
  2. Made the following modification in the platform-khadas/vims/boot/boot.ini file:
echo "Trying to load the otg-device dtbo..."
if load mmc 0:1 ${loadaddr} dtb/overlays/kvim3l/otg-device.dtbo; then
  echo "Applying kernel provided DT overlay otg-device.dtbo"
  fdt apply ${loadaddr} || setenv overlay_error "true"