externalsrc.bbclass already provides the means to build from an external source tree, but setting it up requires a bit of manual work. It would make things easier if there was a script that walks you through this. There are two main scenarios we'd want to handle: 1) User already has a source tree which we should build without touching 2) No external source tree already exists, in which case we fetch the source, apply patches to it and manage the result with git, optionally on top of the upstream git history if the source was fetched from a git repo. This is different to the normal situation where we have source in the workdir because after the initial fetch (which is done by the script and not the build system) and we never wipe out changes to the source. (For brand-new components where there isn't already a recipe, this also ties in with bug 6406.)
A new "devtool" utility with a "modify" command was added to master in the following commit (a number of earlier supporting commits are also required): http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=cd5ca4a11daff2089ba3031103b9b9dab5b3c94e Some basic QA tests have been added in meta/lib/oeqa/selftest/devtool.py. Documentation is still pending.
Verified on master: cd po
Verified on master: 8b3d3e7c957ad06c390886487f69aeb8e145da6a