1

I have a C/C++ application that was originally built quite a few years ago for LynxOs. The hardware that the application was targeted for is now end of life, and I have been tasked with porting the application to a PPC11A powerpc board from Abaco that is using an embedded linux kernel.

I have a Board Support Package from Abaco that is built on an older version (2.3.3) of the Yocto Project, and I have been able to build a kernel image with the BSP. I have also been able to create a cross-toolchain installer from my build directory, and I have been able to compile/link the application with the cross-toolchain.

At this point, I have a build directory for the kernel image builds, and I have a completely separate build area for the application. Now, I am trying to figure out what I need to do in order to integrate the application's executables, libraries, config files, etc. into the kernel image.

Note that I a newbie when it comes to the Yocto Project and OE, and everything that I have been able to do so far is based on what I have read in the Yocto documents, online forums, and even a book that I purchased. I have found quite a bit of information on how to setup and use Eclipse for application development, but that is not possible in the environment that I am working in.

For what I have read, I assume that I will need to (or should) create a new layer for my application, and then I will need to create some sort of recipe to install the application into the kernel's filesystem. I did find an example in a book that I read of a recipe that uses bin_package to fetch, unpack, and install an externally built package which is essentially what I need to do with the exception that my application is not currently built as a software package.

Additional Clarification The application that I am working with is a simple makefile application (i.e. no autotools), and for various reasons, it will be built outside of the embedded linux kernel image build. I just need to figure out how to write a recipe to install the application's executables, libraries, config, and data files (all local files) into the root filesystem of the kernel image.

Any advice, concrete examples, or links to other sources that I may not have seen yet would be greatly appreciated.

Thank you.

Ed Mosher
  • 11
  • 2

1 Answers1

1

You are right, the best practice is always create new layer for your project containing a recipe for the specific C++ application along side with other project needs.

You can create a simple layer with:

bitbake-layers create-layer meta-custom-layer

then add it to your bblayers.conf file with:

bitbake-layers add-layer meta-custom-layer

Now you need to create a recipe for your application. Your application is written in C++, so you have to mention if it uses simple Makefile or cmake build.

Knowing the build type will help you create your recipe, because Yocto has a ready classes that are useful for configuring and building well-known build types.

A good example for Cmake recipe could be found here. A good example for Makefile (autotools) recipe could be found here.

If you don't want to use auto Yocto classes, you can create your own build process. A perfect reply on this could be found here with many great examples.

One other thing, you need to specify the source of your application, it can be from a git repository or local files. Both cases are in the previous example links.

After building your final recipe correctly, you can focus on do_install function that you can specify where your application gonna be integrated into the rootfs.

Finally, you can create a custom image for your project to add your recipe. A very great well detailed example for this along side with other example on creating recipes, layers, working with kernel, etc by Toradex could be found here.

I hope this will help your understanding more about Layers, recipes, ..etc

Talel BELHADJSALEM
  • 3,199
  • 1
  • 10
  • 30
  • Thank you very much. To address a couple of your suggestions, my application is a makefile application and the files are all local. – Ed Mosher Jun 08 '21 at 14:05
  • If your project is not confidential and you want me to help you creating and testing the recipe, you can share the sofware with me and I will work on it for you. – Talel BELHADJSALEM Jun 08 '21 at 16:07
  • That you very much for the offer, but although it is not classified, the software is proprietary. Plus, I feel like the only way that I am going to really learn the process really works it to do the work myself based on your guidance. – Ed Mosher Jun 08 '21 at 19:35