Use devtool add to Integrate New Code
- This section describes the devtool
- workflow to integrate new code.
- With this workflow, you can either build and deploy
- your code or rebuild an image that contains your code.
+ The devtool add command generates
+ a new recipe based on existing source code.
+ This command takes advantage of the
+ workspace
+ layer that many devtool commands
+ use.
+ The command is flexible enough to allow you to extract source
+ code into both the workspace or a separate local Git repository
+ and to use existing code that does not need to be extracted.
+
+
+
+ Depending on your particular scenario, the arguments and options
+ you use with devtool add form different
+ combinations.
+ The following diagram shows common development flows
+ you would use with the devtool add
+ command:
@@ -1791,6 +1805,106 @@
+ Generating the New Recipe:
+ The top part of the flow shows three scenarios by which
+ you could use devtool add to
+ generate a recipe based on existing source code.
+
+ In a shared development environment, it is
+ typical where other developers are responsible for
+ various areas of source code.
+ As a developer, you are probably interested in using
+ that source code as part of your development using
+ the Yocto Project.
+ All you need is access to the code, a recipe, and a
+ controlled area in which to do your work.
+
+ Within the diagram, three possible scenarios
+ feed into the devtool add workflow:
+
+ Left:
+ The left scenario represents a situation
+ where the source tree (srctree) exists as a
+ previously extracted Git structure outside of
+ the devtool workspace.
+
+
+ The following command names the recipe
+ and identifies where the existing source tree
+ is located:
+
+ $ devtool add recipe srctree
+
+
+ If a recipe exists that is associated with
+ source code, devtool
+ can leverage off that if it knows about the
+ layer in which the recipe resides.
+ Be sure to update your
+ conf/bblayers.conf file
+ to include the layers you want
+ devtool to know about
+ when looking for an existing recipe.
+
+ The command examines the source code and creates
+ a recipe for it placing the recipe into the
+ workspace.
+
+ Because the extracted source code already exists,
+ devtool does not try to
+ relocate it into the workspace - just the new
+ (or a modified copy of) the recipe is placed in
+ the workspace.
+
+ Aside from a recipe folder, the command
+ also creates an append folder and places an initial
+ *.bbappend within.
+
+ Middle:
+ The middle scenario represents a situation where
+ the source code does not exist locally.
+ In this case, the code is in an upstream Git
+ repository and needs to be extracted to some
+ local area.
+ Furthermore, the first positional argument
+ srctree in this case
+ identifies where the
+ devtool add command
+ will locate the extracted code outside of the
+ workspace:
+
+ $ devtool add srctree fetchuri
+
+ In summary, the source code is pulled from
+ fetchuri and extracted
+ into the location defined by
+ srctree as a local
+ Git repository.
+
+ Within workspace, devtool
+ creates both the recipe and an append file
+ for the recipe.
+
+ Right:
+ The right scenario represents another situation
+ where the source code does not exist locally
+ and again needs to be extracted.
+ However, in this situation, you want to extract the
+ source into the workspace.
+ Thus, everything you need will be located in the
+ workspace:
+
+ $ devtool add recipe fetchuri
+
+ With this command, devtool
+ creates a recipe and an append file in the
+ workspace as well as extracts the upstream
+ source files into a local Git repository also
+ within the sources folder.
+
+
+
+
Edit the Recipe:
At this point, you can use devtool edit-recipe
to open up the editor as defined by the