问题
I have a question regarding best practices for Yocto Project.
What i want to do is to add sources for a driver from github in kernel and rebuild the whole yocto image, but i am not sure what's the best way of doing that. I am thinking of two options possible here.
Fork the kernel sources into my own repo, then add the driver sources, update the Makefile and Kconfig and provide my own defconfig file. (this definitely works)
The second thing that crosses my mind is to use the initial kernel sources and just create a recipe that fetches the driver code into place (drivers/net/...) and create a patch that adds the driver to the Makefile and Kconfig and replaces the defconfig file and then rebuild. (I am not sure about this, if it is possible to fetch a driver sources into a specific place in the kernel sources)
So my question is if the second way would be possible and it's common to have it this way.
But if i am thinking again maybe that is not possible because i have the recipe for the kernel which fetches the kernel sources then compile them, so i think that it may not be possible to have a kernel recipe that fetches the kernel sources then another recipe that fetches the driver sources, applies the patch and only after this the kernel is compiled. Am i right? or this should be possible somehow?
Thanks.
来源:https://stackoverflow.com/questions/41614079/integrate-out-of-tree-driver-in-kernel-and-rebuild-yocto-project-image