There's more...

The first thing to do is to add this new layer to your project's conf/bblayer.conf file. It is a good idea to add it to your template conf directory's bblayers.conf.sample file too, so that it is correctly appended when creating new projects. The highlighted line in the following code shows the addition of the layer to the conf/bblayers.conf file:

LCONF_VERSION = "7"                                                              
                                                                                 
BBPATH = "${TOPDIR}"                                                             
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}" 
                                                                                 
BBFILES ?= ""                                                                    
BBLAYERS = "                                                                   
  ${BSPDIR}/sources/poky/meta                                                    
  ${BSPDIR}/sources/poky/meta-poky                                                                                   
  ${BSPDIR}/sources/meta-openembedded/meta-oe                                    
  ${BSPDIR}/sources/meta-openembedded/meta-multimedia                                         
  ${BSPDIR}/sources/meta-freescale                                               
  ${BSPDIR}/sources/meta-freescale-3rdparty                                      
  ${BSPDIR}/sources/meta-freescale-distro                                        
  ${BSPDIR}/sources/meta-bsp-custom                                              
"         

Now, BitBake will parse the bblayers.conf file and find the conf/layer.conf file from your layer. In it, we find the following line:

BBFILES += "${LAYERDIR}/recipes-*/*/*.bb  
        ${LAYERDIR}/recipes-*/*/*.bbappend" 

It tells BitBake which directories to parse for recipes and append files. You need to make sure your directory and file hierarchy in this new layer matches the given pattern, or you will need to modify it.

BitBake will also find the following:

BBPATH .= ":${LAYERDIR}" 

The BBPATH variable is used to locate the bbclass files and the configuration and files included with the include and require directives. The search finishes with the first match, so it is best to keep filenames unique.

Some other variables we might consider defining in our conf/layer.conf file are the following:

LAYERDEPENDS_bsp-custom = "freescale" 
LAYERVERSION_bsp-custom = "1" 

The LAYERDEPENDS literal is a space-separated list of other layers your layer depends on, and the LAYERVERSION literal specifies the version of your layer in case other layers want to add a dependency to a specific version.

The COPYING.MIT file specifies the license for the metadata contained in the layer. The Yocto Project is licensed under the MIT license, a permissive free software license compatible with the General Public License (GPL) and other licenses. This license applies only to the metadata, as every package included in your build will have its own license.

The README file will need to be modified for your specific layer. It is usual to describe the layer and provide any other layer dependencies and usage instructions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset