Skip to content
Home » Yocto Devtool

Yocto Devtool

A command-line utility by the name of devtool serves as the foundation of the extensible SDK. With the help of this tool, you may create, test, and package software using the extensible SDK and, if you choose, integrate it into an image created by the OpenEmbedded build system.

The devtool command line has a number of sub-commands for each function, similar to how Git is structured. Devtool -help can be used to view all available commands.

  • devtool add: Assists in adding new software to be built.
  • devtool modify: Sets up an environment to enable you to modify the source of an existing component.
  • devtool upgrade: Updates an existing recipe so that you can build it for an updated set of source files.

The Yocto Framework produces a directory called tmp/work/architecture>/recipe>/version> when you use the command “bitbake ” to construct a specific recipe. Also known as “work” directory. Yocto completes all of its operations in this directory, including obtaining the source code, configuring, building, and packaging, among others.

Yocto offers the “devtool” tool/utility, which enables us to edit a specific recipe’s source code and generates a patch and bbappend file for us.

Without the devtool, adding customizations is more complicated and error prone as, we basically open a source file and add our customizations and then recompile it using bitbake and this is not the best approach in Yocto for making customizations, as you can easily lose the changes.

How to use devtool for customization:

1. Run “devtool modify <recipename>” command, in our case, it is “devtool modify wifi-test-suite”. This command will fetch the sources and unpack them in “build/workspace/sources/<recipename> directory.

				
					Initialising tasks: 100% |##############################################################################################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 0 Found 0 Missed 0 Current 10 (0% match, 100% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
NOTE: Tasks Summary: Attempted 83 tasks of which 80 didn't need to be rerun and all succeeded.
INFO: Source tree extracted to /home/emr/Work/builddir/workspace/sources/wifi-test-suite
INFO: Using source tree as build directory since that would be the default for this recipe
INFO: Recipe wifi-test-suite now set up to build from /home/emr/Work/builddir/workspace/sources/wifi-test-suite
				
			

2. Make the changes to your source code

				
					diff --git a/dut/wfa_dut.c b/dut/wfa_dut.c
index ae5b9b1..bdb7ffe 100644
--- a/dut/wfa_dut.c
+++ b/dut/wfa_dut.c
@@ -25,7 +25,7 @@
  *       reference the architecture documents.
  *
  */
-
+//This is a test comment
 #include <pthread.h>
 #include <signal.h>
 #include <time.h>
				
			

3. Build the recipe using “bitbake <recipename>” command to verify/test your changes.

				
					Initialising tasks: 100% |##############################################################################################################################################################################################################################| Time: 0:00:01
Checking sstate mirror object availability: 100% |######################################################################################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 13 Found 0 Missed 13 Current 454 (0% match, 97% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
NOTE: wifi-test-suite: compiling from external source tree /home/emr/Work/builddir/workspace/sources/wifi-test-suite
NOTE: Tasks Summary: Attempted 1920 tasks of which 1877 didn't need to be rerun and all succeeded.

Summary: There were 4 WARNING messages shown.
				
			

4. Test your changes on the target, if you like. There is a “devtool deploy-target” command that, providing the destination machine has network access and any required dependencies are already in the image, will copy the files installed at do install across to the target machine.

5. After your changes, go to the source folder and commit your changes.

				
					git add -u
git commit -m "Making a test comment"
[devtool 90db77a] Making a test comment
 1 file changed, 1 insertion(+), 1 deletion(-)
				
			

6. Now run “devtool update-recipe<recipename> -a <path to your layer>” command which will create a bbappend and patch of changes that you made.

				
					devtool update-recipe wifi-test-suite -a /home/emr/Work/sources/meta-openembedded/meta-oe/
NOTE: Starting bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#2)...
Loading cache: 100% |###################################################################################################################################################################################################################################| Time: 0:00:00
Loaded 4545 entries from dependency cache.
Parsing recipes: 100% |#################################################################################################################################################################################################################################| Time: 0:00:01
Parsing of 3139 .bb files complete (3128 cached, 11 parsed). 4555 targets, 245 skipped, 172 masked, 0 errors.

Summary: There were 3 WARNING messages shown.
NOTE: Writing append file /home/emr/Work/sources/meta-openembedded/meta-oe/recipes-connectivity/wifi-test-suite/wifi-test-suite_git.bbappend
NOTE: Copying 0001-Making-a-test-comment.patch to /home/emr/Work/sources/meta-openembedded/meta-oe/recipes-connectivity/wifi-test-suite/wifi-test-suite/0001-Making-a-test-comment.patch
				
			

7. If you’re finished working on the recipe, run devtool reset <recipename>

				
					devtool reset wifi-test-suite
NOTE: Starting bitbake server...
INFO: Cleaning sysroot for recipe wifi-test-suite...
				
			

See other articles:

outsourcing

Advantages of Outsourcing

Nowadays, most embedded systems have functionalities implemented in software. The usage of embedded software by electronics manufacturers for expanded functionality, improved quality, and reusability

Read More »

OpenRC

OpenRC is a dependency-based init system that was designed to work with Unix-like computer operating systems. It keeps compatibility with the system-provided init system,

Read More »

Yocto Project

Yocto Project is an open source community project that helps developers to create customized systems based on Linux. It has an accessible toolset that

Read More »

Software testing

The investigation of artifacts and the behavior of the software under test is known as software testing. It also determines whether the actual results

Read More »
services

Component placement  

Component placement is one of the most critical parts of PCB design. First, you must understand the fundamental criteria for arranging components on a

Read More »

Leave a Reply

Your email address will not be published.