0

To keep all the files organized, I created on the dev machine an "overlay" directory structure that contains the files I want to substitute in the target rootfs. For example:

etc/
    apache2/
        httpd.conf
        conf.d/
            php.conf

My goal is to copy the whole "overlay" tree into the generated rootfs before the image is generated. Is it possible to do in Yocto?

I did some searches but I found a lot of resources that talk about how to overlay a device tree, but it's not what I'm looking for. Perhaps in the Yocto jargon it's called otherwise.

Mark
  • 4,338
  • 7
  • 58
  • 120
  • Have you looked into ROOTFS_POSTPROCESS_COMMAND? – J. In Oct 14 '19 at 01:56
  • Took a look right now. I wonder the differences between `ROOTFS_POSTPROCESS_COMMAND` and using `do_install` like in this question: https://stackoverflow.com/questions/40722637/how-do-i-write-a-yocto-bitbake-recipe-to-copy-a-directory-to-the-targe-root-file/58130782?noredirect=1#comment103085298_58130782 – Mark Oct 14 '19 at 05:42
  • If you modify some recipe file with `do_install_append`, it will override this file for every images you build with your custom layer. If you need to change some files for a specific image, `ROOTFS_POSTPROCESS_COMMAND` will be better suited. – Nayfe Oct 14 '19 at 07:13
  • 1
    There was an attempt to create an overlay rootfs with following class [image_overlay.bbclass](https://patchwork.openembedded.org/patch/138100/). – Nayfe Oct 14 '19 at 07:22
  • Very good starting point! – Mark Oct 14 '19 at 07:27
  • 1
    You can check irc [logs](https://www.yoctoproject.org/irc/%23yocto.2017-09-26.log.html), but Ross solution is probably the best way. Remove files from every recipes you want to override with `do_install_append() { rm ${D} }`, then create a custom-conf.bb that will add your custom configuration. – Nayfe Oct 14 '19 at 07:31
  • I'm reading the logs but I cannot find anyone named "Ross", neither `rm ` mentioned. What are the caveats in just overwrite the files instead of removing them first? – Mark Oct 14 '19 at 09:08
  • [rburton](https://www.yoctoproject.org/irc/%23yocto.2017-09-26.log.html#t2017-09-26T13:12:43) is [Ross Burton](https://wiki.yoctoproject.org/wiki/Technical_Contributors) – Nayfe Oct 14 '19 at 12:17

0 Answers0