The yocto-layer
script simplifies
creating a new general layer.
The default mode of the script's operation is to prompt you for information needed to generate the layer:
The layer priority.
Whether or not to create a sample recipe.
Whether or not to create a sample append file.
Use the yocto-layer create
sub-command
to create a new general layer.
In its simplest form, you can create a layer as follows:
$ yocto-layer create mylayer
The previous example creates a layer named
meta-mylayer
in the current directory.
As the yocto-layer create
command runs,
default values for the prompts appear in brackets.
Pressing enter without supplying anything for the prompts
or pressing enter and providing an invalid response causes the
script to accept the default value.
Once the script completes, the new layer
is created in the current working directory.
The script names the layer by prepending
meta-
to the name you provide.
Minimally, the script creates the following within the layer:
The conf
directory:
This directory contains the layer's configuration file.
The root name for the file is the same as the root name
your provided for the layer (e.g.
).
layer
.conf
The
COPYING.MIT
file:
The copyright and use notice for the software.
The README
file:
A file describing the contents of your new layer.
If you choose to generate a sample recipe file, the script
prompts you for the name for the recipe and then creates it
in
.
The script creates a layer
/recipes-example/example/.bb
file and a
directory, which contains a sample
helloworld.c
source file, along with
a sample patch file.
If you do not provide a recipe name, the script uses
"example".
If you choose to generate a sample append file, the script
prompts you for the name for the file and then creates it
in
.
The script creates a layer
/recipes-example-bbappend/example-bbappend/.bbappend
file and a
directory, which contains a sample patch file.
If you do not provide a recipe name, the script uses
"example".
The script also prompts you for the version of the append file.
The version should match the recipe to which the append file
is associated.
The easiest way to see how the yocto-layer
script works is to experiment with the script.
You can also read the usage information by entering the
following:
$ yocto-layer help
Once you create your general layer, you must add it to your
bblayers.conf
file.
Here is an example where a layer named
meta-mylayer
is added:
BBLAYERS = ?" \ /usr/local/src/yocto/meta \ /usr/local/src/yocto/meta-poky \ /usr/local/src/yocto/meta-yocto-bsp \ /usr/local/src/yocto/meta-mylayer \ "
Adding the layer to this file enables the build system to locate the layer during the build.