Overview
devtool
is a helper program for adding and modifying recipes in yocto. It is available as part of the yocto build environment either through setting up a full yocto build environment, see Setup and Building or through the Extensible SDK.
Invoking devtool
creates a workspace layer inside the build
directory to store new recipes and modifications to existing ones. The workspace also includes the sources for all recipes touched by devtool
, so that they can easily be modified and persist through cleaning actions such as bitbake -c cleanall
. When using a Extensible SDK the workspace is directly created within it.
Furthermore, devtool
allows for easy creation of patches, at least when used with sources from a git
repository.
Commands
devtool add
You can add your own sources and automatically create recipes as given in Add an Application.
$ devtool add <recipe> <srctree>
devtool modify
Use the devtool modify
command to begin modifying the source of an existing recipe. The devtool modify command extracts the source for a recipe, sets it up as a Git repository if the source had not already been fetched from Git, checks out a branch for development, and applies any patches from the recipe as commits on top. The repository can now be modified in /build/workspace/sources
. Use the command and supply a name of a recipe you want to adapt:
$ devtool modify <recipe>
devtool reset
Use the devtool reset
command to remove a recipe and its configuration (e.g. the corresponding .bbappend file) from the workspace layer. From now on the image is build with the default repository linked in the recipe. Specify the recipe you want to reset:
$ devtool reset <recipe>
devtool menuconfig
Use the devtool menuconfig
command to change the kernel configuration.
$ devtool menuconfig <kernel-recipe>
devtool finish
Allow to complete the development done through devtool by updating layer(s) with the work done. Pushes any committed changes to the specified recipe to the specified layer and removes it from your workspace.
$ devtool finish <recipe> <layer/path>
devtool build-image
Use the devtool build-image
command to build an image, extending it to include packages from recipes in the workspace. When you use the command, you must supply the name of the image:
$ devtool build-image <image>
The output tells in which directory the new image was created.
devtool build
If the change affects only one or a few recipes, you can build this recipes individually with:
$ devtool build <recipe>
$ # for example:
$ devtool build ethercattest
devtool deploy-target
The recipe changes described above can be deployed directly to the target machine using the following command:
$ devtool deploy-target <recipe> <target>
$ # for example:
$ devtool deploy-target ethercattest root@146.136.37.133
Use Cases
- Modify the device tree of the kernel and put the changes into its own layer
# build image for beaglebone blue
# alter device in build/workspace/sources/linux-stable-rcn-ee/arch/arm/boot/dts
# commit changes
$ bitbake-layers create-layer ../meta-bsc-os
$ bitbake-layers add-layer ../meta-bsc-os
$ devtool finish -f linux-stable-rcn-ee ../meta-bsc-os/
This creates layer with suitable recipe and adds the new layer to the local bblayers.conf file.
- Repository of used library has new commit. How can you force yocto to fetch the new commit and rebuild the image? Simply, change the source reference in the recipe, e.g.
#SRCREV = "master"
SRCREV = "bcaf4bfb775b207d5e1e7b8340235050832345f4"