# Automate addition of FDTOVERLAYS to /boot/extlinux/extlinux.conf

**URL:** <https://community.solid-run.com/t/automate-addition-of-fdtoverlays-to-boot-extlinux-extlinux-conf/1112>\
**Category:** Uncategorized\
**Tags:** yocto\
**Created:** [March 9, 2026, 11:10am UTC](https://community.solid-run.com/t/automate-addition-of-fdtoverlays-to-boot-extlinux-extlinux-conf/1112 "2026-03-09T11:10:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Christophe](https://community.solid-run.com/u/Christophe)\
**Post date:** [March 9, 2026, 11:10am UTC](https://community.solid-run.com/t/automate-addition-of-fdtoverlays-to-boot-extlinux-extlinux-conf/1112/1 "2026-03-09T11:10:10Z")

</div>

Hello,

I’m working on a HummingBoard Pro boad (i.MX8M Plus) with Basel Cameras on the carrier board port.

To declare the necessary DTB, I have to add the following line to `/boot/extlinux/extlinux.conf`:

```auto
   FDTOVERLAYS ../freescale/imx8mp-sr-som-basler.dtbo ../freescale/imx8mp-hummingboard-pulse-basler.dtbo

```

For the moment, the only way I found is to add it manually after the first boot of my image.

Is there a way to automate the addition of this line in the Yocto build process so that the resulting image includes this line by default?

Thanks by advance for your answer!

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [March 11, 2026, 9:15am UTC](https://community.solid-run.com/t/automate-addition-of-fdtoverlays-to-boot-extlinux-extlinux-conf/1112/2 "2026-03-11T09:15:25Z")

</div>

The simplest way to do this, is in your own meta-layer specify a custom extlinux.conf that includes these changes. Let me know if you need specific instructions to do this.

Another option is to just do this all in u-boot.

---

<div class="post-metadata">

**Author:** ![Christophe](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Christophe](https://community.solid-run.com/u/Christophe)\
**Post date:** [March 16, 2026, 9:32am UTC](https://community.solid-run.com/t/automate-addition-of-fdtoverlays-to-boot-extlinux-extlinux-conf/1112/3 "2026-03-16T09:32:10Z")

</div>

Thank you for your answer.

For several reasons, I prefer not to completely override `extlinux.conf`.

After some reflection and digging I ended up with implementing a new wic plugin which inherits `BootimgPartitionPlugin` and append a line passed in parameter to each entry of `extlinux.conf`.

So I consider my problem is solved like this.

Thank you for your help.

Should it be of any help, here is the pluggin’s code (added to my own layer in `scripts/lib/wic/plugins/source/bootimg-partition-with-fdtoverlay.py` :

```python

import logging

import importlib  
mod = importlib.import_module("wic.plugins.source.bootimg-partition")

logger = logging.getLogger('wic')

class BootimgPartitionWithFdtoverlayPlugin(mod.BootimgPartitionPlugin):
    """
    Inherit BootimgPartitionPlugin to
        Create an image of boot partition, copying over files
        listed in IMAGE_BOOT_FILES bitbake variable.
    And add 
        and a line with the content of the `extra_line` variable to each entry
    """

    name = 'bootimg-partition-with-fdtoverlay'

    @classmethod
    def do_configure_partition(cls, part, source_params, cr, cr_workdir,
                             oe_builddir, bootimg_dir, kernel_dir,
                             native_sysroot):
        """
        Add the FDTOVERLAY line to extlinux.conf
        """
        super().do_configure_partition(part, source_params, cr, cr_workdir,
                             oe_builddir, bootimg_dir, kernel_dir,
                             native_sysroot)
        
        extra_line = source_params.get('extra_line')
        if not extra_line:
            return
        
        hdddir = "%s/boot.%d" % (cr_workdir, part.lineno)
        cfg = open("%s/extlinux/extlinux.conf" % hdddir, "r")
        original_conf = cfg.read()
        cfg.close()
        
        new_conf = ""
        for line in original_conf.splitlines():
            new_conf += line + '\n'
            if line.startswith("label "):
                new_conf += " " + extra_line + '\n'

        cfg = open("%s/extlinux/extlinux.conf" % hdddir, "w")
        cfg.write(new_conf)
        cfg.close()

```
