petalinux-devtool Examples - 2023.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-10-18
Version
2023.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 add bbexample https://github.com/whbruce/bbexample.git
[INFO] Sourcing buildtools
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
[INFO] devtool add bbexample https://github.com/whbruce/bbexample.git 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:40721, PID: 21540
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:44081, PID: 21572
INFO: Fetching git://github.com/whbruce/bbexample.git;protocol=https;branch=master...
Loading cache: 100% |############################################################################| Time: 0:00:02
Loaded 6336 entries from dependency cache.
Parsing recipes: 100% |##########################################################################| Time: 0:00:02
Parsing of 4413 .bb files complete (4399 cached, 14 parsed). 6350 targets, 344 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#######################################################################| Time: 0:00:01
Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0% complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and all succeeded.
INFO: Using default source tree path xilinx-zcu102-2023.2/components/yocto/workspace/sources/bbexample
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#1)...
NOTE: Reconnecting to bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#1)...
NOTE: Retrying server connection (#1)...
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:37295, PID: 22750
INFO: Recipe xilinx-zcu102-2023.2/components/yocto/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional

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 status
[INFO] Sourcing buildtools
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
[INFO] devtool status 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:39421, PID: 23789
bbexample: xilinx-zcu102-2023.2/components/yocto/workspace/sources/bbexample (xilinx-zcu102-2023.2/components/yocto/workspace/recipes/bbexample/bbexample_git.bb)

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
petalinux-devtool modify linux-xlnx
[INFO] Sourcing buildtools
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
[INFO] devtool modify linux-xlnx 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:42543, PID: 24530
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:42809, PID: 24558
Loading cache: 100% |############################################################################| Time: 0:00:01
Loaded 6336 entries from dependency cache.
Parsing recipes: 100% |##########################################################################| Time: 0:00:02
Parsing of 4413 .bb files complete (4399 cached, 14 parsed). 6350 targets, 344 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#######################################################################| Time: 0:00:02
Sstate summary: Wanted 74 Local 0 Mirrors 51 Missed 23 Current 72 (68% match, 84% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 656 tasks of which 656 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 xilinx-zcu102-2023.2/components/yocto/workspace/sources/linux-xlnx

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 (that is, do not provide versions, paths, or extensions), as shown:

petalinux-devtool build linux-xlnx
petalinux-devtool build linux-xlnx
[INFO] Sourcing buildtools
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating workspace directory
[INFO] devtool build linux-xlnx 
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:37513, PID: 27000
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:35987, PID: 27025
Loading cache: 100% |############################################################################| Time: 0:00:01
Loaded 6336 entries from dependency cache.
Parsing recipes: 100% |##########################################################################| Time: 0:01:23
Parsing of 4413 .bb files complete (4398 cached, 15 parsed). 6350 targets, 344 skipped, 1 masked, 0 errors.
Removing 1 recipes from the xilinx_zcu102 sysroot: 100% |########################################| Time: 0:00:00
NOTE: Started PRServer with DBfile: xilinx-zcu102-2023.2/build/cache/prserv.sqlite3, Address: 127.0.0.1:36161, PID: 28745
Loading cache: 100% |############################################################################| Time: 0:00:03
Loaded 6336 entries from dependency cache.
Parsing recipes: 100% |##########################################################################| Time: 0:01:14
Parsing of 4413 .bb files complete (4398 cached, 15 parsed). 6350 targets, 344 skipped, 1 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#######################################################################| Time: 0:00:05
Checking sstate mirror object availability: 100% |###############################################| Time: 0:00:22
Sstate summary: Wanted 401 Local 22 Mirrors 177 Missed 202 Current 880 (49% match, 84% complete)
WARNING: The qemu-xilinx-system-native:do_configure sig is computed to be 6d36811060421830430787c675634127effc326c1300c2f998eb2b2d9e8719f0, but the sig is locked to 376b1b71f07fe035fc71b594319efed81fe9521d167a63eb53eda66db904b045 in SIGGEN_LOCKEDSIGS_t-x86-64
Removing 3 stale sstate objects for arch xilinx_zcu102: 100% |###################################| Time: 0:00:00
NOTE: Executing Tasks
NOTE: linux-xlnx: compiling from external source tree xilinx-zcu102-2023.2/components/yocto/workspace/sources/linux-xlnx
NOTE: Tasks Summary: Attempted 3410 tasks of which 3361 didn't need to be rerun and all succeeded.

Summary: There was 1 WARNING message.

Building Your Image

Use the petalinux-devtool build-image command to build an image using the devtool flow. This includes 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 1. 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 any layers, you need to update the recipe append file before running the reset command.

petalinux-devtool reset linux-xlnx
Figure 2. 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.