ApolloX TCB project: relocate device-trees and linux folders

I see that for TorizonCore 6 the device tree customization must be done cloning linux-toradex and device-trees-overlays repositories, because torizoncore-builder dt checkout is not available for TorizonCore 6 (and it could be deprecated).
I was able to follow the KB and build my TC6 image with custom device trees, but the repos linux-toradex and device-tree-overlays are cloned as subfolders of TCP project folder
This means that I have to keep a copy of these folders under every TCB project folder, and their size is big.
I tried to move them out of the TCB folder, changing tcbuild.yaml in the following way:

      - linux/include
      - linux/arch/arm64/boot/dts/freescale
    custom: linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-dev.dts
        - ../device-trees/overlays/verdin-imx8mp_hdmi_overlay.dts
        - ../device-trees/overlays/verdin-imx8mp_dsi-to-hdmi_overlay.dts
        - ../device-trees/overlays/verdin-imx8mp_spidev_overlay.dts
        - ../device-trees/overlays/verdin-imx8mp_hmp_overlay.dts

not the ../ prepended to the add: section, but I can’t build TC6 image anymore because of an error cannot find ../device-trees/overlays/verdin-imx8mp_hdmi_overlay.dts and so on.
Is there a way to move the two folders lout of the TCB project folder?

Greetings @vix

Due to the mechanics of TorizonCore Builder it can only see directories and files in the current directory, or in a sub-directory of the current directory. Therefore trying to reference a directory “above” the current directory (i.e. ../) will not work as you see here.

As for your issue I agree having the entire Linux Kernel in each project folder is quite cumbersome. This is something we are trying to improve on. In the time being there is possibly a way to workaround this. In reality you don’t need the entire /linux directory for devices trees and overlays. Really all you need from here is the relevant device tree directory (i.e. linux/arch/arm64/boot/dts/freescale/) and the include directory (i.e linux/include). So you could greatly strip down this repository to the minimum instead of having the entire Linux kernel.

But yes, at the moment there’s not a good way to have these repos live outside of the TCB project folder, otherwise TCB won’t be able to “see” it. Unless there’s a way to have these repos be a shared sub-directory of all your TCB project folders but, I don’t think there’s a clean way to do this.

Best Regards,

1 Like

Thanks a lot @jeremias.tx
I hope that this could be improved in the future.

Glad I could help clarify things!