From f29cdba71ac93494ea68fdea89dd5fa755694114 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 26 Oct 2017 09:04:12 -0700 Subject: dev-manual, kernel-dev: Replaced yocto-layers with bitbake-layers command The yocto-layers script is being deprecated in the 2.4 YP release and the preferred script is now bitbake-layers. In particular, the section that talks about creating a general layer was using yocto-layers create. I have replaced it with bitbake-layers create-layer command. The bsp-guide and kernel-dev manual had links that used (in the case of kernel-dev) and referenced yocto-layers. I had to change these to reflect using bitbake-layers create-layers. (From yocto-docs rev: 73ec4d0c8c2c093b7c9df86038d132f0da975273) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 193 +++++++++++---------- 1 file changed, 106 insertions(+), 87 deletions(-) (limited to 'documentation/dev-manual') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index ac82dad0a3..2d6bdf5cd9 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -108,7 +108,7 @@ "Creating a New BSP Layer Using the yocto-bsp Script" section in the Yocto Project Board Support Package (BSP) Developer's Guide and the - "Creating a General Layer Using the yocto-layer Script" + "Creating a General Layer Using the bitbake-layers Script" section further down in this manual. @@ -968,122 +968,141 @@ -
- Creating a General Layer Using the yocto-layer Script +
+ Creating a General Layer Using the <filename>bitbake-layers</filename> Script - The yocto-layer script simplifies + The bitbake-layers script with the + create-layer subcommand simplifies creating a new general layer. - - For information on BSP layers, see the - "BSP Layers" - section in the Yocto Project Board Specific (BSP) - Developer's Guide. + Notes + + + For information on BSP layers, see the + "BSP Layers" + section in the Yocto Project Board Specific (BSP) + Developer's Guide. + + + The bitbake-layers script + replaces the yocto-layer + script, which is deprecated in the Yocto Project + 2.4 release. + The yocto-layer script + continues to function as part of the 2.4 release + but will be removed post 2.4. + + - The default mode of the script's operation is to prompt you for - information needed to generate the layer: + The default mode of the script's operation with this + subcommand is to create a layer with the following: - The layer priority. + A layer priority of 6. - Whether or not to create a sample recipe. + A conf + subdirectory that contains a + layer.conf file. - 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). + + A recipes-example subdirectory + that contains a further subdirectory named + example, which contains + an example.bb recipe file. - The - COPYING.MIT file: - The copyright and use notice for the software. + A COPYING.MIT, + which is the license statement for the layer. + The script assumes you want to use the MIT license, + which is typical for most layers, for the contents of + the layer itself. - The README - file: - A file describing the contents of your new layer. + + A README file, which is 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 layer/recipes-example/example/. - The script creates a .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". + 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 + - If you choose to generate a sample append file, the script - prompts you for the name for the file and then creates it - in layer/recipes-example-bbappend/example-bbappend/. - The script creates a .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. + 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 yocto-layer - script works is to experiment with the script. + 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: - $ yocto-layer help + $ 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 Once you create your general layer, you must add it to your bblayers.conf file. + You can add your layer by using the + bitbake-layers add-layer command: + + $ bitbake-layers add-layer your_layer_name + Here is an example where a layer named - meta-mylayer is added: + meta-scottrif is added and then the + layers are shown using the + bitbake-layers show-layers command: - 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 \ - " + $ bitbake-layers add-layer meta-scottrif + NOTE: Starting bitbake server... + Loading cache: 100% |############################################| Time: 0:00:00 + Loaded 1275 entries from dependency cache. + Parsing recipes: 100% |##########################################| Time: 0:00:00 + Parsing of 819 .bb files complete (817 cached, 2 parsed). 1276 targets, 44 skipped, 0 masked, 0 errors. + $ bitbake-layers show-layers + NOTE: Starting bitbake server... + layer path priority + ========================================================================== + meta /home/scottrif/poky/meta 5 + meta-poky /home/scottrif/poky/meta-poky 5 + meta-yocto-bsp /home/scottrif/poky/meta-yocto-bsp 5 + meta-mylayer /home/scottrif/meta-mylayer 6 + workspace /home/scottrif/poky/build/workspace 99 + meta-scottrif /home/scottrif/poky/build/meta-scottrif 6 Adding the layer to this file enables the build system to locate the layer during the build. @@ -6060,7 +6079,7 @@ Some notes from Cal: configuration file makes it easier to reproduce the same build configuration when using multiple build machines. See the - "Creating a General Layer Using the yocto-layer Script" + "Creating a General Layer Using the bitbake-layers Script" section for information on how to quickly set up a layer. Create the distribution configuration file: -- cgit v1.2.3-54-g00ecf