I just started understanding Yocto. I have not find much information about classes ( .bbclass ) files . I know .bb file is a recipe which contains the instruction to build a package. When do we have to write a recipe and when a class or what is the difference between both
Asked
Active
Viewed 9,835 times
1 Answers
4
Yocto classes (.bbclass) are used to factorise recipe's code, to handle some general problems. For instance, handling CMake in recipes is made in cmake.bbclass so that when you add inherit cmake
, your recipe will manage CMake specifics.
You can look at class list in manual too.

Nayfe
- 2,130
- 13
- 18
-
Thanks for your help – md.jamal Dec 23 '17 at 15:04
-
Is there a best practice about naming? Can I have my-recipe.bb and my-recipe.bbclass with the same basename? Or will that mess up with includes when including from a different recipe? – Martin H. Dec 09 '20 at 08:58
-
@MartinH. not sure but i'll probably avoid it. Btw, your class name should be more generic than your recipe name? – Nayfe Jan 07 '21 at 09:07
-
@Nayfe my thought was I have a framework that is needed to compile other recipes. So I have a recipe for my framework and a class to include python code into recipes using the framework. Maybe like cmake.bb and cmake.bbclass in the original question. – Martin H. Jan 07 '21 at 13:09