From 5d19f2bf27ba35a176a1ef8a1d81fc122bb6cac8 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 29 Jan 2015 16:58:08 -0800 Subject: [PATCH] dev-manual: First draft of recipetool section. (From yocto-docs rev: 3220f98c756291d95da0d9d7cff4aa09e8670ff2) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 187 ++++++++++++++---- 1 file changed, 149 insertions(+), 38 deletions(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index b8669f8daa..8706bd6888 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1213,40 +1213,154 @@ -
- Locate a Base Recipe +
+ Locate or Automatically Create a Base Recipe - Before writing a recipe from scratch, it is often useful to - discover whether someone else has already written one that - meets (or comes close to meeting) your needs. - The Yocto Project and OpenEmbedded communities maintain many - recipes that might be candidates for what you are doing. - You can find a good central index of these recipes in the - OpenEmbedded metadata index. + You can always write a recipe from scratch. + However, two choices exist that can help you quickly get a + start on a new recipe: + + recipetool: + A tool provided by the Yocto Project that automates + creation of a base recipe based on the source + files. + + Existing Recipes: + Location and modification of an existing recipe that is + similar in function to the recipe you need. + + - - Working from an existing recipe or a skeleton recipe is the - best way to get started. - Here are some points on both methods: - - Locate and modify a recipe that - is close to what you want to do: - This method works when you are familiar with the - current recipe space. - The method does not work so well for those new to - the Yocto Project or writing recipes. - Some risks associated with this method are - using a recipe that has areas totally unrelated to - what you are trying to accomplish with your recipe, - not recognizing areas of the recipe that you might - have to add from scratch, and so forth. - All these risks stem from unfamiliarity with the - existing recipe space. - Use and modify the following - skeleton recipe: - +
+ Creating the Base Recipe Using <filename>recipetool</filename> + + + recipetool automates creation of + a base recipe given a set of source code files. + As long as you can extract or point to the source files, + the tool will construct a recipe and automatically + configure all pre-build information into the recipe. + For example, suppose you have an application that builds + using Autotools. + Creating the base recipe using + recipetool results in a recipe + that has the pre-build dependencies, license requirements, + and checksums configured. + + + + To run the tool, you just need to be in your + Build Directory + and have sourced the build environment setup script + (i.e. + oe-init-build-env + or + oe-init-build-env-memres). + Here is the basic recipetool syntax: + + recipetool -h + recipetool create [-h] + recipetool [-d] [-q] [--color auto | always | never ] create [-o OUTFILE] [-m] [-x EXTERNALSRC] source + + -d Enables debug output. + -q Outputs only errors (quiet mode). + --color Colorizes the output automatically, always, or never. + -h Displays Python generated syntax for recipetool. + create Causes recipetool to create a base recipe. The create + command is further defined with these options: + + -o OUTFILE Specifies the full path and filename for the generated + recipe. + -m Causes the recipe to be machine-specific rather than + architecture-specific (default). + -x EXTERNALSRC Fetches and extracts source files from source + and places them in EXTERNALSRC. + source must be a URL. + -h Displays Python-generated syntax for create. + source Specifies the source code on which to base the + recipe. + + + + + Running recipetool creates the base + recipe and locates it properly in the layer that contains + your source files. + Following are some syntax examples: + + + + Use this syntax to generate a recipe based on source. + Once generated, the recipe resides in the existing source + code layer: + + recipetool create source + + Use this syntax to generate a recipe using code that you + extract from source. + The extracted code is placed in its own layer defined + by EXTERNALSRC. + + recipetool create -x EXTERNALSRC source + + Use this syntax to generate a recipe and override the + tool's default placement of the recipe by specifying both + its location and name using OUTFILE. + + recipetool create -o OUTFILE source + + Use this syntax to generate a recipe based on source. + The options direct recipetool to + run in "quiet mode" and to generate debugging information. + Once generated, the recipe resides in the existing source + code layer: + + recipetool create -o OUTFILE source + + +
+ +
+ Locating and Using a Similar Recipe + + + Before writing a recipe from scratch, it is often useful to + discover whether someone else has already written one that + meets (or comes close to meeting) your needs. + The Yocto Project and OpenEmbedded communities maintain many + recipes that might be candidates for what you are doing. + You can find a good central index of these recipes in the + OpenEmbedded metadata index. + + + + Working from an existing recipe or a skeleton recipe is the + best way to get started. + Here are some points on both methods: + + Locate and modify a recipe that + is close to what you want to do: + This method works when you are familiar with the + current recipe space. + The method does not work so well for those new to + the Yocto Project or writing recipes. + Some risks associated with this method are + using a recipe that has areas totally unrelated to + what you are trying to accomplish with your recipe, + not recognizing areas of the recipe that you might + have to add from scratch, and so forth. + All these risks stem from unfamiliarity with the + existing recipe space. + Use and modify the following + skeleton recipe: + If for some reason you do not want to use + recipetool and you cannot + find an existing recipe that is close to meeting + your needs, you can use the following structure to + provide the fundamental areas of a new recipe. + DESCRIPTION = "" HOMEPAGE = "" LICENSE = "" @@ -1255,14 +1369,11 @@ LIC_FILES_CHKSUM = "" SRC_URI = "" - - Modifying this recipe is the recommended method for - creating a new recipe. - The recipe provides the fundamental areas that you need - to include, exclude, or alter to fit your needs. - - - + + + + +