Using devtool to modify recipes in Yocto

From KoanSoftware Wiki
Revision as of 16:08, 30 November 2020 by Koan (talk | contribs)

Jump to: navigation, search

Creating Using devtool to modify recipes in Yocto

Suppose you have a requirement of customizing an existing sources for a recipe, devtool will be the best option to go, as it will do all the steps required to create a patch, bbappend file etc.

As part of building a recipe, Yocto/OE creates a tmp/work/<architecture>/<recipe>/<version> directory, known as the "work directory". This is where all of the work done to build a recipe takes place. One of the things you'll find in this directory is the source, usually under a subdirectory named <recipename>-<version> or "git" (depending on how the fetched source is provided). The temptation (and what people used to do in the past) is to simply make changes here and then recompile, but there are several reasons why that's not a good idea:

  • It's awkward - you have to use bitbake -c compile -f or bitbake -C compile to force recompilation, since the build system doesn't know that you've made any changes
  • You can easily lose your changes if you're not careful e.g. running bitbake -c clean will wipe the directory out

Luckily there's a much better method using the devtool command: