Creating yocto bitbake recipe using ” devtool add ” command

The devtool add command automatically creates a recipe based on the source tree with which you provide it. Currently, the command has support for the following:

  • Autotools (autoconf and automake)
  • CMake
  • Scons
  • qmake
  • Plain Makefile
  • Out-of-tree kernel module
  • Binary package (i.e. “-b” option)
  • Node.js module
  • Python modules that use setuptools or distutils

Apart from binary packages, the determination of how a source tree should be treated is automatic based on the files present within that source tree. For example, if a CMakeLists.txt file is found, then the source tree is assumed to be using CMake and is treated accordingly.
Note : In most cases, you need to edit the automatically generated recipe in order to make it build properly. Typically, you would go through several edit and build cycles until you can build the recipe. Once the recipe can be built, you could use possible further iterations to test the recipe on the target device.

READ  Difference between native and cross compilation and how to compile simple program for x86 and ARM ?

Now, lets try to create recipe for strace using devtool add command automatically as,

 $ devtool add https://github.com/strace/strace.git 

Parsing recipes: 100% |#############################################################################| Time: 0:03:40
Parsing of 1577 .bb files complete (0 cached, 1577 parsed). 2177 targets, 183 skipped, 0 masked, 0 errors.
NOTE: Fetching git://github.com/strace/strace.git;protocol=https…

–2017-09-18 09:52:41– http://downloads.yoctoproject.org/mirror/sources/git2_github.com.strace.strace.git.tar.gz
Resolving downloads.yoctoproject.org (downloads.yoctoproject.org)… 198.145.29.63
Connecting to downloads.yoctoproject.org (downloads.yoctoproject.org)|198.145.29.63|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2017-09-18 09:52:42 ERROR 404: Not Found.

Cloning into bare repository ‘/home/myuser//rpi/poky/build/../sources/git2/github.com.strace.strace.git’…
remote: Counting objects: 36327, done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 36327 (delta 75), reused 104 (delta 56), pack-reused 36177
Receiving objects: 100% (36327/36327), 10.49 MiB | 201.00 KiB/s, done.
Resolving deltas: 100% (27273/27273), done.
Checking connectivity… done.
NOTE: Using default source tree path /home/myuser//rpi/poky/build/workspace/sources/strace
NOTE: Recipe /home/myuser//rpi/poky/build/workspace/recipes/strace/strace_git.bb has been automatically created; further editing may be required to make it fully functional

Reference : http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#sdk-a-closer-look-at-devtool-add

Leave a Reply

Your email address will not be published. Required fields are marked *