petalinux-devtool Examples - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English

Adding a New Recipe to the Workspace Layer

To add a new recipe to the workspace layer, use the petalinux-devtool add command. For $ petalinux-devtool add bbexample https:://github.com/whbruce/bbexample.git This command fetches the source from the specified URL and creates the recipe bbexample in the Devtool Workspace directory.

petalinux-devtool add
$.  petalinux-devtool modify linux-xlnx
[INFO] Sourcing buildtools
[INFO] Sourcing build environment
[INFO] Generating workspace directory
[INFO] devtool modify linux-xlnx 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: <plnx-proj-root>/xilinx-vck190-2021.2/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 34999, PID: 30957
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: <plnx-proj-root>/xilinx-vck190-2021.2/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 44777, PID: 31500
Loading cache: 100% |##########################################################################################################################################| Time: 0:00:01
Loaded 5103 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################################################| Time: 0:00:01
Parsing of 3477 .bb files complete (3468 cached, 9 parsed). 5112 targets, 243 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#####################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 2 Found 0 Missed 2 Current 103 (0% match, 98% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 474 tasks of which 474 didn't need to be rerun and all succeeded.
INFO: Copying kernel config to workspace
INFO: Recipe linux-xlnx now set up to build from <plnx-proj-root>/xilinx-vck190-2021.2/components/yocto/workspace/sources/linux-xlnx

Getting the Status of the Recipes in Your Workspace

Use the petalinux-devtool status command to list the recipes currently in your workspace. Information includes the paths to their respective external source trees.

petalinux-devtool status
$ petalinux-devtool build linux-xlnx
[INFO] Sourcing buildtools
[INFO] Sourcing build environment
[INFO] Generating workspace directory
[INFO] devtool build linux-xlnx 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile <plnx-proj-root>/xilinx-vck190-2021.2/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38785, PID: 19093
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: <plnx-proj-root>/xilinx-vck190-2021.2/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38405, PID: 19133
Loading cache: 100% |##########################################################################################################################################| Time: 0:00:01
Loaded 5103 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################################################| Time: 0:00:40
Parsing of 3477 .bb files complete (3467 cached, 10 parsed). 5112 targets, 243 skipped, 0 masked, 0 errors.
Removing 1 recipes from the versal_generic sysroot: 100% |#####################################################################################################| Time: 0:00:07
NOTE: Started PRServer with DBfile: <plnx-proj-root>/xilinx-vck190-2021.2/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 35773, PID: 24137
Loading cache: 100% |##########################################################################################################################################| Time: 0:00:03
Loaded 5103 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################################################| Time: 0:00:28
Parsing of 3477 .bb files complete (3467 cached, 10 parsed). 5112 targets, 243 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#####################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 6 Found 0 Missed 6 Current 140 (0% match, 95% complete)
NOTE: Executing Tasks
NOTE: linux-xlnx: compiling from external source tree <plnx-proj-root>/xilinx-vck190-2021.2/components/yocto/workspace/sources/linux-xlnx
NOTE: Tasks Summary: Attempted 658 tasks of which 624 didn't need to be rerun and all succeeded.

Modifying an Existing Recipe

Use the petalinux-devtool modify command to begin modifying the source of an existing recipe. This command extracts the source for a recipe to the Devtool Workspace directory, checks out a branch for development, and applies the patches, if any, from the recipe as commits on top.

Use the following command to modify the linux-xlnx recipe:

$ petalinux-devtool modify linux-xlnx
Figure 1. petalinux-devtool modify

Building the Recipe

Use the petalinux-devtool build command to build your recipe. This command is equivalent to the bitbake -c populate_sysroot command. You must supply the root name of the recipe (i.e., do not provide versions, paths, or extensions), as shown:

$ petalinux-devtool build linux-xlnx
Figure 2. petalinux-devtool build

Building Your Image

Use the petalinux-devtool build-image command to build an image using the devtool flow. This will include the recipes which are the workspace directory. When running this command you must specify the image name to be built.

$ petalinux-devtool build-image petalinux-image-minimal
Figure 3. petalinux-devtool build-image

Resetting the Recipe

Use the petalinux-devtool reset command to remove the recipe and its configurations from Devtool Workspace directory. This command does not add/append changes in the Devtool Workspace to the any layers, you must need to update the recipe append file before running the reset command.

$ petalinux-devtool reset linux-xlnx
Figure 4. petalinux-devtool reset
Note: You can find a list of examples at https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-devtool-reference. Make sure to use petalinux-devtool in place of devtool in the examples.