0
votes

I am a beginner in Yocto, and I have created an image in my build folder using

bitbake-layer create-layer meta-helloworld

Inside my Helloworld folder I have the recipe (.bb) file and the C source code to a helloworld program. After succesfully bitbaking my Layer, I have added it to the image by editing local.conf adding the following line:

IMAGE_INSTALL_append = " helloworld"

This worked perfectly on the board. (I was able to run the helloworld program from the board's terminal)

However, as it's pointed in challinan's answer in this question, this is not the best practice, and I should do it by adding a bbappend file in my layer, and according to the answer in the same question, add the dependencies in this file. I am however not aware of what these dependencies are nor how should I write them. I looked on the metadata and found some bbappend files but none of them provided anything very insightful.

How do I add a custom layer to image using bbapend file?

Further information: I am developping on a iMX6 board, using NXP sources but with a custom kernel. I am using devtool to change the kernel, but my custom layer recipe is outside the devtool (workspace) folder.

2

2 Answers

0
votes

Go to your image directory where your image.bb is present. e.g.

recipe-images/core-image-minimal.bbb

$ cd recipe-images
$ nano core-image-minimal.bbappend

Add the following line to your empty new file

 IMAGE_INSTALL += " helloworld"
0
votes

First thing to know is you are using using bbappend to add the layer, bbappend is used to extend/modify the existing recipe.

Steps to create and add custom layer to yocto environment:

$ bitbake-layer create-layer meta-helloworld

to add layer there are two ways -

  1. Manually add the layer name with path in bblayer.conf file

  2. By using bitbake command

    $ bitbake-layer add-layer meta-helloworld

You can get better idea here Add my own custom layer and create my own image in yocto