3.1.8. Creating a General Layer Using the bitbake-layers Script

The bitbake-layers script with the create-layer subcommand simplifies creating a new general layer.

Notes

  • For information on BSP layers, see the "BSP Layers" section in the Yocto Project Board Specific (BSP) Developer's Guide.

  • In order to use a layer with the OpenEmbedded build system, you need to add the layer to your bblayers.conf configuration file. See the "Adding a Layer Using the bitbake-layers Script" section for more information.

The default mode of the script's operation with this subcommand is to create a layer with the following:

In its simplest form, you can use the following command form to create a layer. The command creates a layer whose name corresponds to your_layer_name in the current directory:

     $ bitbake-layers create-layer your_layer_name
                

As an example, the following command creates a layer named meta-scottrif in your home directory:

     $ cd /usr/home
     $ bitbake-layers create-layer meta-scottrif
     NOTE: Starting bitbake server...
     Add your new layer with 'bitbake-layers add-layer meta-scottrif'
                

If you want to set the priority of the layer to other than the default value of "6", you can either use the ‐‐priority option or you can edit the BBFILE_PRIORITY value in the conf/layer.conf after the script creates it. Furthermore, if you want to give the example recipe file some name other than the default, you can use the ‐‐example-recipe-name option.

The easiest way to see how the bitbake-layers create-layer command works is to experiment with the script. You can also read the usage information by entering the following:

     $ bitbake-layers create-layer --help
     NOTE: Starting bitbake server...
     usage: bitbake-layers create-layer [-h] [--priority PRIORITY]
                                        [--example-recipe-name EXAMPLERECIPE]
                                        layerdir

     Create a basic layer

     positional arguments:
       layerdir              Layer directory to create

     optional arguments:
       -h, --help            show this help message and exit
       --priority PRIORITY, -p PRIORITY
                             Layer directory to create
       --example-recipe-name EXAMPLERECIPE, -e EXAMPLERECIPE
                             Filename of the example recipe