Hello @vix,
I think it’s interesting to split the issue in two:
- one is the development environment you’re going to use while you have to create and debug your custom device tree
- the other is the project structure that you’re going to use to keep all the needed pieces in place for repeatable builds in the future
I consider the advice at create a custom device tree file to be closely related to the development environment. The first thing you’ll do to start your custom device tree is copy an existing device tree and set up the kernel build environment to build it. This way you can start experimenting with changes quickly and iterate fast, also making use of find_in_devicetree
.
However, if you wanted to keep the files as they are for your project, you would have to create a branch of the current Toradex kernel branch. To keep this branch, you’ll have to mirror our kernel repository within your infrastructure, which you’ll have to keep updated.
If you keep your custom device tree in another directory within your project, it will be clear that this file is necessary for a successful build. It will not be “lost” within the kernel repository.
Having said that, I would recommend:
- starting with a custom device tree file inside the kernel repository
- once you have something that is worth committing, copy it to your project repository
- from that moment on, I would symlink the file in your project repository back inside the kernel repository, so that you keep your development environment easy to use, and every change you make to the device tree will immediately be visible in your version control system.
If you were using yocto, the device tree could be included with a special recipe for that within your layer. When using Torizon, Torizon Core Builder will build the device tree for you as part of the image generation process.