<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=L.S.+Cook</id>
	<title>Yocto Project - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=L.S.+Cook"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/L.S._Cook"/>
	<updated>2026-04-24T10:16:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20157</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20157"/>
		<updated>2016-09-09T19:09:56Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Creating a recipe from existing source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
=== What devtool can do ===&lt;br /&gt;
&lt;br /&gt;
One of the most powerful tools in our test kitchen is &#039;&#039;&#039;devtool&#039;&#039;&#039;.  We can think of devtool as something that can be used to &amp;quot;mix&amp;quot; customization into our Yocto Project image.  Some of the common ways to get mixing are:&lt;br /&gt;
&lt;br /&gt;
*  To add new applications and libraries to a Yocto Project image, &lt;br /&gt;
*  To modify the source for an existing component, &lt;br /&gt;
*  To test changes on target hardware, and &lt;br /&gt;
*  To integrate that change into the rest of the OpenEmbedded (OE) build system. &lt;br /&gt;
&lt;br /&gt;
In short, we can think of devtool as a single point of entry for creating, modifying and testing recipes.&lt;br /&gt;
&lt;br /&gt;
=== What devtool cannot do ===&lt;br /&gt;
&lt;br /&gt;
Note that devtool cannot add your recipe to a layer, nor can it update your build configuration to include it in a image. These steps are covered elsewhere in the [[Cookbook]]. Devtool can, however, be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
=== Standard build environment ===&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
=== Extensible SDK ===&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [https://downloads.yoctoproject.org/tools/support/workflow/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.1.sh here].&lt;br /&gt;
&lt;br /&gt;
To install the extensible SDK, make sure it is executable and then run&lt;br /&gt;
 poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.1.sh -d /path/to/esdk&lt;br /&gt;
Note that installation will take 7-10 minutes.&amp;lt;br/&amp;gt;&lt;br /&gt;
The configure build environment, run &lt;br /&gt;
 source /path/to/esdk/environment-setup-i586-poky-linux&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the locations of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named &amp;lt;tt&amp;gt;devtool&amp;lt;/tt&amp;gt; for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of license. This is set to unknown because devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENSE, and generates a checksum to ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running, have a network connection, and have an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one; however, rather than using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;devtool modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20156</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20156"/>
		<updated>2016-09-09T14:27:20Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
=== What devtool can do ===&lt;br /&gt;
&lt;br /&gt;
One of the most powerful tools in our test kitchen is &#039;&#039;&#039;devtool&#039;&#039;&#039;.  We can think of devtool as something that can be used to &amp;quot;mix&amp;quot; customization into our Yocto Project image.  Some of the common ways to get mixing are:&lt;br /&gt;
&lt;br /&gt;
*  To add new applications and libraries to a Yocto Project image, &lt;br /&gt;
*  To modify the source for an existing component, &lt;br /&gt;
*  To test changes on target hardware, and &lt;br /&gt;
*  To integrate that change into the rest of the OpenEmbedded (OE) build system. &lt;br /&gt;
&lt;br /&gt;
In short, we can think of devtool as a single point of entry for creating, modifying and testing recipes.&lt;br /&gt;
&lt;br /&gt;
=== What devtool cannot do ===&lt;br /&gt;
&lt;br /&gt;
Note that devtool cannot add your recipe to a layer, nor can it update your build configuration to include it in a image. These steps are covered elsewhere in the [[Cookbook]]. Devtool can, however, be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
=== Standard build environment ===&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
=== Extensible SDK ===&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [https://downloads.yoctoproject.org/tools/support/workflow/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.1.sh here].&lt;br /&gt;
&lt;br /&gt;
To install the extensible SDK, make sure it is executable and then run&lt;br /&gt;
 poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.1.sh -d /path/to/esdk&lt;br /&gt;
Note that installation will take 7-10 minutes.&amp;lt;br/&amp;gt;&lt;br /&gt;
The configure build environment, run &lt;br /&gt;
 source /path/to/esdk/environment-setup-i586-poky-linux&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the location of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named devtool for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of licence. This is set to unknown as devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENCE and generates a checksum so ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running, have a network connection, and have an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one; however, rather than using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;devtool modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=20092</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=20092"/>
		<updated>2016-08-29T15:12:27Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Where to Next? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.example.com link title]&amp;lt;h1&amp;gt;Welcome to the Yocto Project Wiki!&amp;lt;/h1&amp;gt;&lt;br /&gt;
The [http://yoctoproject.org Yocto Project] is an open-source project that delivers a set of tools that create operating system images for embedded Linux systems. The Yocto Project tools are based on the [http://www.openembedded.org/wiki/Main_Page OpenEmbedded] (OE) project, which uses the BitBake build tool, to construct complete Linux images. The BitBake and OE components are combined together to form a reference build host, historically known as Poky. This [https://www.youtube.com/watch?v=utZpKM7i5Z4 video] will help explain what it&#039;s all about.&lt;br /&gt;
&lt;br /&gt;
===Where to Start?===&lt;br /&gt;
If you&#039;re new to Yocto take a look at the [[Glossary]] so you&#039;re familiar with the terms used in this wiki and the project documentation. Then take a look at the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]. You can follow the steps in this document to clone the poky repository, quickly configure your build environment, and then try a build. Corporate firewalls can be problematic so network proxy configurations are detailed on the [[Working Behind a Network Proxy]] page. We advise you go straight for the [[Working_Behind_a_Network_Proxy#Option_2:_Chameleonsocks| Chameleonsocks option]]. &lt;br /&gt;
&lt;br /&gt;
===Where to Next?===&lt;br /&gt;
Thanks to the quick start guide, it&#039;s pretty easy to get your first Linux image and and running. Here are some places to look for help when improving your Yocto skills.&lt;br /&gt;
* The first tool you&#039;ll need to get familiar with is &#039;&#039;&#039;bitbake&#039;&#039;&#039;, so reading through the [https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html user manual] is recommended before make any OS configuration changes. You don&#039;t need to understand it all right now, but bookmark this page for reference.&lt;br /&gt;
* Once you start adding packages and configuring your image to create your own distribution, things can go wrong and it can hard to track down the root cause. There is no shortage of Yocto documentation resource, but if you&#039;re not exactly sure what you&#039;re looking for this &#039;&#039;&#039;[[Documentation Decoder]]&#039;&#039;&#039; will help you out. Also take a look at the [https://wiki.yoctoproject.org/wiki/Cookbook &#039;&#039;&#039;Cookbook&#039;&#039;&#039;] and [https://wiki.yoctoproject.org/wiki/Technical_FAQ troubleshooting guide]. Also [https://www.yoctoproject.org/blogs/jefro/2016/yocto-project-books these books] are helpful. &lt;br /&gt;
* Some new tools such as [http://www.yoctoproject.org/docs/current/toaster-manual/toaster-manual.html Toaster], [http://www.yoctoproject.org/docs/current/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK] and [https://github.com/crops/crops CROPS] are making it easier to get the best out of Yocto on Windows and Mac OS X. Take a look at the new workflow in [[Developer Workflow Improvements]].&lt;br /&gt;
* There is also a [https://wiki.yoctoproject.org/wiki/TipsAndTricks &#039;&#039;&#039;Tips and Tricks&#039;&#039;&#039;] section where more experienced developers contribute to articles that will help those new to Yocto Project.&lt;br /&gt;
&lt;br /&gt;
== Project planning ==&lt;br /&gt;
&lt;br /&gt;
=== 2.2 (Current) Project Planning ===&lt;br /&gt;
&lt;br /&gt;
* [[Planning]]&lt;br /&gt;
&lt;br /&gt;
=== 2.2 Project Status and Schedule ===&lt;br /&gt;
* [[Yocto Project v2.2 Status]]&lt;br /&gt;
* [[Yocto 2.2 Schedule]]&lt;br /&gt;
* [[2.2 QA Status]]&lt;br /&gt;
&lt;br /&gt;
== Release Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
&lt;br /&gt;
== QA &amp;amp; Automation ==&lt;br /&gt;
&lt;br /&gt;
* [[QA| Yocto Project QA Main Page]]&lt;br /&gt;
&lt;br /&gt;
== Wiki reference sitemap ==&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Documentation Decoder]]&lt;br /&gt;
* [[Working Behind a Network Proxy]]&lt;br /&gt;
* [[FAQ]] and [[Technical FAQ]]. These need to be unified.&lt;br /&gt;
* [[Cookbook]] and [[TipsAndTricks | Tips and Tricks]]. Need clear messaging on how these should be differentiated.&lt;br /&gt;
* [[Developer Workflow Improvements]]&lt;br /&gt;
* [[Planning and Governance]]&lt;br /&gt;
* [[Community Guidelines]]&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
* [[License Infrastructure Interest Group | License Infrastructure]]&lt;br /&gt;
* [[Processes and Activities]]&lt;br /&gt;
* [[Projects]]&lt;br /&gt;
* [[Yocto Interest Groups]]&lt;br /&gt;
* [[Testopia]] - The Yocto Project&#039;s community-opened test case management platform&lt;br /&gt;
* [[Toaster]] - the web interface &lt;br /&gt;
* [[Archive]] - Graveyard for out of date articles.&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [http://yoctoproject.org Yocto Project Front Page]&lt;br /&gt;
* [http://git.yoctoproject.org/ Yocto Project Git Source Repos]&lt;br /&gt;
* [https://bugzilla.yoctoproject.org/ Yocto Project Bugzilla]&lt;br /&gt;
* [https://www.yoctoproject.org/tools-resources/community/mailing-lists Yocto Project Mailing Lists]&lt;br /&gt;
* [https://autobuilder.yoctoproject.org/main/ Yocto Project Autobuilder Waterfall Page]&lt;br /&gt;
* [https://autobuilder.yoctoproject.org/ Yocto Project Autobuilder Splash/Info Page]&lt;br /&gt;
* [http://downloads.yoctoproject.org/releases/yocto/ Yocto Project Releases]&lt;br /&gt;
* [http://autobuilder.yoctoproject.org/pub/nightly/ Yocto Project Nightly Build Images]&lt;br /&gt;
* [http://downloads.yoctoproject.org/mirror/sources/ Upstream Sources Mirror]&lt;br /&gt;
* [http://www.openembedded.org/wiki/Main_Page OpenEmbedded Wiki]&lt;br /&gt;
* [http://cgit.openembedded.org/ OpenEmbedded Git Repos]&lt;br /&gt;
* [http://buildbot.net/ BuildBot]&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20091</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20091"/>
		<updated>2016-08-29T14:49:53Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* What devtool can do */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
=== What devtool can do ===&lt;br /&gt;
&lt;br /&gt;
One of the most powerful tools in our test kitchen is &#039;&#039;&#039;devtool&#039;&#039;&#039;.  We can think of devtool as something that can be used to &amp;quot;mix&amp;quot; customization into our Yocto Project image.  Some of the common ways to get mixing are:&lt;br /&gt;
&lt;br /&gt;
*  To add new applications and libraries to a Yocto Project image, &lt;br /&gt;
*  To modify the source for an existing component, &lt;br /&gt;
*  To test changes on target hardware, and &lt;br /&gt;
*  To integrate that change into the rest of the OpenEmbedded (OE) build system. &lt;br /&gt;
&lt;br /&gt;
In short, we can think of devtool as a single point of entry for creating, modifying and testing recipes.&lt;br /&gt;
&lt;br /&gt;
=== What devtool cannot do ===&lt;br /&gt;
&lt;br /&gt;
Note that devtool cannot add your recipe to a layer, nor can it update your build configuration to include it in a image. These steps are covered elsewhere in the [[Cookbook]]. devtool can, however, be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [http://downloads.yoctoproject.org/tools/support/workflow/esdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.0%2bsnapshot.sh here].&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the location of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named devtool for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of licence. This is set to unknown as devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENCE and generates a checksum so ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running have a network connection and an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one, but instead iof using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20090</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20090"/>
		<updated>2016-08-29T14:49:29Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: parallel formatting of this section to legacy sdk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
=== What devtool can do ===&lt;br /&gt;
&lt;br /&gt;
One of the most powerful tools in our test kitchen is &#039;&#039;&#039;devtool&#039;&#039;&#039;.  We can think of devtool as something that can be used to &amp;quot;mix&amp;quot; customization into our Yocto Project image.  Some of the common ways to get mixing are:&lt;br /&gt;
&lt;br /&gt;
*  To add new applications and libraries to a Yocto Project image, &lt;br /&gt;
*  To modify the source for an existing component, &lt;br /&gt;
*  To test changes on target hardware, and &lt;br /&gt;
*  To integrating that change into the rest of the OpenEmbedded (OE) build system. &lt;br /&gt;
&lt;br /&gt;
In short, we can think of devtool as a single point of entry for creating, modifying and testing recipes.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== What devtool cannot do ===&lt;br /&gt;
&lt;br /&gt;
Note that devtool cannot add your recipe to a layer, nor can it update your build configuration to include it in a image. These steps are covered elsewhere in the [[Cookbook]]. devtool can, however, be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [http://downloads.yoctoproject.org/tools/support/workflow/esdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.0%2bsnapshot.sh here].&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the location of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named devtool for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of licence. This is set to unknown as devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENCE and generates a checksum so ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running have a network connection and an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one, but instead iof using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20079</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20079"/>
		<updated>2016-08-26T18:36:16Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Cookbook Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
== Base recipe ==&lt;br /&gt;
Building a basic image usually involves these steps: &lt;br /&gt;
&lt;br /&gt;
1. Selecting a target [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html#bsp BSP].&lt;br /&gt;
&lt;br /&gt;
2. Selecting a [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images Linux image type].&lt;br /&gt;
&lt;br /&gt;
3. Gathering the required (dependency) packages (&amp;lt;code&amp;gt;opencv, java&amp;lt;/code&amp;gt;, for example): [http://layers.openembedded.org/layerindex/branch/master/layers/ layer index] is good resource.&lt;br /&gt;
&lt;br /&gt;
4. Updating the layer configuration (&amp;lt;code&amp;gt;build/conf/bblayers.conf&amp;lt;/code&amp;gt;) to include the BSP and feature layers.&lt;br /&gt;
&lt;br /&gt;
5. Updating the build configuration (&amp;lt;code&amp;gt;build/conf/local.conf&amp;lt;/code&amp;gt;) to set the BSP machine, including features and any licenses they require.&lt;br /&gt;
&lt;br /&gt;
Add packages and doing custom configurations on your image (creating your own distribution) is where creativity and flair come in.  And as with any Linux-based process, there are innumerable ways to do things... there&#039;s not always one clear &amp;quot;right&amp;quot; way... so to help you get bearings, we&#039;re attempting to organize the initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Application Development with Extensible SDK]] (Test Kitchen)&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development with Legacy SDK]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20078</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20078"/>
		<updated>2016-08-26T18:35:57Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Cookbook Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
== Base recipe ==&lt;br /&gt;
Building a basic image usually involves these steps: &lt;br /&gt;
&lt;br /&gt;
1. Selecting a target [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html#bsp BSP].&lt;br /&gt;
&lt;br /&gt;
2. Selecting a [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images Linux image type].&lt;br /&gt;
&lt;br /&gt;
3. Gathering the required (dependency) packages (&amp;lt;code&amp;gt;opencv, java&amp;lt;/code&amp;gt;, for example): [http://layers.openembedded.org/layerindex/branch/master/layers/ layer index] is good resource.&lt;br /&gt;
&lt;br /&gt;
4. Updating the layer configuration (&amp;lt;code&amp;gt;build/conf/bblayers.conf&amp;lt;/code&amp;gt;) to include the BSP and feature layers.&lt;br /&gt;
&lt;br /&gt;
5. Updating the build configuration (&amp;lt;code&amp;gt;build/conf/local.conf&amp;lt;/code&amp;gt;) to set the BSP machine, including features and any licenses they require.&lt;br /&gt;
&lt;br /&gt;
Add packages and doing custom configurations on your image (creating your own distribution) is where creativity and flair come in.  And as with any Linux-based process, there are innumerable ways to do things... there&#039;s not always one clear &amp;quot;right&amp;quot; way... so to help you get bearings, we&#039;re attempting to organize the initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Application Development with Extensible SDK]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development with Legacy SDK]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook:Example:Creating_and_updating_recipes_with_devtool&amp;diff=20077</id>
		<title>Cookbook:Example:Creating and updating recipes with devtool</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook:Example:Creating_and_updating_recipes_with_devtool&amp;diff=20077"/>
		<updated>2016-08-26T18:35:21Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: L.S. Cook moved page Cookbook:Example:Creating and updating recipes with devtool to Application Development with Extensible SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Application Development with Extensible SDK]]&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20076</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20076"/>
		<updated>2016-08-26T18:35:21Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: L.S. Cook moved page Cookbook:Example:Creating and updating recipes with devtool to Application Development with Extensible SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This example describes &#039;&#039;&#039;devtool&#039;&#039;&#039; and how to use it. This tool makes it easier to add new applications and libraries to a Yocto Project image, modify the source for an existing component, test changes on the target hardware, and ease integration into the rest of the OpenEmbedded build system. In short think of devtool as a single point of entry to creating, modifying and testing recipes. Note that devtool cannot add your recipe to a layer nor update your build configuration to include it in a image. These steps will be covered later in the [[Cookbook]]. devtool can be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [http://downloads.yoctoproject.org/tools/support/workflow/esdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.0%2bsnapshot.sh here].&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the location of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named devtool for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of licence. This is set to unknown as devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENCE and generates a checksum so ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running have a network connection and an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one, but instead iof using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20075</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=20075"/>
		<updated>2016-08-26T18:33:26Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Cookbook Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
== Base recipe ==&lt;br /&gt;
Building a basic image usually involves these steps: &lt;br /&gt;
&lt;br /&gt;
1. Selecting a target [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html#bsp BSP].&lt;br /&gt;
&lt;br /&gt;
2. Selecting a [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images Linux image type].&lt;br /&gt;
&lt;br /&gt;
3. Gathering the required (dependency) packages (&amp;lt;code&amp;gt;opencv, java&amp;lt;/code&amp;gt;, for example): [http://layers.openembedded.org/layerindex/branch/master/layers/ layer index] is good resource.&lt;br /&gt;
&lt;br /&gt;
4. Updating the layer configuration (&amp;lt;code&amp;gt;build/conf/bblayers.conf&amp;lt;/code&amp;gt;) to include the BSP and feature layers.&lt;br /&gt;
&lt;br /&gt;
5. Updating the build configuration (&amp;lt;code&amp;gt;build/conf/local.conf&amp;lt;/code&amp;gt;) to set the BSP machine, including features and any licenses they require.&lt;br /&gt;
&lt;br /&gt;
Add packages and doing custom configurations on your image (creating your own distribution) is where creativity and flair come in.  And as with any Linux-based process, there are innumerable ways to do things... there&#039;s not always one clear &amp;quot;right&amp;quot; way... so to help you get bearings, we&#039;re attempting to organize the initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Application Development with Extensible SDK]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development with Legacy SDK]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development&amp;diff=20074</id>
		<title>Application Development</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development&amp;diff=20074"/>
		<updated>2016-08-26T18:31:21Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: L.S. Cook moved page Application Development to Application Development with Legacy SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Application Development with Legacy SDK]]&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=20073</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=20073"/>
		<updated>2016-08-26T18:31:21Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: L.S. Cook moved page Application Development to Application Development with Legacy SDK&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development with Legacy SDK==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment with QEMU (emulator).  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different from adding brand new functionality, as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more &amp;quot;real-world&amp;quot; example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
which will be located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=20072</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=20072"/>
		<updated>2016-08-26T18:30:46Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development with Legacy SDK==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment with QEMU (emulator).  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different from adding brand new functionality, as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more &amp;quot;real-world&amp;quot; example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
which will be located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20071</id>
		<title>Application Development with Extensible SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Extensible_SDK&amp;diff=20071"/>
		<updated>2016-08-26T18:22:38Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Deploying */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This example describes &#039;&#039;&#039;devtool&#039;&#039;&#039; and how to use it. This tool makes it easier to add new applications and libraries to a Yocto Project image, modify the source for an existing component, test changes on the target hardware, and ease integration into the rest of the OpenEmbedded build system. In short think of devtool as a single point of entry to creating, modifying and testing recipes. Note that devtool cannot add your recipe to a layer nor update your build configuration to include it in a image. These steps will be covered later in the [[Cookbook]]. devtool can be used with both the Yocto Project build environment and the [http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html#sdk-extensible Extensible SDK].&lt;br /&gt;
&lt;br /&gt;
(From the Yocto Project documentation: Here&#039;s a presentation by Trevor Woerner that, while somewhat dated, provides detailed background information and a complete working &lt;br /&gt;
[https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view Yocto Project Developer Workflow Tutorial].)&lt;br /&gt;
&lt;br /&gt;
== How to get devtool ==&lt;br /&gt;
If you have set up the Yocto Project build environment using the Quick Start Guide, you already have access to devtool for qemux86 image. &lt;br /&gt;
&lt;br /&gt;
Alternatively you can install an &#039;&#039;&#039;Extensible SDK (eSDK)&#039;&#039;&#039;. These come in two flavors; &amp;quot;minimal&amp;quot; and &amp;quot;full&amp;quot;. The &amp;quot;minimal&amp;quot; eSDK is the preferred option as it comes as a small 30Mb installer and downloads the components it needs depending on requirements of application project. The installer contains the URL of an sstate mirror so it does not no need to build all dependencies from source code. The &amp;quot;full&amp;quot; eSDK contains all the components already built so is much larger (similar in size to traditional SDK, i.e. at least 1GB). The [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-extensible Yocto SDK Manual] contains more details on installing and using the eSDK.&lt;br /&gt;
&lt;br /&gt;
Currently the Yocto Project autobuilder only builds &amp;quot;full&amp;quot; eSDKs. The qemux86 full eSDK can be found [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.1.sh here]. There is a [https://bugzilla.yoctoproject.org/show_bug.cgi?id=9596 feature enhancement request] for the autobuilder to create minimal eSDKs.&lt;br /&gt;
&lt;br /&gt;
In the meantime, an experimental minimal qemux86 eSDK can be found [http://downloads.yoctoproject.org/tools/support/workflow/esdk/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.0%2bsnapshot.sh here].&lt;br /&gt;
&lt;br /&gt;
== Creating a recipe from existing source ==&lt;br /&gt;
Let&#039;s say you have a C application that you want to add to your OS image. Assume repo is https://github.com/whbruce/bbexample.git and you want to name recipe (and thus the executable it creates) bbexample.&lt;br /&gt;
 devtool add bbexample https://github.com/whbruce/bbexample.git&lt;br /&gt;
You will see the following output&lt;br /&gt;
 NOTE: Creating workspace layer in /path/to/build/workspace&lt;br /&gt;
 NOTE: Enabling workspace layer in bblayers.conf&lt;br /&gt;
 NOTE: Using default source tree path /path/to/build/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Recipe /path/to/build/workspace/recipes/bbexample/bbexample_git.bb has been automatically created; further editing may be required to make it fully functional&lt;br /&gt;
Key entries here are the location of the source code in &amp;lt;tt&amp;gt;/path/to/build/workspace/sources/bbexample&amp;lt;/tt&amp;gt;. Note that git will create a branch named devtool for your work. The recipe is in &amp;lt;tt&amp;gt;/path/to/build/workspace/recipes/bbexample/bbexample_git.bb&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You can now look at the generated recipe with&lt;br /&gt;
 devtool edit-recipe bbexample&lt;br /&gt;
We&#039;ll take a look at what&#039;s in the recipe. Comments and whitespace have been removed for easier reading&lt;br /&gt;
 LICENSE = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
 LIC_FILES_CHKSUM = &amp;quot;file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8&amp;quot;&lt;br /&gt;
 SRC_URI = &amp;quot;git://github.com/whbruce/bbexample.git;protocol=https&amp;quot;&lt;br /&gt;
 # Modify these as desired&lt;br /&gt;
 PV = &amp;quot;0.1+git${SRCPV}&amp;quot;&lt;br /&gt;
 SRCREV = &amp;quot;${AUTOREV}&amp;quot;&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 inherit autotools&lt;br /&gt;
 EXTRA_OECONF = &amp;quot;&amp;quot;&lt;br /&gt;
Let&#039;s go through the bitbake commands and variables in the recipe and explain what they do:&lt;br /&gt;
;LICENSE&lt;br /&gt;
:The type of licence. This is set to unknown as devtool cannot recognize the old MIT text. &lt;br /&gt;
;LIC_FILES_CHKSUM&lt;br /&gt;
:devtool looks in the root of the source folder for a file called LICENCE and generates a checksum so ensure checkout has been successful. &lt;br /&gt;
;SRC_URI&lt;br /&gt;
:The git repo given in the &#039;devtool add&#039; command. This is where the source will be pulled from. &lt;br /&gt;
;PV&lt;br /&gt;
:The package version. Usually taken from recipe filename (e.g. bbexample_0.1.bb would automatically set PV = &amp;quot;0.1&amp;quot;)&lt;br /&gt;
;SRCREV&lt;br /&gt;
:the git revision to checkout. ${AUTOREV} means HEAD and must be used during app development. It should be set a specific commit before being added to a layer.&lt;br /&gt;
;S&lt;br /&gt;
:Where the source can be found after being fetched and unpacked.&lt;br /&gt;
;inherit autotools&lt;br /&gt;
:Use a bitbake class that can configure, build and install an autotools project&lt;br /&gt;
;EXTRA_OECONF&lt;br /&gt;
:Options to be passed to configure script. In this case it is empty, so is not necessary.&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
 $ devtool build bbexample&lt;br /&gt;
 Parsing recipes: 100% |#########################################| ETA:  00:00:00&lt;br /&gt;
 Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
 NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
 NOTE: Preparing RunQueue&lt;br /&gt;
 NOTE: Checking sstate mirror object availability (for 51 objects)&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: bbexample: compiling from external source tree /path/to/esdk/workspace/sources/bbexample&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
This build command runs bitbake just as in a full Yocto Project OS image build. The key line in the output is &#039;&#039;&#039;Checking sstate mirror object availability (for 51 objects)&#039;&#039;&#039;. As the extensible SDK installer gives you a minimal build environment it has to download all the dependencies (e.g. native build tools and necessary target libraries). Here 51 objects have been found and are downloaded in their pre-built state greatly speeding up the build process (i.e. we just run 342 tasks of which 336 didn&#039;t need to be rerun). This is the extensible part of the SDK in action.&lt;br /&gt;
&lt;br /&gt;
== Start QEMU (headless) == &lt;br /&gt;
&lt;br /&gt;
Before deploying, the target must be running have a network connection and an ssh server running. In this case, we&#039;ll start the qemux86 target as follows. &lt;br /&gt;
&lt;br /&gt;
 $ runqemu qemux86 nographic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Deploying ==&lt;br /&gt;
&lt;br /&gt;
 $ devtool deploy-target -s bbexample root@192.168.7.2&lt;br /&gt;
 Parsing recipes..done.&lt;br /&gt;
 devtool_deploy.list                           100%  167     0.2KB/s   00:00    &lt;br /&gt;
 devtool_deploy.sh                             100% 1002     1.0KB/s   00:00    &lt;br /&gt;
 ./&lt;br /&gt;
 ./usr/&lt;br /&gt;
 ./usr/bin/&lt;br /&gt;
 ./usr/bin/bbexample&lt;br /&gt;
 ./usr/include/&lt;br /&gt;
 ./usr/include/bbexample.h&lt;br /&gt;
 ./usr/lib/&lt;br /&gt;
 ./usr/lib/libbbexample.so.1&lt;br /&gt;
 ./usr/lib/libbbexample.so&lt;br /&gt;
 ./usr/lib/libbbexample.so.1.0.0&lt;br /&gt;
 ./usr/lib/libbbexample.la&lt;br /&gt;
 NOTE: Successfully deployed /path/to/esdk/sdk/tmp/work/i586-poky-linux/bbexample/0.1+git999-r0/image&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
 root@qemux86:~# bbexample&lt;br /&gt;
 Hello Yocto World...&lt;br /&gt;
 Hello World (from a shared library!)&lt;br /&gt;
&lt;br /&gt;
== Build Image ==&lt;br /&gt;
To test the updated OS image that now includes your application, you can build it as follows. If you are in a eSDK environment, devtool will automatically build the image used to create the SDK. If in the standard build environment you must specify an image.&lt;br /&gt;
 devtool build-image [image-name]&lt;br /&gt;
Output will be follows&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Parsing recipes..done.&lt;br /&gt;
NOTE: Building image core-image-minimal with the following additional packages: bbexample&lt;br /&gt;
Loading cache: 100% |###########################################| ETA:  00:00:00&lt;br /&gt;
Loaded 1302 entries from dependency cache.&lt;br /&gt;
Parsing recipes: 100% |#########################################| Time: 00:00:00&lt;br /&gt;
Parsing of 872 .bb files complete (870 cached, 2 parsed). 1302 targets, 49 skipped, 0 masked, 0 errors.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
&lt;br /&gt;
Build Configuration:&lt;br /&gt;
BB_VERSION        = &amp;quot;1.30.0&amp;quot;&lt;br /&gt;
BUILD_SYS         = &amp;quot;x86_64-linux&amp;quot;&lt;br /&gt;
NATIVELSBSTRING   = &amp;quot;universal&amp;quot;&lt;br /&gt;
TARGET_SYS        = &amp;quot;i586-poky-linux&amp;quot;&lt;br /&gt;
MACHINE           = &amp;quot;qemux86&amp;quot;&lt;br /&gt;
DISTRO            = &amp;quot;poky&amp;quot;&lt;br /&gt;
DISTRO_VERSION    = &amp;quot;2.1&amp;quot;&lt;br /&gt;
TUNE_FEATURES     = &amp;quot;m32 i586&amp;quot;&lt;br /&gt;
TARGET_FPU        = &amp;quot;&amp;quot;&lt;br /&gt;
meta              &lt;br /&gt;
meta-poky         &lt;br /&gt;
meta-yocto-bsp    = &amp;quot;krogoth:f7b994b75261550faa3ccf9005fc174950c7bee9&amp;quot;&lt;br /&gt;
workspace         = &amp;quot;&amp;lt;unknown&amp;gt;:&amp;lt;unknown&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NOTE: Preparing RunQueue&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
bbexample-0.1+git999-r0 do_compile: NOTE: bbexample: compiling from external source tree /path/to/build/workspace/sources/bbexample&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2062 tasks of which 2046 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Successfully built core-image-minimal. You can find output files in /path/to/build/tmp/deploy/images/qemux86&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Publish Recipe ==&lt;br /&gt;
Once application has been tested, you can make the recipe available. It will be in /path/to/build/workspace/recipes/bbexample. Make sure you add a version tothe filename (e.g. bbexample_1.0.bb)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Update Existing Recipe ==&lt;br /&gt;
Updating a recipe is similar to creating one, but instead iof using &amp;lt;tt&amp;gt;devtool add&amp;lt;/tt&amp;gt; we use the &amp;lt;tt&amp;gt;modify&amp;lt;/tt&amp;gt; command.&lt;br /&gt;
 devtool modify bbexample&lt;br /&gt;
&lt;br /&gt;
The edit/build/test cycle is then the same as for adding a recipe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[WORK IN PROGRESS]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
Back to the [[Cookbook]] home page.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19935</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19935"/>
		<updated>2016-08-22T18:18:47Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment with QEMU (emulator).  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different from adding brand new functionality, as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more &amp;quot;real-world&amp;quot; example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
which will be located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19874</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19874"/>
		<updated>2016-08-15T14:46:02Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Base recipe */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
== Base recipe ==&lt;br /&gt;
Building a basic image usually involves these steps: &lt;br /&gt;
&lt;br /&gt;
1. Selecting a target [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html#bsp BSP].&lt;br /&gt;
&lt;br /&gt;
2. Selecting a [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images Linux image type].&lt;br /&gt;
&lt;br /&gt;
3. Gathering the required (dependency) packages (&amp;lt;code&amp;gt;opencv, java&amp;lt;/code&amp;gt;, for example): [http://layers.openembedded.org/layerindex/branch/master/layers/ layer index] is good resource.&lt;br /&gt;
&lt;br /&gt;
4. Updating the layer configuration (&amp;lt;code&amp;gt;build/conf/bblayers.conf&amp;lt;/code&amp;gt;) to include the BSP and feature layers.&lt;br /&gt;
&lt;br /&gt;
5. Updating the build configuration (&amp;lt;code&amp;gt;build/conf/local.conf&amp;lt;/code&amp;gt;) to set the BSP machine, including features and any licenses they require.&lt;br /&gt;
&lt;br /&gt;
Add packages and doing custom configurations on your image (creating your own distribution) is where creativity and flair come in.  And as with any Linux-based process, there are innumerable ways to do things... there&#039;s not always one clear &amp;quot;right&amp;quot; way... so to help you get bearings, we&#039;re attempting to organize the initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development|Application development]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19873</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19873"/>
		<updated>2016-08-15T14:44:36Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
== Base recipe ==&lt;br /&gt;
Building a basic image usually involves these steps: &lt;br /&gt;
&lt;br /&gt;
1. Selecting a target [http://www.yoctoproject.org/docs/current/bsp-guide/bsp-guide.html#bsp BSP].&lt;br /&gt;
2. Selecting a [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images Linux image type].&lt;br /&gt;
3. Gathering the required (dependency) packages (&amp;lt;code&amp;gt;opencv, java&amp;lt;/code&amp;gt;, for example): [http://layers.openembedded.org/layerindex/branch/master/layers/ layer index] is good resource.&lt;br /&gt;
4. Updating the layer configuration (&amp;lt;code&amp;gt;build/conf/bblayers.conf&amp;lt;/code&amp;gt;) to include the BSP and feature layers.&lt;br /&gt;
5. Updating the build configuration (&amp;lt;code&amp;gt;build/conf/local.conf&amp;lt;/code&amp;gt;) to set the BSP machine, including features and any licenses they require.&lt;br /&gt;
&lt;br /&gt;
Add packages and doing custom configurations on your image (creating your own distribution) is where creativity and flair come in.  And as with any Linux-based process, there are innumerable ways to do things... there&#039;s not always one clear &amp;quot;right&amp;quot; way... so to help you get bearings, we&#039;re attempting to organize the initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development|Application development]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19809</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19809"/>
		<updated>2016-08-09T15:32:04Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
 &lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* [[Cookbook:Example:Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure]] (and what goes where)&lt;br /&gt;
* Intro to [[Writing Recipes|writing recipes]]&lt;br /&gt;
* [[Package management]]&lt;br /&gt;
* [[Application Development|Application development]] (Test Kitchen) &lt;br /&gt;
* [[Cookbook:Example:Configuring_your_kernel|Configuring your kernel]]&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19808</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19808"/>
		<updated>2016-08-09T14:37:47Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen! It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different from adding brand new functionality, as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more &amp;quot;real-world&amp;quot; example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
which will be located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19807</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19807"/>
		<updated>2016-08-09T13:53:21Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Modifying Existing Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different from adding brand new functionality, as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more &amp;quot;real-world&amp;quot; example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19786</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19786"/>
		<updated>2016-08-08T20:22:46Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to Yocto Project [[Cookbook]]&lt;br /&gt;
&lt;br /&gt;
This section is currently a [ &#039;&#039;&#039;Work In Process&#039;&#039;&#039; ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different that adding brand new functionality as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more “real-world” example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19777</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19777"/>
		<updated>2016-08-08T14:57:31Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Modifying Existing Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different that adding brand new functionality as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more “real-world” example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4a 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &amp;quot;ReadMe.c-Updated-the-version-string&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19776</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19776"/>
		<updated>2016-08-08T14:55:02Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
      {&lt;br /&gt;
         printf(&amp;quot;Hello World:\n&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different that adding brand new functionality as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more “real-world” example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4-modified 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &#039;ReadMe.c-Updated-the-version-string&#039;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19775</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19775"/>
		<updated>2016-08-08T14:52:26Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different that adding brand new functionality as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more “real-world” example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;Readme.c&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; and providing the &amp;lt;code&amp;gt;-V&amp;lt;/code&amp;gt; option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4-modified 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &#039;ReadMe.c-Updated-the-version-string&#039;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19774</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19774"/>
		<updated>2016-08-08T14:49:49Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modifying Existing Functionality ====&lt;br /&gt;
&lt;br /&gt;
Another common scenario is to modify code that already has an existing recipe in place.  This is different that adding brand new functionality as was demonstrated in the previous section.&lt;br /&gt;
&lt;br /&gt;
To help demonstrate this concept, we will use a more “real-world” example: the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed Yocto Project SDK. The steps in this section will modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; to change the reported version, which is 3.4.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to modify &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Run &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; to locate, extract, and prepare all of the &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; files. This command locates the source based on information in the existing recipe, unpacks the source into your workspace, applies any existing patches, and parses all related recipes:&lt;br /&gt;
&lt;br /&gt;
   $ devtool modify mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Fetching mdadm…&lt;br /&gt;
   NOTE: Unpacking…&lt;br /&gt;
   NOTE: Patching…&lt;br /&gt;
   NOTE: Adding local source files to srctree…&lt;br /&gt;
   NOTE: Source tree extracted to /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Using source tree as build directory since recipe inherits autotools-brokensep&lt;br /&gt;
   NOTE: Recipe mdadm now set up to build from /home/username/poky_sdk/workspace/sources/mdadm.&lt;br /&gt;
&lt;br /&gt;
2. In the source location &amp;lt;code&amp;gt;$HOME/poky_sdk/workspace/sources/mdadm&amp;lt;/code&amp;gt;, use an editor to edit the &amp;lt;code&amp;gt;README.C&amp;lt;/code&amp;gt; file.  Change the line that specifies the version as &#039;&#039;&#039;3.4&#039;&#039;&#039; to say &#039;&#039;&#039;3.4a&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
   #define VERSION &amp;quot;3.4a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. Rebuild &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build mdadm&lt;br /&gt;
   Parsing recipes: 100% |################################################################################################################| ETA:  00:00:00&lt;br /&gt;
   Parsing of 872 .bb files complete (0 cached, 872 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
   NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
   NOTE: Preparing RunQueue&lt;br /&gt;
   NOTE: Executing SetScene Tasks&lt;br /&gt;
   NOTE: Executing RunQueue Tasks&lt;br /&gt;
   mdadm-3.4-r0 do_compile: NOTE: mdadm: compiling from external source tree /home/username/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   NOTE: Tasks Summary: Attempted 347 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
4. Take note that QEMU is still assumed to be running in the shell from the previous section; use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the freshly-built &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt; module to the already-running image:&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target mdadm root@192.168.7.2&lt;br /&gt;
   NOTE: Successfully deployed /home/username/poky_sdk/tmp/work/core2-64-poky-linux/mdadm/3.4-r0/image&lt;br /&gt;
5. In the shell running QEMU, verify your changes by running “mdadm” and providing the “-V” option to return the version:&lt;br /&gt;
&lt;br /&gt;
   sh-4.3# mdadm -V&lt;br /&gt;
   mdadm - v 3.4-modified 21 June 2016&lt;br /&gt;
   sh-4.3#&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you try to use the previous command to see the original version of &amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;, you will get a message indicating the command is not found; &amp;lt;code&amp;gt;mdadm&amp;lt;/code. is not in the image by default.&lt;br /&gt;
&lt;br /&gt;
6. At this point, you have modified the source code of an existing module all within your workspace.  If you want to save your work, commit those changes.  You can use the following commands to see the changes that need to be staged and committed:&lt;br /&gt;
&lt;br /&gt;
   $ cd /$HOME/poky_sdk/workspace/sources/mdadm&lt;br /&gt;
   $ git status&lt;br /&gt;
&lt;br /&gt;
And these two commands to stage and commit the changed file:&lt;br /&gt;
&lt;br /&gt;
   $ git add ReadMe.c&lt;br /&gt;
   $ git commit -m &#039;ReadMe.c-Updated-the-version-string&#039;&lt;br /&gt;
&lt;br /&gt;
7. Turn the commit you have made into a patch:&lt;br /&gt;
&lt;br /&gt;
   $ devtool update-recipe mdadm&lt;br /&gt;
   Parsing recipes..done.&lt;br /&gt;
   NOTE: Updating file run-ptest&lt;br /&gt;
   NOTE: Adding new patch 0001-ReadMe.c-Updated-the-version-string.patch&lt;br /&gt;
   NOTE: Updating recipe mdadm_3.4.bb&lt;br /&gt;
&lt;br /&gt;
The patch is located here:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/layers/build/meta/recipes-extended/mdadm/mdadm/0001-ReadMe.c-Updated-the-version-string.patch&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19773</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19773"/>
		<updated>2016-08-08T14:16:07Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;/code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19772</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19772"/>
		<updated>2016-08-08T14:15:26Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: minor fixes to wiki formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be fetched by someone using the full-blown YP development process.  You need to know where the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19768</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19768"/>
		<updated>2016-08-05T21:06:14Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Adding or Modifying Functionality of an Existing Image (QEMU) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use devtool to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/hello.c&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/Makefile.am&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;helloworld/configure.ac&amp;lt;/code&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Adding New Functionality ====&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; functionality to the existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment named &amp;quot;workspace&amp;quot; for development.  The command automatically creates the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;code&amp;gt;devtool build&amp;lt;/code&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be&lt;br /&gt;
   fetched by someone using the full-blown YP development process.  You need to know where&lt;br /&gt;
   the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19767</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19767"/>
		<updated>2016-08-05T21:01:27Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Yocto Test Kitchen */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Development ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Project Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application that runs on embedded hardware, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  So what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions] in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;br /&gt;
&lt;br /&gt;
For the first experiment in our Test Kitchen, let&#039;s assume you got through the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start], and have already created an image that we&#039;ll use to build upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Adding or Modifying Functionality of an Existing Image (QEMU) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Existing image&#039;&#039;&#039; -- The image that currently runs on your target hardware.  This is the image to which you are adding new functionality or modifying existing functionality.  &lt;br /&gt;
* &#039;&#039;&#039;Installed SDK&#039;&#039;&#039; -- The installed Software Development Kit. It is recommended that you grab the extensible (ext4) version of the SDK, so that you can easily add new and modify existing functionality.&lt;br /&gt;
* &#039;&#039;&#039;An initialized SDK environment&#039;&#039;&#039; -- The properly-initialized SDK dev environment, which is set up by running the SDK environment setup script.&lt;br /&gt;
* &#039;&#039;&#039;Source Code&#039;&#039;&#039;: Existing source files for any new functionality or for any existing functionality you would like to add or modify, respectively. For our Test Kitchen experiment, we will add a &amp;lt;code&amp;gt;helloworld&amp;lt;/code&amp;gt; module as new functionality and we will modify the existing multiple device administrator (&amp;lt;code&amp;gt;mdadm&amp;lt;/code&amp;gt;) module, which is a core module included as part of the installed SDK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Process===&lt;br /&gt;
&lt;br /&gt;
Use these steps to set up your SDK dev environment as a QEMU emulator.  &lt;br /&gt;
&lt;br /&gt;
1. Locate and download QEMU-compatible images from the latest Yocto releases from http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64&lt;br /&gt;
&lt;br /&gt;
2. Save the file to your machine. Our example is using &amp;lt;code&amp;gt;core-image-sato-dev-qemux86-64.ext4&amp;lt;/code&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86-64/core-image-sato-qemux86-64.ext4&lt;br /&gt;
   &lt;br /&gt;
3. Locate the SDK option appropriate for your target hardware from the [http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64 Yocto toolchain].&lt;br /&gt;
&lt;br /&gt;
4. Download and save the SDK Installer: &amp;lt;code&amp;gt;poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&amp;lt;/code&amp;gt;.   &#039;&#039;&#039;NOTE&#039;&#039;&#039;: It is very important that when you choose the SDK, you are choosing the one appropriate for the hardware or for QEMU.  In this case, you need the extensible SDK that maps to the image we are going to eventually run on QEMU.  For more details on selecting and installing an SDK, see the [http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html Installing the SDK] section in the Yocto Project Software Development Kit (SDK) Developer’s Guide.&lt;br /&gt;
&lt;br /&gt;
5. Make the installer executable:&lt;br /&gt;
&lt;br /&gt;
   $ chmod +x poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
&lt;br /&gt;
6. Install the SDK by running the script and accepting the defaults&lt;br /&gt;
&lt;br /&gt;
   $ . /poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-2.1.sh&lt;br /&gt;
   Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.1&lt;br /&gt;
   Enter target directory for SDK (default: ~/poky_sdk):&lt;br /&gt;
   You are about to install the SDK to &amp;quot;/home/username/poky_sdk&amp;quot;. Proceed[Y/n]? y&lt;br /&gt;
   Extracting SDK...&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   .&lt;br /&gt;
   SDK has been successfully set up and is ready to be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script:&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
7. Initialize the SDK Development Environment&lt;br /&gt;
   &lt;br /&gt;
   $ . $HOME/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
   SDK environment now set up; additionally you may now run devtool to perform development tasks.&lt;br /&gt;
   Run devtool --help for further details.&lt;br /&gt;
&lt;br /&gt;
8. Ensure your new source code is available. The only requirement for the source code is that it either exists locally or can be accessed through an URL for downloading. This example assumes the source code  exists at:&lt;br /&gt;
&lt;br /&gt;
   $HOME/mysource/helloworld&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Several methods exist by which you can gain access to your source files. See the (http://www.yoctoproject.org/docs/2.1/sdk-manual/sdk-manual.html#sdk-use-devtool-to-add-an-application Use devtool to add an application) section in the Yocto SDK for more information. &lt;br /&gt;
&lt;br /&gt;
For this example, be sure you know the URL from which your source code can be downloaded.  The source files must consist of the following files: &amp;lt;code&amp;gt;hello.c&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Makefile.am&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;configure.ac&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;helloworld/hello.c&amp;lt;/pre&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
   #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   main()&lt;br /&gt;
   {&lt;br /&gt;
   printf(&amp;quot;Hello World!\n&amp;quot;);&lt;br /&gt;
   }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;helloworld/Makefile.am&amp;lt;/pre&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   bin_PROGRAMS = hello&lt;br /&gt;
   hello_SOURCES = hello.c&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;helloworld/configure.ac&amp;lt;/pre&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   AC_INIT(hello,0.1)&lt;br /&gt;
   AM_INIT_AUTOMAKE([foreign])&lt;br /&gt;
   AC_PROG_CC&lt;br /&gt;
   AC_PROG_INSTALL&lt;br /&gt;
   AC_OUTPUT(Makefile)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adding New Functionality&lt;br /&gt;
========================&lt;br /&gt;
&lt;br /&gt;
Now that all the pieces are in place, we can use devtool to add the&lt;br /&gt;
new &amp;quot;helloworld&amp;quot; application to the existing image.  The result will&lt;br /&gt;
be a built object that can be integrated into an image, tested using&lt;br /&gt;
either actual hardware or the Quick Emulator (QEMU), and ultimately&lt;br /&gt;
deployed to the actual hardware.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to add the &amp;lt;pre&amp;gt;helloworld&amp;lt;pre&amp;gt; functionality to the&lt;br /&gt;
existing image:&lt;br /&gt;
&lt;br /&gt;
1. Use &amp;lt;code&amp;gt;devtool add&amp;lt;/code&amp;gt; to locate and set up the work environment&lt;br /&gt;
   named &amp;quot;workspace&amp;quot; for development.  The command automatically creates&lt;br /&gt;
   the recipe needed to build the module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool add helloworld $HOME/mysources/helloworld&lt;br /&gt;
   NOTE: Recipe home/username/poky_sdk/workspace/recipes/helloworld/helloworld.bb`&lt;br /&gt;
   has been automatically created; further editing may be required to make it&lt;br /&gt;
   fully functional&lt;br /&gt;
&lt;br /&gt;
2. Use the &amp;lt;pre&amp;gt;devtool build&amp;lt;/pre&amp;gt; command to run the recipe using the Yocto Project build engine, which is part of the installed SDK, and create the build output for your new module:&lt;br /&gt;
&lt;br /&gt;
   $ devtool build helloworld&lt;br /&gt;
    Loading cache: 100% |########################################################| ETA:  00:00:00&lt;br /&gt;
    Loaded 1302 entries from dependency cache.&lt;br /&gt;
    Parsing recipes: 100% |########################################################| Time: 00:00:00&lt;br /&gt;
    Parsing of 872 .bb files complete (871 cached, 1 parsed). 1302 targets, 48 skipped, 0 masked, 0 errors.&lt;br /&gt;
    NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
    NOTE: Preparing RunQueue&lt;br /&gt;
    NOTE: Executing SetScene Tasks&lt;br /&gt;
    NOTE: Executing RunQueue Tasks&lt;br /&gt;
    helloworld-0.1-r0 do_compile: NOTE: helloworld: compiling from external source tree /home/username/mysource/helloworld&lt;br /&gt;
    NOTE: Tasks Summary: Attempted 342 tasks of which 336 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
3. Make sure the image you downloaded earlier is in the &amp;lt;code&amp;gt;poky_sdk&amp;lt;code&amp;gt; directory where the SDK was installed; then use the &amp;lt;code&amp;gt;devtool runqemu&amp;lt;/code&amp;gt; command to start QEMU and boot the image:&lt;br /&gt;
&lt;br /&gt;
   $ cp $HOME/Downloads/core-image-sato-dev-qemux86_64.ext4 $HOME/poky_sdk&lt;br /&gt;
   $ devtool runqemu core-image-sato-dev-qemux86-64.ext4&lt;br /&gt;
&lt;br /&gt;
4. Because the previous step ties up the terminal, you need to open a new terminal window, get into the SDK development area, and run the SDK initialization script to continue:&lt;br /&gt;
   &lt;br /&gt;
   $ cd $HOME/poky_sdk&lt;br /&gt;
   $ . /home/username/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
5. Use the &amp;lt;code&amp;gt;devtool deploy-target&amp;lt;/code&amp;gt; command to deploy the &amp;lt;code&amp;gt;&#039;&#039;&#039;helloworld&#039;&#039;&#039;&amp;lt;/code&amp;gt; output you built earlier to QEMU so that you can test the module.&lt;br /&gt;
   &lt;br /&gt;
   $ devtool deploy-target helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: If you get an error message indicating the script failed to copy to &amp;lt;code&amp;gt;root@192.168.7.2&amp;lt;/code&amp;gt;, you can run the command with &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; option to turn off key-checking.&lt;br /&gt;
&lt;br /&gt;
   $ devtool deploy-target -c helloworld root@192.168.7.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Inside QEMU, use the GUI to open up a terminal and then run the &amp;quot;hello&amp;quot; command:&lt;br /&gt;
 &lt;br /&gt;
    sh-4.3# hello&lt;br /&gt;
    Hello World:&lt;br /&gt;
    sh-4.3#&lt;br /&gt;
&lt;br /&gt;
You will see &amp;quot;Hello World&amp;quot; returned as terminal output.  At this point, you have added the new functionality and proved that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. Make sure to upload the sources into a repository (e.g. Git) such that the files could be fetched by other people.  This is typical practice once any new module has been created and tested and is ready for use by other developers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. At this point you have put the source code in a more permanent area where it can be&lt;br /&gt;
   fetched by someone using the full-blown YP development process.  You need to know where&lt;br /&gt;
   the recipe is:&lt;br /&gt;
&lt;br /&gt;
   $HOME/poky_sdk/workspace/recipes/helloworld&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19766</id>
		<title>Application Development with Legacy SDK</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Application_Development_with_Legacy_SDK&amp;diff=19766"/>
		<updated>2016-08-05T17:42:57Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: Created page with &amp;quot; [ Work In Process ]   = Yocto Test Kitchen =  Welcome to the Yocto Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you wan...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[ Work In Process ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Yocto Test Kitchen =&lt;br /&gt;
&lt;br /&gt;
Welcome to the Yocto Test Kitchen!  It can be a bit overwhelming to know where to start with the Yocto Project. You know you want to build an application, but where and how do you get started? A development environment can be an abstract, somewhat hard-to-imagine thing. This part of the wiki is intended to fill the knowledge gap between the [http://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html Quick Start] and the myriad of ways to build an image and run it on real (or emulated) hardware.  And what better way to do that than with a &amp;quot;Test Kitchen&amp;quot; analogy? &lt;br /&gt;
&lt;br /&gt;
Our Yocto Test Kitchen must be Linux-powered, of course.  And using one of the [http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#detailed-supported-distros supported distributions]  in our Linux-powered kitchen means that we&#039;ll already either &#039;&#039;&#039;have&#039;&#039;&#039; or have a way to &#039;&#039;&#039;easily get&#039;&#039;&#039; everything we need to follow the recipes in our Cookbook.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19765</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19765"/>
		<updated>2016-08-05T16:11:08Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* Cookbook Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
 &lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure and what goes where&lt;br /&gt;
* Introduction to writing recipes&lt;br /&gt;
* Package management&lt;br /&gt;
* [[Application Development]]&lt;br /&gt;
* Configuring your kernel&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;diff=19719</id>
		<title>Talk:Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;diff=19719"/>
		<updated>2016-08-02T23:22:28Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: /* == */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;August 2, 2016 &lt;br /&gt;
&lt;br /&gt;
Notes&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
One goal of this Cookbook is to bridge the gap between the Getting Started Guide and documentation; please contribute anything that does this! &lt;br /&gt;
&lt;br /&gt;
Main reference manual of YP is big; it may be possible to parse that down by factoring out generic processes and putting them here.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;diff=19718</id>
		<title>Talk:Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;diff=19718"/>
		<updated>2016-08-02T23:20:44Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: Created page with &amp;quot;August 2, 2016  ==============  Notes -----  One goal of this Cookbook is to bridge the gap between the Getting Started Guide and documentation; please contribute anything tha...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;August 2, 2016 &lt;br /&gt;
==============&lt;br /&gt;
&lt;br /&gt;
Notes&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
One goal of this Cookbook is to bridge the gap between the Getting Started Guide and documentation; please contribute anything that does this! &lt;br /&gt;
&lt;br /&gt;
Main reference manual of YP is big; it may be possible to parse that down by factoring out generic processes and putting them here.&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19470</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19470"/>
		<updated>2016-07-12T16:18:19Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: cleanup overview page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, and about the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add &lt;br /&gt;
&lt;br /&gt;
* your own examples,&lt;br /&gt;
* pointers to training materials, &lt;br /&gt;
* tips,&lt;br /&gt;
* and any other material that may be helpful to new and experienced users of Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please test all procedures before adding them to this page&#039;&#039;; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our initial list of examples we&#039;d like to include in our Cookbook. Those that have been written, or those that are in progress will be linked. The others are on our list to work on. (As we get more, we may regroup the organization of these topics; but for now this should work:&lt;br /&gt;
 &lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* Understanding the &amp;lt;code&amp;gt;tmp/work&amp;lt;/code&amp;gt; directory structure and what goes where&lt;br /&gt;
* Introduction to writing recipes&lt;br /&gt;
* Package management&lt;br /&gt;
* Application Development&lt;br /&gt;
* Configuring your kernel&lt;br /&gt;
* What else ... ?&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19202</id>
		<title>Cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Cookbook&amp;diff=19202"/>
		<updated>2016-06-24T18:29:13Z</updated>

		<summary type="html">&lt;p&gt;L.S. Cook: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[WORK IN PROGRESS]&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This Yocto Project Cookbook collects working examples of how to use the Yocto Project, filling some of the gaps between the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Yocto Project Quick Start Guide] and the&lt;br /&gt;
[http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html full reference documentation]. Like any&lt;br /&gt;
cookbook, we&#039;ll include both basic and complex examples you can follow to learn about the pantry of&lt;br /&gt;
components and files available, as well as the techniques for manipulating them using Yocto Project tools.&lt;br /&gt;
&lt;br /&gt;
We encourage you, the Yocto Project community, to add your own examples to this Cookbook, or pointers to training, tips,&lt;br /&gt;
and other material that can help new and experienced users of Yocto Project share their knowledge and experience.&lt;br /&gt;
&lt;br /&gt;
Please test all procedures before adding them to this page; and if you do see a problem or improvement, start a &lt;br /&gt;
[https://wiki.yoctoproject.org/wiki/index.php?title=Talk:Cookbook&amp;amp;action=edit discussion] (use the discussion tab at the top of this page)&lt;br /&gt;
, or edit the page itself!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cookbook Topics ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our initial list of examples we&#039;d like to include in our cookbook.  Those that have been written or that are in progress will be linked, the others are on our list to work on.  (As we get more, we may regroup the organization of these topics, but for now this should work:&lt;br /&gt;
 &lt;br /&gt;
* [[Cookbook:Example:Adding_packages_to_your_OS_image|Adding packages to your OS image]]&lt;br /&gt;
* [[Cookbook:Example:Creating_and_updating_recipes_with_devtool|Creating and updating recipes with devtool]]&lt;br /&gt;
* Understanding the fetch/unpack/configure/build/package pipeline&lt;br /&gt;
* Locating and understanding failures&lt;br /&gt;
* Understanding the tmp/work directory structure and what goes where&lt;br /&gt;
* Introduction to writing recipes&lt;br /&gt;
* Package management&lt;br /&gt;
* Application Development&lt;br /&gt;
* Configuring your kernel&lt;br /&gt;
* And more....&lt;br /&gt;
&lt;br /&gt;
== Other Links ==&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html Quick Start Guide]&lt;br /&gt;
:The official Yocto Project Quick Start Guide contains a step-by-step walk-through showing how to set up your environment and perform your first build&lt;br /&gt;
&lt;br /&gt;
;[http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#extendpoky Developer Manual: Common Tasks]&lt;br /&gt;
:The Common Tasks section of the Yocto Project Developer Manual&#039;s documentation discusses creating layers, customizing images, writing recipes, configuring and patching the kernel, performing automated runtime testing, and more.&lt;br /&gt;
&lt;br /&gt;
;[https://www.yoctoproject.org/sites/default/files/ypdd-2016.04-san_diego.pdf Creating a Custom Embedded Linux Distribution for Any Embedded Device Presentation from ELC 2016 Dev Day]&lt;br /&gt;
:A good overview presentation from the Linux Foundation covering many topics for creating a custom embedded Linux distribution with Yocto Project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are links that were in a previous version of this Cookbook. (Some seem rather outdated that we&#039;ll need to comb through, but we wanted to keep them around for now.)&lt;br /&gt;
&lt;br /&gt;
;[[Yocto_BSP_One-Stop_Shop_(Documentation_Overview,_Getting_Started,_FAQs,_and_more)|Everything you need to know to create and maintain a Yocto BSP]]&lt;br /&gt;
:TomZ&#039;s page on how to create and maintain a Yocto Project BSP, including how to interact with the community &lt;br /&gt;
&lt;br /&gt;
;[[Cookbook:Appliance:Startup_Scripts|Startup scripts]]&lt;br /&gt;
:How to get things to happen or start automatically:&lt;/div&gt;</summary>
		<author><name>L.S. Cook</name></author>
	</entry>
</feed>