<?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=Todor+Minchev</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=Todor+Minchev"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/Todor_Minchev"/>
	<updated>2026-11-05T01:23:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=29974</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=29974"/>
		<updated>2017-08-09T21:41:01Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Create image with new kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This article describes an efficient workflow for Linux kernel development using Yocto Project. The goal is to get the build, deploy and test cycle to under a minute. We will be working with the generix86-64 BSP and the Intel Minnowboard Turbot in this article but the process is the same for any platform and CPU architecture. &lt;br /&gt;
&lt;br /&gt;
The extensible SDK (eSDK) is a key part of this workflow for a number of reasons &lt;br /&gt;
# It contains the target toolchain which is not easily accessible in the bitbake environment&lt;br /&gt;
# It contains &#039;&#039;&#039;devtool&#039;&#039;&#039; which gives you an easy way of getting the kernel source your target is using (if using linux-yocto or linux-intel)&lt;br /&gt;
# devtool will also automatically create patches for your kernel updates and add them to the the kernel recipe&lt;br /&gt;
&lt;br /&gt;
There are two separate steps to this process&lt;br /&gt;
# Build or download an eSDK for your platform&lt;br /&gt;
# Install and use that eSDK to build your kernel&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK ==&lt;br /&gt;
Open a new terminal window, we&#039;ll refer to this terminal as your &#039;&#039;&#039;bitbake terminal&#039;&#039;&#039;. First we&#039;ll checkout poky and configure bitbake environment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ git clone -b pyro git://git.yoctoproject.org/poky &lt;br /&gt;
 $ source poky/oe-init-build-env&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we need to do some configuration for the Minnowboard image. &lt;br /&gt;
* Set MACHINE (as default is qemux86)&lt;br /&gt;
* Enable kernel modules (disabled by default for minimal images)&lt;br /&gt;
Add the following to conf/local.conf&lt;br /&gt;
 MACHINE = &amp;quot;genericx86-64&amp;quot;&lt;br /&gt;
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += &amp;quot;kernel-modules&amp;quot;&lt;br /&gt;
We also need to create a layer to take the kernel patches we&#039;ll be creating.  Be sure to create example recipe and append files when you run you run the &amp;quot;yocto-layer&amp;quot; command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ yocto-layer create my-kernel -o ../meta-my-kernel&lt;br /&gt;
 Please enter the layer priority you&#039;d like to use for the layer: [default: 6] &lt;br /&gt;
 Would you like to have an example recipe created? (y/n) [default: n] y&lt;br /&gt;
 Please enter the name you&#039;d like to use for your example recipe: [default: example] &lt;br /&gt;
 Would you like to have an example bbappend file created? (y/n) [default: n] y&lt;br /&gt;
 Please enter the name you&#039;d like to use for your bbappend file: [default: example] &lt;br /&gt;
 Please enter the version number you&#039;d like to use for your bbappend file (this should match the recipe you&#039;re appending to): [default: 0.1] &lt;br /&gt;
&lt;br /&gt;
 New layer created in ../meta-my-kernel.&lt;br /&gt;
&lt;br /&gt;
 Don&#039;t forget to add it to your BBLAYERS (for details see ../meta-my-kernel/README).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As directed, we need to add our layer to BBLAYERS as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ bitbake-layers add-layer ../meta-my-kernel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now build an extensible SDK installer for the Minnowboard in the bitbake terminal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ bitbake core-image-minimal -c populate_sdk_ext &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The eSDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you are not using a yocto-linux kernel, you can use a prebuilt eSDK installer that includes the toolchain you need. For example, the pyro core-image-minimal esdk release for core2-64 is located [[http://downloads.yoctoproject.org/releases/yocto/yocto-2.3.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh here]]. If you downloaded the installer, make it executable.&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK ==&lt;br /&gt;
Run the installer as follows. If you do not want to use the default ~/poky_sdk directory for installation of the toolchain, use the -d option to specify a destination.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh&lt;br /&gt;
Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.3.1&lt;br /&gt;
============================================================================&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/scottrif/poky_sdk&amp;quot;. Proceed[Y/n]? Y&lt;br /&gt;
Extracting SDK......................................done&lt;br /&gt;
Setting it up...&lt;br /&gt;
Extracting buildtools...&lt;br /&gt;
Preparing build system...&lt;br /&gt;
Parsing recipes: 100% |#########################################################################################################| Time: 0:00:52&lt;br /&gt;
Initialising tasks: 100% |######################################################################################################| Time: 0:00:04&lt;br /&gt;
Checking sstate mirror object availability: 100% |##############################################################################| Time: 0:00:00&lt;br /&gt;
Parsing recipes: 100% |#########################################################################################################| Time: 0:00:33&lt;br /&gt;
Initialising tasks: 100% |######################################################################################################| Time: 0:00:00&lt;br /&gt;
done&lt;br /&gt;
SDK has been successfully set up and is ready to be used.&lt;br /&gt;
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.&lt;br /&gt;
 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Take note of the final line, which shows you the environment setup script you must run each time you want to use the eSDK.&lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&#039;&#039;&#039;YOU MUST OPEN A NEW TERMINAL WHEN USING THE ESDK. DO NOT RE-USE YOUR BITBAKE TERMINAL.&#039;&#039;&#039;&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;. Run the setup script given by the installer.&lt;br /&gt;
 $ source /path/to/esdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
 &amp;quot;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;
If you see this&lt;br /&gt;
 WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a &lt;br /&gt;
 new shell session instead.&amp;quot;&lt;br /&gt;
You didn&#039;t open a new terminal!&lt;br /&gt;
&lt;br /&gt;
== Build initial image with ESDK ==&lt;br /&gt;
In the ESDK terminal, build the image&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ devtool build-image&lt;br /&gt;
Parsing recipes: 100% |##########################################| Time: 0:00:05&lt;br /&gt;
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
WARNING: No packages to add, building image core-image-minimal unmodified&lt;br /&gt;
Loading cache: 100% |############################################| Time: 0:00:00&lt;br /&gt;
Loaded 1299 entries from dependency cache.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
Initialising tasks: 100% |#######################################| Time: 0:00:07&lt;br /&gt;
Checking sstate mirror object availability: 100% |###############| Time: 0:00:00&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 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/esdk/tmp/deploy/images/genericx86-64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now flash to image to USB stick, assuming USB stick is on /dev/sdd&lt;br /&gt;
 $ sudo dd if=tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.wic of=/dev/sdd bs=1MB&lt;br /&gt;
 $ sync&lt;br /&gt;
Boot the Minnowboard with this image and check to be sure that everything is OK.&lt;br /&gt;
&lt;br /&gt;
== Working with Yocto kernel ==&lt;br /&gt;
=== Checkout kernel source ===&lt;br /&gt;
First we must use devtool to checkout the kernel source code in its workspace. Do the following in the ESDK terminal. Note that we use the virtual kernel provider so we don&#039;t need to know the kernel recipe name. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ devtool modify virtual/kernel&lt;br /&gt;
Loading cache: 100% |########################################################################################################################| Time: 0:00:00&lt;br /&gt;
Loaded 1300 entries from dependency cache.&lt;br /&gt;
NOTE: Mapping virtual/kernel to linux-yocto&lt;br /&gt;
Loading cache: 100% |########################################################################################################################| Time: 0:00:00&lt;br /&gt;
Loaded 1300 entries from dependency cache.&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_fetch...&lt;br /&gt;
NOTE: Executing do_unpack...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_kernel_checkout...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 3 tasks of which 2 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Patching...&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_validate_branches...&lt;br /&gt;
NOTE: Executing do_kernel_metadata...&lt;br /&gt;
NOTE: Executing do_patch...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 6 tasks of which 3 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Generating kernel config&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_kernel_configme...&lt;br /&gt;
NOTE: Executing do_prepare_recipe_sysroot...&lt;br /&gt;
NOTE: Executing do_configure...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 9 tasks of which 6 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Copying kernel config to srctree&lt;br /&gt;
NOTE: Source tree extracted to /home/scottrif/poky_sdk/workspace/sources/linux-yocto&lt;br /&gt;
NOTE: Recipe linux-yocto now set up to build from /home/scottrif/poky_sdk/workspace/sources/linux-yocto&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a bug that may cause error messages such as the following to be displayed. These can be ignored, the source code will be correct checked out.&lt;br /&gt;
 ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus be3a89ce7c47178880ba7bf6293d7404 for /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack&lt;br /&gt;
&lt;br /&gt;
=== Edit and build driver ===&lt;br /&gt;
Kernel source will be in the location shown at end of the &amp;lt;tt&amp;gt;devtool modify virtual/kernel&amp;lt;/tt&amp;gt; output. Let&#039;s make a trivial change to the serial driver in drivers/tty/serial/8250/8250_core.c. After the line&lt;br /&gt;
 pr_info(&amp;quot;Serial: 8250/16550 driver, %d ports, IRQ sharing %sabled\n&amp;quot;,&lt;br /&gt;
          nr_uarts, share_irqs ? &amp;quot;en&amp;quot; : &amp;quot;dis&amp;quot;);&lt;br /&gt;
Add the line&lt;br /&gt;
 pr_info(&amp;quot;Serial: 8250/16550 driver modified with eSDK&amp;quot;);&lt;br /&gt;
To build the updated kernel source, in the SDK terminal run make in your kernel source folder. Adjust the -j option to match number of cores on your workstation.&lt;br /&gt;
 $ make -C workspace/sources/linux-yocto -j4&lt;br /&gt;
=== Create image with new kernel ===&lt;br /&gt;
Normally you&#039;d make a new image with &amp;lt;tt&amp;gt;devtool build-image&amp;lt;/tt&amp;gt; but this can take a minute or so and messes with the kernel source folder. A faster option is to use kpartx to splice the new kernel into the image you have already built. If your build system does not have kpartx installed, be sure you install it.&lt;br /&gt;
&lt;br /&gt;
First make a copy of your wic file in say /tmp&lt;br /&gt;
 $ cp tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.wic /tmp&lt;br /&gt;
Then create loopback devices for each partition in wic file. &lt;br /&gt;
NOTE: The first unused loopback device (loopX) will be automatically allocated e.g loop3.&lt;br /&gt;
 $ sudo kpartx -v -a /tmp/core-image-minimal-genericx86-64.wic&lt;br /&gt;
 add map loopXp1 (253:6): 0 47446 linear /dev/loopX 2048&lt;br /&gt;
 add map loopXp2 (253:7): 0 119356 linear /dev/loopX 51200&lt;br /&gt;
 add map loopXp3 (253:8): 0 90112 linear /dev/loopX 170556&lt;br /&gt;
Kernel is in the first device, so let&#039;s mount /dev/mapper/loopXp1 to take a look&lt;br /&gt;
NOTE: Replace loopXp1 with the automatically allocated loopback device e.g loop3p1.&lt;br /&gt;
 $ sudo mkdir /mnt/wic-p1&lt;br /&gt;
 $ sudo mount /dev/mapper/loopXp1 /mnt/wic-p1&lt;br /&gt;
Now copy over new kernel&lt;br /&gt;
 $ sudo cp workspace/sources/linux-yocto/arch/x86/boot/bzImage /mnt/wic-p1&lt;br /&gt;
Then unmount and unkpartx...&lt;br /&gt;
NOTE: Replace loopX with the automatically allocated loopback device e.g loop3.&lt;br /&gt;
 $ sudo umount /mnt/wic-p1&lt;br /&gt;
 $ sudo kpartx -d /dev/loopX&lt;br /&gt;
Now flash image&lt;br /&gt;
 $ dd if=/tmp/core-image-minimal-genericx86-64.wic of=/dev/sdd bs=1MB&lt;br /&gt;
 $ sync&lt;br /&gt;
Boot Minnowboard, log on and look in log for driver message&lt;br /&gt;
 # root@genericx86-64:~# dmesg | grep Serial:&lt;br /&gt;
 Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
 Serial: 8250/16550 driver modified with eSDK&lt;br /&gt;
It worked!&lt;br /&gt;
&lt;br /&gt;
=== Export patches and create a bbappend file ===&lt;br /&gt;
To export your commits as patches and a bbappend file use the following command in the ESDK terminal. We&#039;ll target the &amp;quot;my-kernel&amp;quot; layer we created in the bitbake terminal &lt;br /&gt;
 $ devtool finish linux-yocto /path/to/meta-my-kernel&lt;br /&gt;
The patches and the bbappend can be found in /path/to/meta-my-kernel/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Working with upstream kernel ==&lt;br /&gt;
Slightly different workflow where we use a kernel from kernel.org.&lt;br /&gt;
&lt;br /&gt;
Content TBD&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel ==&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
Execute the following command from your build directory in the bitbake terminal&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=29972</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=29972"/>
		<updated>2017-08-09T21:39:07Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Create image with new kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
This article describes an efficient workflow for Linux kernel development using Yocto Project. The goal is to get the build, deploy and test cycle to under a minute. We will be working with the generix86-64 BSP and the Intel Minnowboard Turbot in this article but the process is the same for any platform and CPU architecture. &lt;br /&gt;
&lt;br /&gt;
The extensible SDK (eSDK) is a key part of this workflow for a number of reasons &lt;br /&gt;
# It contains the target toolchain which is not easily accessible in the bitbake environment&lt;br /&gt;
# It contains &#039;&#039;&#039;devtool&#039;&#039;&#039; which gives you an easy way of getting the kernel source your target is using (if using linux-yocto or linux-intel)&lt;br /&gt;
# devtool will also automatically create patches for your kernel updates and add them to the the kernel recipe&lt;br /&gt;
&lt;br /&gt;
There are two separate steps to this process&lt;br /&gt;
# Build or download an eSDK for your platform&lt;br /&gt;
# Install and use that eSDK to build your kernel&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK ==&lt;br /&gt;
Open a new terminal window, we&#039;ll refer to this terminal as your &#039;&#039;&#039;bitbake terminal&#039;&#039;&#039;. First we&#039;ll checkout poky and configure bitbake environment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ git clone -b pyro git://git.yoctoproject.org/poky &lt;br /&gt;
 $ source poky/oe-init-build-env&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now we need to do some configuration for the Minnowboard image. &lt;br /&gt;
* Set MACHINE (as default is qemux86)&lt;br /&gt;
* Enable kernel modules (disabled by default for minimal images)&lt;br /&gt;
Add the following to conf/local.conf&lt;br /&gt;
 MACHINE = &amp;quot;genericx86-64&amp;quot;&lt;br /&gt;
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += &amp;quot;kernel-modules&amp;quot;&lt;br /&gt;
We also need to create a layer to take the kernel patches we&#039;ll be creating.  Be sure to create example recipe and append files when you run you run the &amp;quot;yocto-layer&amp;quot; command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ yocto-layer create my-kernel -o ../meta-my-kernel&lt;br /&gt;
 Please enter the layer priority you&#039;d like to use for the layer: [default: 6] &lt;br /&gt;
 Would you like to have an example recipe created? (y/n) [default: n] y&lt;br /&gt;
 Please enter the name you&#039;d like to use for your example recipe: [default: example] &lt;br /&gt;
 Would you like to have an example bbappend file created? (y/n) [default: n] y&lt;br /&gt;
 Please enter the name you&#039;d like to use for your bbappend file: [default: example] &lt;br /&gt;
 Please enter the version number you&#039;d like to use for your bbappend file (this should match the recipe you&#039;re appending to): [default: 0.1] &lt;br /&gt;
&lt;br /&gt;
 New layer created in ../meta-my-kernel.&lt;br /&gt;
&lt;br /&gt;
 Don&#039;t forget to add it to your BBLAYERS (for details see ../meta-my-kernel/README).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As directed, we need to add our layer to BBLAYERS as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ bitbake-layers add-layer ../meta-my-kernel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now build an extensible SDK installer for the Minnowboard in the bitbake terminal&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ bitbake core-image-minimal -c populate_sdk_ext &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The eSDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you are not using a yocto-linux kernel, you can use a prebuilt eSDK installer that includes the toolchain you need. For example, the pyro core-image-minimal esdk release for core2-64 is located [[http://downloads.yoctoproject.org/releases/yocto/yocto-2.3.1/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh here]]. If you downloaded the installer, make it executable.&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK ==&lt;br /&gt;
Run the installer as follows. If you do not want to use the default ~/poky_sdk directory for installation of the toolchain, use the -d option to specify a destination.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.1.sh&lt;br /&gt;
Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.3.1&lt;br /&gt;
============================================================================&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/scottrif/poky_sdk&amp;quot;. Proceed[Y/n]? Y&lt;br /&gt;
Extracting SDK......................................done&lt;br /&gt;
Setting it up...&lt;br /&gt;
Extracting buildtools...&lt;br /&gt;
Preparing build system...&lt;br /&gt;
Parsing recipes: 100% |#########################################################################################################| Time: 0:00:52&lt;br /&gt;
Initialising tasks: 100% |######################################################################################################| Time: 0:00:04&lt;br /&gt;
Checking sstate mirror object availability: 100% |##############################################################################| Time: 0:00:00&lt;br /&gt;
Parsing recipes: 100% |#########################################################################################################| Time: 0:00:33&lt;br /&gt;
Initialising tasks: 100% |######################################################################################################| Time: 0:00:00&lt;br /&gt;
done&lt;br /&gt;
SDK has been successfully set up and is ready to be used.&lt;br /&gt;
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.&lt;br /&gt;
 $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Take note of the final line, which shows you the environment setup script you must run each time you want to use the eSDK.&lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&#039;&#039;&#039;YOU MUST OPEN A NEW TERMINAL WHEN USING THE ESDK. DO NOT RE-USE YOUR BITBAKE TERMINAL.&#039;&#039;&#039;&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;. Run the setup script given by the installer.&lt;br /&gt;
 $ source /path/to/esdk/environment-setup-core2-64-poky-linux&lt;br /&gt;
 &amp;quot;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;
If you see this&lt;br /&gt;
 WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a &lt;br /&gt;
 new shell session instead.&amp;quot;&lt;br /&gt;
You didn&#039;t open a new terminal!&lt;br /&gt;
&lt;br /&gt;
== Build initial image with ESDK ==&lt;br /&gt;
In the ESDK terminal, build the image&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ devtool build-image&lt;br /&gt;
Parsing recipes: 100% |##########################################| Time: 0:00:05&lt;br /&gt;
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors.&lt;br /&gt;
WARNING: No packages to add, building image core-image-minimal unmodified&lt;br /&gt;
Loading cache: 100% |############################################| Time: 0:00:00&lt;br /&gt;
Loaded 1299 entries from dependency cache.&lt;br /&gt;
NOTE: Resolving any missing task queue dependencies&lt;br /&gt;
Initialising tasks: 100% |#######################################| Time: 0:00:07&lt;br /&gt;
Checking sstate mirror object availability: 100% |###############| Time: 0:00:00&lt;br /&gt;
NOTE: Executing SetScene Tasks&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 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/esdk/tmp/deploy/images/genericx86-64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now flash to image to USB stick, assuming USB stick is on /dev/sdd&lt;br /&gt;
 $ sudo dd if=tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.wic of=/dev/sdd bs=1MB&lt;br /&gt;
 $ sync&lt;br /&gt;
Boot the Minnowboard with this image and check to be sure that everything is OK.&lt;br /&gt;
&lt;br /&gt;
== Working with Yocto kernel ==&lt;br /&gt;
=== Checkout kernel source ===&lt;br /&gt;
First we must use devtool to checkout the kernel source code in its workspace. Do the following in the ESDK terminal. Note that we use the virtual kernel provider so we don&#039;t need to know the kernel recipe name. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ devtool modify virtual/kernel&lt;br /&gt;
Loading cache: 100% |########################################################################################################################| Time: 0:00:00&lt;br /&gt;
Loaded 1300 entries from dependency cache.&lt;br /&gt;
NOTE: Mapping virtual/kernel to linux-yocto&lt;br /&gt;
Loading cache: 100% |########################################################################################################################| Time: 0:00:00&lt;br /&gt;
Loaded 1300 entries from dependency cache.&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_fetch...&lt;br /&gt;
NOTE: Executing do_unpack...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_kernel_checkout...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 3 tasks of which 2 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Patching...&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_validate_branches...&lt;br /&gt;
NOTE: Executing do_kernel_metadata...&lt;br /&gt;
NOTE: Executing do_patch...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 6 tasks of which 3 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Generating kernel config&lt;br /&gt;
NOTE: Executing RunQueue Tasks&lt;br /&gt;
NOTE: Executing do_kernel_configme...&lt;br /&gt;
NOTE: Executing do_prepare_recipe_sysroot...&lt;br /&gt;
NOTE: Executing do_configure...&lt;br /&gt;
NOTE: Tasks Summary: Attempted 9 tasks of which 6 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
NOTE: Copying kernel config to srctree&lt;br /&gt;
NOTE: Source tree extracted to /home/scottrif/poky_sdk/workspace/sources/linux-yocto&lt;br /&gt;
NOTE: Recipe linux-yocto now set up to build from /home/scottrif/poky_sdk/workspace/sources/linux-yocto&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a bug that may cause error messages such as the following to be displayed. These can be ignored, the source code will be correct checked out.&lt;br /&gt;
 ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus be3a89ce7c47178880ba7bf6293d7404 for /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack&lt;br /&gt;
&lt;br /&gt;
=== Edit and build driver ===&lt;br /&gt;
Kernel source will be in the location shown at end of the &amp;lt;tt&amp;gt;devtool modify virtual/kernel&amp;lt;/tt&amp;gt; output. Let&#039;s make a trivial change to the serial driver in drivers/tty/serial/8250/8250_core.c. After the line&lt;br /&gt;
 pr_info(&amp;quot;Serial: 8250/16550 driver, %d ports, IRQ sharing %sabled\n&amp;quot;,&lt;br /&gt;
          nr_uarts, share_irqs ? &amp;quot;en&amp;quot; : &amp;quot;dis&amp;quot;);&lt;br /&gt;
Add the line&lt;br /&gt;
 pr_info(&amp;quot;Serial: 8250/16550 driver modified with eSDK&amp;quot;);&lt;br /&gt;
To build the updated kernel source, in the SDK terminal run make in your kernel source folder. Adjust the -j option to match number of cores on your workstation.&lt;br /&gt;
 $ make -C workspace/sources/linux-yocto -j4&lt;br /&gt;
=== Create image with new kernel ===&lt;br /&gt;
Normally you&#039;d make a new image with &amp;lt;tt&amp;gt;devtool build-image&amp;lt;/tt&amp;gt; but this can take a minute or so and messes with the kernel source folder. A faster option is to use kpartx to splice the new kernel into the image you have already built. First make a copy of your wic file in say /tmp&lt;br /&gt;
 $ cp tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.wic /tmp&lt;br /&gt;
Then create loopback devices for each partition in wic file. &lt;br /&gt;
NOTE: The first unused loopback device (loopX) will be automatically allocated e.g loop3.&lt;br /&gt;
 $ sudo kpartx -v -a /tmp/core-image-minimal-genericx86-64.wic&lt;br /&gt;
 add map loopXp1 (253:6): 0 47446 linear /dev/loopX 2048&lt;br /&gt;
 add map loopXp2 (253:7): 0 119356 linear /dev/loopX 51200&lt;br /&gt;
 add map loopXp3 (253:8): 0 90112 linear /dev/loopX 170556&lt;br /&gt;
Kernel is in the first device, so let&#039;s mount /dev/mapper/loopXp1 to take a look&lt;br /&gt;
 $ sudo mkdir /mnt/wic-p1&lt;br /&gt;
 $ sudo mount /dev/mapper/loopXp1 /mnt/wic-p1&lt;br /&gt;
Now copy over new kernel&lt;br /&gt;
 $ sudo cp workspace/sources/linux-yocto/arch/x86/boot/bzImage /mnt/wic-p1&lt;br /&gt;
Then unmount and unkpartx...&lt;br /&gt;
 $ sudo umount /mnt/wic-p1&lt;br /&gt;
 $ sudo kpartx -d /dev/loopX&lt;br /&gt;
Now flash image&lt;br /&gt;
 $ dd if=/tmp/core-image-minimal-genericx86-64.wic of=/dev/sdd bs=1MB&lt;br /&gt;
 $ sync&lt;br /&gt;
Boot Minnowboard, log on and look in log for driver message&lt;br /&gt;
 # root@genericx86-64:~# dmesg | grep Serial:&lt;br /&gt;
 Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled&lt;br /&gt;
 Serial: 8250/16550 driver modified with eSDK&lt;br /&gt;
It worked!&lt;br /&gt;
&lt;br /&gt;
=== Export patches and create a bbappend file ===&lt;br /&gt;
To export your commits as patches and a bbappend file use the following command in the ESDK terminal. We&#039;ll target the &amp;quot;my-kernel&amp;quot; layer we created in the bitbake terminal &lt;br /&gt;
 $ devtool finish linux-yocto /path/to/meta-my-kernel&lt;br /&gt;
The patches and the bbappend can be found in /path/to/meta-my-kernel/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Working with upstream kernel ==&lt;br /&gt;
Slightly different workflow where we use a kernel from kernel.org.&lt;br /&gt;
&lt;br /&gt;
Content TBD&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel ==&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
Execute the following command from your build directory in the bitbake terminal&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29200</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29200"/>
		<updated>2017-07-26T21:12:51Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Configuring It */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What &amp;amp; Why ==&lt;br /&gt;
Clear containers (CC) offer a hybrid solution that encompasses the advantages of hypervisor security and container deployment.  So, we wanted to see if they could be used in a YP environment. This was done for Clear Containers 2.2 based on YP master around the time of 2.4 RC1/2.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Note: this is a Proof of Concept, done by building on target. The eventual goal would be to create a standard recipe to allow the clear containers to be built in the standard way. &amp;lt;/strong&amp;gt; Hopefully, this guide will help with that by outlining the parts, dependencies, and configuration steps. This guide assumes you already have docker running on your target by having followed [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ].  The target example is being done with an Intel Nuc. I have successfully run the same code on a Minnowboard Turbot.&lt;br /&gt;
&lt;br /&gt;
== Dependencies you need ==&lt;br /&gt;
=== Layers ===&lt;br /&gt;
The layers I am using:&lt;br /&gt;
 meta-openembedded/meta-oe                                                                               &lt;br /&gt;
 meta-openembedded/meta-python                                                                                 &lt;br /&gt;
 meta-openembedded/meta-networking                                                                      &lt;br /&gt;
 meta-openembedded/meta-filesystems                                                                            &lt;br /&gt;
 meta-virtualization                                                                                          &lt;br /&gt;
 meta-clear&lt;br /&gt;
&lt;br /&gt;
All of these layers can be found on [https://layers.openembedded.org/layerindex/branch/master/layers/ layer.openembedded.org] except the meta-clear. The meta-clear layer was created with the script yocto-layer. It&#039;s only purpose is to turn on CONFIG_VHOST_NET=m for the kernel.  Here&#039;s a tree of the layer:&lt;br /&gt;
 &lt;br /&gt;
 ├── conf&lt;br /&gt;
 │  └── layer.conf&lt;br /&gt;
 ├── COPYING.MIT&lt;br /&gt;
 ├── README&lt;br /&gt;
 └── recipes-kernel&lt;br /&gt;
    └── linux&lt;br /&gt;
        ├── linux-yocto&lt;br /&gt;
        │   ├── clear.cfg&lt;br /&gt;
        │   └── clear.scc&lt;br /&gt;
        ├── linux-yocto_4.10.bbappend&lt;br /&gt;
        └── linux-yocto_4.9.bbappend&lt;br /&gt;
&lt;br /&gt;
I am using the 4.9 kernel. Here&#039;s the linux-yocto_4.9.bbappend:&lt;br /&gt;
 FILESEXTRAPATHS_prepend := &amp;quot;${THISDIR}/${PN}:&amp;quot;&lt;br /&gt;
 SRC_URI += &amp;quot;file://clear.scc \&lt;br /&gt;
           &amp;quot;&lt;br /&gt;
 KERNEL_MODULE_AUTOLOAD += &amp;quot;vhost-net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The scc file:&lt;br /&gt;
 define KFEATURE_DESCRIPTION &amp;quot;Enable clearcon support&amp;quot;&lt;br /&gt;
 define KFEATURE_COMPATIBILITY board&lt;br /&gt;
 kconf non-hardware clear.cfg&lt;br /&gt;
&lt;br /&gt;
And finally the cfg file:&lt;br /&gt;
 CONFIG_VHOST_NET=m&lt;br /&gt;
&lt;br /&gt;
=== Conf Changes ===&lt;br /&gt;
This guide presumes you have the setup in your conf file described in  [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ]. In &amp;lt;strong&amp;gt;addition&amp;lt;/strong&amp;gt;, to make on target building easier, I add the following to my conf/local.conf:&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot; dev-pkgs tools-sdk tools-debug tools-profile   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Additional Dependencies to Bitbake ===&lt;br /&gt;
These are the additional recipes I built in addition to the base I outlined above.  They could be added all at once in the local.conf, if you want by doing a &lt;br /&gt;
 IMAGE_INSTALL_append += libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
These are additional packages I built for convenience, but they are not required:&lt;br /&gt;
 bitbake less zile ntp rsync minicom&lt;br /&gt;
Once built these can be installed on the board. Note that we need the dev pkgs as we are mostly completing build requirements for pieces of CC.&lt;br /&gt;
 dnf install tunctl python-dev python-setuptools-dev libcap-ng-dev libcheck-dev libmnl-dev libjson-glib-1.0-dev  autoconf-archive-dev libcap-ng-dev python-setuptools-dev go wget sudo&lt;br /&gt;
and the convenient ones:&lt;br /&gt;
 dnf install zile less ntp rsync minicom&lt;br /&gt;
&lt;br /&gt;
=== The Image to Build ===&lt;br /&gt;
 bitbake core-image--base&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Pieces of CC==&lt;br /&gt;
Clear Containers are comprised of a set of software and binaries. The main code is a slightly forked (2.9 currently) qemu hypervisor configured to be minimal, a command proxy, a shim, and the oci runtime.  The command proxy is written in go. The rest is c/c++.  We build the hypervisor itself, but the binaries for the hypervisor are downloaded from the CC site. &lt;br /&gt;
=== The Runtime,Shim &amp;amp; Proxy ===&lt;br /&gt;
This comes from [[https://github.com/01org/cc-oci-runtime clear oci runtime]].  While getting it to work, I followed the development model outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds Leveraging Rpm Package Feeds]. Here I will list the dependencies to make it shorter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Which Clear was this?&lt;br /&gt;
 cc-oci-runtime version: 2.2.0&lt;br /&gt;
 spec version: 1.0.0-rc1&lt;br /&gt;
 commit: f92d50ad54003298c139de59777f07588683cdc2&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
We will pretty much follow the (very good) instructions in the [https://github.com/01org/cc-oci-runtime README]. Because it is a go project we will follow the go flow...&lt;br /&gt;
 go get -d github.com/01org/cc-oci-runtime/...&lt;br /&gt;
The &amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt; is necessary.  If you are behind a proxy, make sure you export http_proxy and https_proxy into your shell.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will put the src in ~/go/src/github.com/01org/cc-oci-runtime/ by default.&lt;br /&gt;
&lt;br /&gt;
==== Building It ====&lt;br /&gt;
Again, following their  [https://github.com/01org/cc-oci-runtime README] do&lt;br /&gt;
 ./autogen.sh --disable-functional-tests&lt;br /&gt;
We disable functional tests because I was not able to easily find a recipe for BATS (Bash automated testing).&lt;br /&gt;
 make&lt;br /&gt;
The make install is quite clean and show where everything is going:&lt;br /&gt;
 # make install&lt;br /&gt;
 make[1]: Entering directory &#039;/home/root/go/src/github.com/01org/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-oci-runtime &#039;/usr/bin&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-oci-runtime /usr/bin/cc-oci-runtime&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
  /usr/bin/install -c data/cc-oci-runtime.sh &#039;/usr/bin&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-shim &#039;/usr/libexec&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-shim /usr/libexec/cc-shim&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
  /usr/bin/install -c cc-proxy &#039;/usr/libexec&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 data/vm.json data/hypervisor.args data/kernel-cmdline &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/lib/systemd/system&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 proxy/cc-proxy.service proxy/cc-proxy.socket &#039;/lib/systemd/system&#039;&lt;br /&gt;
==== Getting the Artifacts ====&lt;br /&gt;
We need a kernel and an image for the hypervisor. &lt;br /&gt;
* The kernel  comes from [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] For example, I used  release 16050 ~ June 2017. This can be found in the following rpm   [[https://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm kernel rpm 16050]]&lt;br /&gt;
* The image (rootfs) also comes from   [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] I again picked the [[https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
* Here&#039;s the commands to download the above and install it.&lt;br /&gt;
 wget http://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 wget https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz&lt;br /&gt;
 rpm --install ./linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 xz --decompress clear-16050-containers.img.xz &lt;br /&gt;
 cp clear-16050-containers.img /usr/share/clear-containers/&lt;br /&gt;
 pushd /usr/share/clear-containers/&lt;br /&gt;
 ln -s clear-16050-containers.img clear-containers.img&lt;br /&gt;
 popd&lt;br /&gt;
After this, you should have a /usr/share/clear-containers directory that looks like this:&lt;br /&gt;
 |-- clear-16050-containers.img&lt;br /&gt;
 |-- clear-containers.img -&amp;gt; clear-16050-containers.img&lt;br /&gt;
 |-- vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinux.container -&amp;gt; vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinuz-4.9.33-74.container&lt;br /&gt;
 `-- vmlinuz.container -&amp;gt; vmlinuz-4.9.33-74.container&lt;br /&gt;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
The configuration is located in /usr/share/defaults/cc-oci-runtime. There are 3 files. &lt;br /&gt;
*  vm.json defines which hypervisor, kernel and rootfs we use:&lt;br /&gt;
 {&lt;br /&gt;
        &amp;quot;vm&amp;quot;: {&lt;br /&gt;
                &amp;quot;path&amp;quot;: &amp;quot;/usr/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
                &amp;quot;image&amp;quot;: &amp;quot;/usr/share/clear-containers/clear-containers.img&amp;quot;,&lt;br /&gt;
                &amp;quot;kernel&amp;quot;: {&lt;br /&gt;
                        &amp;quot;path&amp;quot;: &amp;quot;/usr/share/clear-containers/vmlinux.container&amp;quot;,&lt;br /&gt;
                        &amp;quot;parameters&amp;quot;: &amp;quot;root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check &lt;br /&gt;
 rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 &lt;br /&gt;
 initcall_debug init=/usr/lib/systemd/systemd systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service &lt;br /&gt;
 systemd.mask=systemd-networkd.socket systemd.show_status=false cryptomgr.notests net.ifnames=0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
* kernel-cmdline is  well, the kernel command line&lt;br /&gt;
 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 &lt;br /&gt;
 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug init=/usr/lib/systemd/systemd &lt;br /&gt;
 systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket &lt;br /&gt;
 systemd.show_status=false cryptomgr.notests net.ifnames=0&lt;br /&gt;
* hypervisor.args defines how we start up the qemu hypervisor&lt;br /&gt;
 /usr/bin/qemu-system-x86_64&lt;br /&gt;
 -name&lt;br /&gt;
 @NAME@&lt;br /&gt;
 -machine&lt;br /&gt;
 pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 -device&lt;br /&gt;
 nvdimm,memdev=mem0,id=nv0&lt;br /&gt;
 -object&lt;br /&gt;
 memory-backend-file,id=mem0,mem-path=@IMAGE@,size=@SIZE@&lt;br /&gt;
 -m&lt;br /&gt;
 2G,slots=2,maxmem=3G&lt;br /&gt;
 -kernel&lt;br /&gt;
 @KERNEL@&lt;br /&gt;
 -append&lt;br /&gt;
 @KERNEL_PARAMS@ @KERNEL_NET_PARAMS@&lt;br /&gt;
 -smp&lt;br /&gt;
 2,sockets=1,cores=2,threads=1&lt;br /&gt;
 -cpu&lt;br /&gt;
 host&lt;br /&gt;
&lt;br /&gt;
This is the file we need to change to accommodate our small memory availability on the Minnowboard Turbot (4 G total) . We are also using a newer qemu and machine type than the hypervisor.args file assumes. This helps to make the Atom processor happy. Here&#039;s the diff:&lt;br /&gt;
 # diff hypervisor.args.orig hypervisor.args&lt;br /&gt;
 5c5&lt;br /&gt;
 &amp;lt; pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; q35,accel=kvm,kernel_irqchip,nvdimm,nosmm,nosmbus,nosata,nopit,nofw&lt;br /&gt;
 11c11&lt;br /&gt;
 &amp;lt; 2G,slots=2,maxmem=3G&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; 256M,slots=2,maxmem=1G&lt;br /&gt;
&lt;br /&gt;
I capped it at 1G for now. This setting would definitely need to be tweaked depending on needs/usage...&lt;br /&gt;
&lt;br /&gt;
===The Qemu Hypervisor ===&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
 git clone https://github.com/clearcontainers/qemu qemu-cc&lt;br /&gt;
 cd qemu-cc&lt;br /&gt;
 git checkout -b qemu-lite-v2.9.0 origin/qemu-lite-v2.9.0&lt;br /&gt;
 &lt;br /&gt;
==== Building It ====&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 ../configure &#039;--prefix=/usr&#039; &#039;--disable-tools&#039; &#039;--disable-libssh2&#039; &#039;--disable-tcmalloc&#039; &#039;--disable-glusterfs&#039; &#039;--disable-seccomp&#039; &#039;--disable-bzip2&#039; &#039;--disable-snappy&#039; &#039;--disable-lzo&#039; &#039;--disable-usb-redir&#039; &#039;--disable-libusb&#039; &#039;--disable-libnfs&#039; &#039;--disable-tcg-interpreter&#039; &#039;--disable-debug-tcg&#039; &#039;--disable-libiscsi&#039; &#039;--disable-rbd&#039; &#039;--disable-spice&#039; &#039;--disable-attr&#039; &#039;--disable-cap-ng&#039; &#039;--disable-linux-aio&#039; &#039;--disable-brlapi&#039; &#039;--disable-vnc-jpeg&#039; &#039;--disable-vnc-png&#039; &#039;--disable-vnc-sasl&#039; &#039;--disable-rdma&#039; &#039;--disable-bluez&#039; &#039;--disable-fdt&#039; &#039;--disable-curl&#039; &#039;--disable-curses&#039; &#039;--disable-sdl&#039; &#039;--disable-gtk&#039; &#039;--disable-tpm&#039; &#039;--disable-vte&#039; &#039;--disable-vnc&#039; &#039;--disable-xen&#039; &#039;--disable-opengl&#039; &#039;--disable-slirp&#039; &#039;--enable-trace-backend=nop&#039; &#039;--enable-virtfs&#039; &#039;--enable-attr&#039; &#039;--enable-cap-ng&#039; &#039;--extra-cflags=-Wno-format-truncation&#039; &#039;--target-list=x86_64-softmmu&#039; &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
In order to build it with gcc-7 (current YP compiler which is ahead of most/all std distros, I needed to &amp;lt;strong&amp;gt; HACK &amp;lt;/strong&amp;gt; the following files:&lt;br /&gt;
       modified:   ../block/blkdebug.c&lt;br /&gt;
       modified:   ../block/blkverify.c&lt;br /&gt;
       modified:   ../hw/usb/bus.c&lt;br /&gt;
Here are the individual diffs:&lt;br /&gt;
* block/blkdebug.c&lt;br /&gt;
 diff --git a/block/blkdebug.c b/block/blkdebug.c&lt;br /&gt;
 index 67e8024e36..e3ab19b947 100644&lt;br /&gt;
 --- a/block/blkdebug.c&lt;br /&gt;
 +++ b/block/blkdebug.c&lt;br /&gt;
 @@ -668,7 +668,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)&lt;br /&gt;
 &lt;br /&gt;
 static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
 {&lt;br /&gt;
 -    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
 +//    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
     QDict *opts;&lt;br /&gt;
     const QDictEntry *e;&lt;br /&gt;
     bool force_json = false;&lt;br /&gt;
 @@ -688,11 +688,13 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0&lt;br /&gt;
     if (!force_json &amp;amp;&amp;amp; bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]) {&lt;br /&gt;
         snprintf(bs-&amp;gt;exact_filename, sizeof(bs-&amp;gt;exact_filename),&lt;br /&gt;
                  &amp;quot;blkdebug:%s:%s&amp;quot;, s-&amp;gt;config_file ?: &amp;quot;&amp;quot;,&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }&lt;br /&gt;
 +#endif&lt;br /&gt;
 &lt;br /&gt;
     opts = qdict_new();&lt;br /&gt;
     qdict_put_obj(opts, &amp;quot;driver&amp;quot;, QOBJECT(qstring_from_str(&amp;quot;blkdebug&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
* block/blkverify.c&lt;br /&gt;
 diff --git a/block/blkverify.c b/block/blkverify.c&lt;br /&gt;
 index 9a1e21c6ad..aa5d5ccdad 100644&lt;br /&gt;
 --- a/block/blkverify.c&lt;br /&gt;
 +++ b/block/blkverify.c&lt;br /&gt;
 @@ -302,6 +302,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         bs-&amp;gt;full_open_options = opts;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0  &lt;br /&gt;
     if (bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]&lt;br /&gt;
         &amp;amp;&amp;amp; s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename[0])&lt;br /&gt;
     {&lt;br /&gt;
 @@ -310,6 +311,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename,&lt;br /&gt;
                  s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }  &lt;br /&gt;
 +#endif&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static BlockDriver bdrv_blkverify = {&lt;br /&gt;
&lt;br /&gt;
* hw/usb/bus.c&lt;br /&gt;
 diff --git a/hw/usb/bus.c b/hw/usb/bus.c&lt;br /&gt;
 index 24f1608b4b..2f2abc1824 100644&lt;br /&gt;
 --- a/hw/usb/bus.c&lt;br /&gt;
 +++ b/hw/usb/bus.c&lt;br /&gt;
 @@ -407,8 +407,8 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],&lt;br /&gt;
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)&lt;br /&gt;
 {&lt;br /&gt;
     if (upstream) {&lt;br /&gt;
 -        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 -                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
 +//        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 +//                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
         downstream-&amp;gt;hubcount = upstream-&amp;gt;hubcount + 1;&lt;br /&gt;
     } else {&lt;br /&gt;
         snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%d&amp;quot;, portnr);&lt;br /&gt;
&lt;br /&gt;
I verified with fprintf(stderr....) that these are not hit in typical usage. I also expect they will be upstream patched soon.  &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
Now we can do:&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 # qemu-system-x86_64 -machine help| grep q35&lt;br /&gt;
 q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.9)&lt;br /&gt;
 pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
&lt;br /&gt;
The last line shows we can run qemu and have the machine available.&lt;br /&gt;
&lt;br /&gt;
== Running Clear Containers ==&lt;br /&gt;
You will need a couple of logins onto the target. &lt;br /&gt;
=== More configuration ===&lt;br /&gt;
We have the CC runtime, now we need to let docker know about it. We change the startup of the docker systemd service to know about the new cor runtime and we also turn on debugging. Note, for faster performance, we would drop the -D and do &amp;lt;code&amp;gt; --add-runtime cor=/usr/bin/cc-oci-runtime&amp;lt;/code&amp;gt; the .sh script is a clever interceptor that let&#039;s us turn on additional debugging features in case we need to.  &lt;br /&gt;
 &lt;br /&gt;
# diff /lib/systemd/system/docker.service ~/docker.service &lt;br /&gt;
 12c12&lt;br /&gt;
 &amp;lt; ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime.sh -H fd://&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ExecStart=/usr/bin/dockerd -H fd://&lt;br /&gt;
&lt;br /&gt;
Once the systemd service has been modified, you need to tell systemd to reload, and then restart docker&lt;br /&gt;
 # systemctl daemon-reload   &lt;br /&gt;
 # systemctl  stop docker&lt;br /&gt;
 # systemctl  start docker&lt;br /&gt;
&lt;br /&gt;
=== The Proxy ===&lt;br /&gt;
* by hand:&lt;br /&gt;
 /usr/libexec/cc-proxy -v 3&lt;br /&gt;
This will show the connections and is quite reassuring early.   This can also be run using the systemd service that got installed while building the runtime.&lt;br /&gt;
 # ls /lib/systemd/system/cc-proxy.s*&lt;br /&gt;
 /lib/systemd/system/cc-proxy.service  /lib/systemd/system/cc-proxy.socket&lt;br /&gt;
=== A Container ===&lt;br /&gt;
Now all the pieces are in place for the big finale. This will run a &amp;quot;normal&amp;quot; docker container&lt;br /&gt;
 # docker run -it --rm busybox sh&lt;br /&gt;
and &lt;br /&gt;
 # ps augxww | grep qemu &lt;br /&gt;
should be empty.&lt;br /&gt;
Now, let&#039;s run a Clear Container:&lt;br /&gt;
 # docker run -it --rm --runtime cor busybox sh                                               &lt;br /&gt;
 / # &lt;br /&gt;
This is the success we&#039;ve been aiming for all along!!! Yay! &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do we know it worked?&lt;br /&gt;
* ps This will show us a qemu instance running:&lt;br /&gt;
 #ps augxww | grep qemu&lt;br /&gt;
 root     10192  0.7  0.9 716620 73864 ?        Ssl  18:00   0:00 /usr/local/bin/qemu-system-x86_64 -name 0966e97e19a2 -machine &lt;br /&gt;
 q35,accel=kvm,kernel_irqchip,nvdimm ..... and much more ....&lt;br /&gt;
* our proxy will have some nifty information, here&#039;s a snippet:&lt;br /&gt;
 I0708 18:00:35.512724   10139 vm.go:114] [vm e9276e31 hyperstart] hyper_channel_read&lt;br /&gt;
 I0708 18:00:35.512813   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.512933   10139 vm.go:114] [vm e9276e31 hyperstart] get length 41&lt;br /&gt;
 I0708 18:00:35.513016   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.513148   10139 vm.go:114] [vm e9276e31 hyperstart] 0 0 0 b 0 0 0 29 7b 22 73 65 71 22 3a 31 2c 20 &lt;br /&gt;
 22 72 6f 77 22 3a 34 38 2c 20 22 63 6f 6c 75 6d 6e 22 3a 31 31 33 7d &lt;br /&gt;
 I0708 18:00:35.513213   10139 vm.go:114] [vm e9276e31 hyperstart]  hyper_channel_handle, type 11, len 41&lt;br /&gt;
 I0708 18:00:35.513295   10139 vm.go:114] [vm e9276e31 hyperstart] call hyper_win_size, json {&amp;quot;seq&amp;quot;:1, &amp;quot;row&amp;quot;:48, &amp;quot;&lt;br /&gt;
 column&amp;quot;:113}, len 33&lt;br /&gt;
 I0708 18:00:35.513429   10139 vm.go:114] [vm e9276e31 hyperstart] exec seq 1, seq 1&lt;br /&gt;
 I0708 18:00:35.513525   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 9, len 0&lt;br /&gt;
&lt;br /&gt;
* and , since we are running the debug version (Remember, we set docker up with -D and the runtime to point to /usr/bin/cc-oci-runtime.sh, we also have a CC logfile in /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 # cat /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 ... much stuff ...&lt;br /&gt;
 2017-07-08T18:00:35.487831Z:10216:cc-oci-runtime:debug:proxy msg length: 16&lt;br /&gt;
 2017-07-08T18:00:35.487868Z:10216:cc-oci-runtime:debug:message read from proxy socket: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487940Z:10216:cc-oci-runtime:debug:msg received: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487954Z:10216:cc-oci-runtime:debug:disconnecting from proxy&lt;br /&gt;
 2017-07-08T18:00:35.488579Z:10216:cc-oci-runtime:debug:created state file /var/run/cc-oci-&lt;br /&gt;
 runtime/e9276e3130766473ecf58edaf76fea76c3df46db9c1dff5dc5113e6e7a85a205/state.json&lt;br /&gt;
* as you can see, we also have a state file.  This shows things like&lt;br /&gt;
 &amp;quot;vm&amp;quot; : {&lt;br /&gt;
    &amp;quot;pid&amp;quot; : 10192,&lt;br /&gt;
    &amp;quot;hypervisor_path&amp;quot; : &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
    &amp;quot;image_path&amp;quot; : &amp;quot;/usr/share/clear-containers/clear-16050-containers.img&amp;quot;, &lt;br /&gt;
    &amp;quot;kernel_path&amp;quot; : &amp;quot;/usr/share/clear-containers/vmlinux-4.9.33-74.container&amp;quot;,  &lt;br /&gt;
    &amp;quot;workload_path&amp;quot; : &amp;quot;&amp;quot;,  &lt;br /&gt;
  ....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
There is a lot of debugging information on the CC site, so I won&#039;t repeat it here. I used 3 main things when I was debugging this:&lt;br /&gt;
* the stderr/stdout for the proxy.&lt;br /&gt;
* the CC runtime log /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
* I also added an additional debug to the /usr/bin/cc-oci-runtime.sh.  I added debugging for the hypervisor itself.&lt;br /&gt;
 # mkdir /tmp/hypervisor&lt;br /&gt;
 # diff /usr/bin/cc-oci-runtime.sh /usr/bin/cc-oci-runtime.sh.orig&lt;br /&gt;
 64c64&lt;br /&gt;
 &amp;lt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;  --hypervisor-log-dir=/tmp/hypervisor &amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The hypervisor logs are empty unless there&#039;s a problem..,&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29199</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29199"/>
		<updated>2017-07-26T21:11:34Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Building It */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What &amp;amp; Why ==&lt;br /&gt;
Clear containers (CC) offer a hybrid solution that encompasses the advantages of hypervisor security and container deployment.  So, we wanted to see if they could be used in a YP environment. This was done for Clear Containers 2.2 based on YP master around the time of 2.4 RC1/2.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Note: this is a Proof of Concept, done by building on target. The eventual goal would be to create a standard recipe to allow the clear containers to be built in the standard way. &amp;lt;/strong&amp;gt; Hopefully, this guide will help with that by outlining the parts, dependencies, and configuration steps. This guide assumes you already have docker running on your target by having followed [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ].  The target example is being done with an Intel Nuc. I have successfully run the same code on a Minnowboard Turbot.&lt;br /&gt;
&lt;br /&gt;
== Dependencies you need ==&lt;br /&gt;
=== Layers ===&lt;br /&gt;
The layers I am using:&lt;br /&gt;
 meta-openembedded/meta-oe                                                                               &lt;br /&gt;
 meta-openembedded/meta-python                                                                                 &lt;br /&gt;
 meta-openembedded/meta-networking                                                                      &lt;br /&gt;
 meta-openembedded/meta-filesystems                                                                            &lt;br /&gt;
 meta-virtualization                                                                                          &lt;br /&gt;
 meta-clear&lt;br /&gt;
&lt;br /&gt;
All of these layers can be found on [https://layers.openembedded.org/layerindex/branch/master/layers/ layer.openembedded.org] except the meta-clear. The meta-clear layer was created with the script yocto-layer. It&#039;s only purpose is to turn on CONFIG_VHOST_NET=m for the kernel.  Here&#039;s a tree of the layer:&lt;br /&gt;
 &lt;br /&gt;
 ├── conf&lt;br /&gt;
 │  └── layer.conf&lt;br /&gt;
 ├── COPYING.MIT&lt;br /&gt;
 ├── README&lt;br /&gt;
 └── recipes-kernel&lt;br /&gt;
    └── linux&lt;br /&gt;
        ├── linux-yocto&lt;br /&gt;
        │   ├── clear.cfg&lt;br /&gt;
        │   └── clear.scc&lt;br /&gt;
        ├── linux-yocto_4.10.bbappend&lt;br /&gt;
        └── linux-yocto_4.9.bbappend&lt;br /&gt;
&lt;br /&gt;
I am using the 4.9 kernel. Here&#039;s the linux-yocto_4.9.bbappend:&lt;br /&gt;
 FILESEXTRAPATHS_prepend := &amp;quot;${THISDIR}/${PN}:&amp;quot;&lt;br /&gt;
 SRC_URI += &amp;quot;file://clear.scc \&lt;br /&gt;
           &amp;quot;&lt;br /&gt;
 KERNEL_MODULE_AUTOLOAD += &amp;quot;vhost-net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The scc file:&lt;br /&gt;
 define KFEATURE_DESCRIPTION &amp;quot;Enable clearcon support&amp;quot;&lt;br /&gt;
 define KFEATURE_COMPATIBILITY board&lt;br /&gt;
 kconf non-hardware clear.cfg&lt;br /&gt;
&lt;br /&gt;
And finally the cfg file:&lt;br /&gt;
 CONFIG_VHOST_NET=m&lt;br /&gt;
&lt;br /&gt;
=== Conf Changes ===&lt;br /&gt;
This guide presumes you have the setup in your conf file described in  [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ]. In &amp;lt;strong&amp;gt;addition&amp;lt;/strong&amp;gt;, to make on target building easier, I add the following to my conf/local.conf:&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot; dev-pkgs tools-sdk tools-debug tools-profile   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Additional Dependencies to Bitbake ===&lt;br /&gt;
These are the additional recipes I built in addition to the base I outlined above.  They could be added all at once in the local.conf, if you want by doing a &lt;br /&gt;
 IMAGE_INSTALL_append += libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
These are additional packages I built for convenience, but they are not required:&lt;br /&gt;
 bitbake less zile ntp rsync minicom&lt;br /&gt;
Once built these can be installed on the board. Note that we need the dev pkgs as we are mostly completing build requirements for pieces of CC.&lt;br /&gt;
 dnf install tunctl python-dev python-setuptools-dev libcap-ng-dev libcheck-dev libmnl-dev libjson-glib-1.0-dev  autoconf-archive-dev libcap-ng-dev python-setuptools-dev go wget sudo&lt;br /&gt;
and the convenient ones:&lt;br /&gt;
 dnf install zile less ntp rsync minicom&lt;br /&gt;
&lt;br /&gt;
=== The Image to Build ===&lt;br /&gt;
 bitbake core-image--base&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Pieces of CC==&lt;br /&gt;
Clear Containers are comprised of a set of software and binaries. The main code is a slightly forked (2.9 currently) qemu hypervisor configured to be minimal, a command proxy, a shim, and the oci runtime.  The command proxy is written in go. The rest is c/c++.  We build the hypervisor itself, but the binaries for the hypervisor are downloaded from the CC site. &lt;br /&gt;
=== The Runtime,Shim &amp;amp; Proxy ===&lt;br /&gt;
This comes from [[https://github.com/01org/cc-oci-runtime clear oci runtime]].  While getting it to work, I followed the development model outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds Leveraging Rpm Package Feeds]. Here I will list the dependencies to make it shorter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Which Clear was this?&lt;br /&gt;
 cc-oci-runtime version: 2.2.0&lt;br /&gt;
 spec version: 1.0.0-rc1&lt;br /&gt;
 commit: f92d50ad54003298c139de59777f07588683cdc2&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
We will pretty much follow the (very good) instructions in the [https://github.com/01org/cc-oci-runtime README]. Because it is a go project we will follow the go flow...&lt;br /&gt;
 go get -d github.com/01org/cc-oci-runtime/...&lt;br /&gt;
The &amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt; is necessary.  If you are behind a proxy, make sure you export http_proxy and https_proxy into your shell.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will put the src in ~/go/src/github.com/01org/cc-oci-runtime/ by default.&lt;br /&gt;
&lt;br /&gt;
==== Building It ====&lt;br /&gt;
Again, following their  [https://github.com/01org/cc-oci-runtime README] do&lt;br /&gt;
 ./autogen.sh --disable-functional-tests&lt;br /&gt;
We disable functional tests because I was not able to easily find a recipe for BATS (Bash automated testing).&lt;br /&gt;
 make&lt;br /&gt;
The make install is quite clean and show where everything is going:&lt;br /&gt;
 # make install&lt;br /&gt;
 make[1]: Entering directory &#039;/home/root/go/src/github.com/01org/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-oci-runtime &#039;/usr/bin&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-oci-runtime /usr/bin/cc-oci-runtime&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
  /usr/bin/install -c data/cc-oci-runtime.sh &#039;/usr/bin&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-shim &#039;/usr/libexec&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-shim /usr/libexec/cc-shim&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
  /usr/bin/install -c cc-proxy &#039;/usr/libexec&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 data/vm.json data/hypervisor.args data/kernel-cmdline &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/lib/systemd/system&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 proxy/cc-proxy.service proxy/cc-proxy.socket &#039;/lib/systemd/system&#039;&lt;br /&gt;
==== Getting the Artifacts ====&lt;br /&gt;
We need a kernel and an image for the hypervisor. &lt;br /&gt;
* The kernel  comes from [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] For example, I used  release 16050 ~ June 2017. This can be found in the following rpm   [[https://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm kernel rpm 16050]]&lt;br /&gt;
* The image (rootfs) also comes from   [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] I again picked the [[https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
* Here&#039;s the commands to download the above and install it.&lt;br /&gt;
 wget http://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 wget https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz&lt;br /&gt;
 rpm --install ./linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 xz --decompress clear-16050-containers.img.xz &lt;br /&gt;
 cp clear-16050-containers.img /usr/share/clear-containers/&lt;br /&gt;
 pushd /usr/share/clear-containers/&lt;br /&gt;
 ln -s clear-16050-containers.img clear-containers.img&lt;br /&gt;
 popd&lt;br /&gt;
After this, you should have a /usr/share/clear-containers directory that looks like this:&lt;br /&gt;
 |-- clear-16050-containers.img&lt;br /&gt;
 |-- clear-containers.img -&amp;gt; clear-16050-containers.img&lt;br /&gt;
 |-- vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinux.container -&amp;gt; vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinuz-4.9.33-74.container&lt;br /&gt;
 `-- vmlinuz.container -&amp;gt; vmlinuz-4.9.33-74.container&lt;br /&gt;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
The configuration is located in /usr/share/defaults/cc-oci-runtime. There are 3 files. &lt;br /&gt;
*  vm.json defines which hypervisor, kernel and rootfs we use:&lt;br /&gt;
 {&lt;br /&gt;
        &amp;quot;vm&amp;quot;: {&lt;br /&gt;
                &amp;quot;path&amp;quot;: &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
                &amp;quot;image&amp;quot;: &amp;quot;/usr/share/clear-containers/clear-containers.img&amp;quot;,&lt;br /&gt;
                &amp;quot;kernel&amp;quot;: {&lt;br /&gt;
                        &amp;quot;path&amp;quot;: &amp;quot;/usr/share/clear-containers/vmlinux.container&amp;quot;,&lt;br /&gt;
                        &amp;quot;parameters&amp;quot;: &amp;quot;root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check &lt;br /&gt;
 rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 &lt;br /&gt;
 initcall_debug init=/usr/lib/systemd/systemd systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service &lt;br /&gt;
 systemd.mask=systemd-networkd.socket systemd.show_status=false cryptomgr.notests net.ifnames=0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
* kernel-cmdline is  well, the kernel command line&lt;br /&gt;
 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 &lt;br /&gt;
 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug init=/usr/lib/systemd/systemd &lt;br /&gt;
 systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket &lt;br /&gt;
 systemd.show_status=false cryptomgr.notests net.ifnames=0&lt;br /&gt;
* hypervisor.args defines how we start up the qemu hypervisor&lt;br /&gt;
 /usr/local/bin/qemu-system-x86_64&lt;br /&gt;
 -name&lt;br /&gt;
 @NAME@&lt;br /&gt;
 -machine&lt;br /&gt;
 pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 -device&lt;br /&gt;
 nvdimm,memdev=mem0,id=nv0&lt;br /&gt;
 -object&lt;br /&gt;
 memory-backend-file,id=mem0,mem-path=@IMAGE@,size=@SIZE@&lt;br /&gt;
 -m&lt;br /&gt;
 2G,slots=2,maxmem=3G&lt;br /&gt;
 -kernel&lt;br /&gt;
 @KERNEL@&lt;br /&gt;
 -append&lt;br /&gt;
 @KERNEL_PARAMS@ @KERNEL_NET_PARAMS@&lt;br /&gt;
 -smp&lt;br /&gt;
 2,sockets=1,cores=2,threads=1&lt;br /&gt;
 -cpu&lt;br /&gt;
 host&lt;br /&gt;
&lt;br /&gt;
This is the file we need to change to accommodate our small memory availability on the Minnowboard Turbot (4 G total) . We are also using a newer qemu and machine type than the hypervisor.args file assumes. This helps to make the Atom processor happy. Here&#039;s the diff:&lt;br /&gt;
 # diff hypervisor.args.orig hypervisor.args&lt;br /&gt;
 5c5&lt;br /&gt;
 &amp;lt; pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; q35,accel=kvm,kernel_irqchip,nvdimm,nosmm,nosmbus,nosata,nopit,nofw&lt;br /&gt;
 11c11&lt;br /&gt;
 &amp;lt; 2G,slots=2,maxmem=3G&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; 256M,slots=2,maxmem=1G&lt;br /&gt;
&lt;br /&gt;
I capped it at 1G for now. This setting would definitely need to be tweaked depending on needs/usage...&lt;br /&gt;
&lt;br /&gt;
===The Qemu Hypervisor ===&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
 git clone https://github.com/clearcontainers/qemu qemu-cc&lt;br /&gt;
 cd qemu-cc&lt;br /&gt;
 git checkout -b qemu-lite-v2.9.0 origin/qemu-lite-v2.9.0&lt;br /&gt;
 &lt;br /&gt;
==== Building It ====&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 ../configure &#039;--prefix=/usr&#039; &#039;--disable-tools&#039; &#039;--disable-libssh2&#039; &#039;--disable-tcmalloc&#039; &#039;--disable-glusterfs&#039; &#039;--disable-seccomp&#039; &#039;--disable-bzip2&#039; &#039;--disable-snappy&#039; &#039;--disable-lzo&#039; &#039;--disable-usb-redir&#039; &#039;--disable-libusb&#039; &#039;--disable-libnfs&#039; &#039;--disable-tcg-interpreter&#039; &#039;--disable-debug-tcg&#039; &#039;--disable-libiscsi&#039; &#039;--disable-rbd&#039; &#039;--disable-spice&#039; &#039;--disable-attr&#039; &#039;--disable-cap-ng&#039; &#039;--disable-linux-aio&#039; &#039;--disable-brlapi&#039; &#039;--disable-vnc-jpeg&#039; &#039;--disable-vnc-png&#039; &#039;--disable-vnc-sasl&#039; &#039;--disable-rdma&#039; &#039;--disable-bluez&#039; &#039;--disable-fdt&#039; &#039;--disable-curl&#039; &#039;--disable-curses&#039; &#039;--disable-sdl&#039; &#039;--disable-gtk&#039; &#039;--disable-tpm&#039; &#039;--disable-vte&#039; &#039;--disable-vnc&#039; &#039;--disable-xen&#039; &#039;--disable-opengl&#039; &#039;--disable-slirp&#039; &#039;--enable-trace-backend=nop&#039; &#039;--enable-virtfs&#039; &#039;--enable-attr&#039; &#039;--enable-cap-ng&#039; &#039;--extra-cflags=-Wno-format-truncation&#039; &#039;--target-list=x86_64-softmmu&#039; &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
In order to build it with gcc-7 (current YP compiler which is ahead of most/all std distros, I needed to &amp;lt;strong&amp;gt; HACK &amp;lt;/strong&amp;gt; the following files:&lt;br /&gt;
       modified:   ../block/blkdebug.c&lt;br /&gt;
       modified:   ../block/blkverify.c&lt;br /&gt;
       modified:   ../hw/usb/bus.c&lt;br /&gt;
Here are the individual diffs:&lt;br /&gt;
* block/blkdebug.c&lt;br /&gt;
 diff --git a/block/blkdebug.c b/block/blkdebug.c&lt;br /&gt;
 index 67e8024e36..e3ab19b947 100644&lt;br /&gt;
 --- a/block/blkdebug.c&lt;br /&gt;
 +++ b/block/blkdebug.c&lt;br /&gt;
 @@ -668,7 +668,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)&lt;br /&gt;
 &lt;br /&gt;
 static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
 {&lt;br /&gt;
 -    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
 +//    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
     QDict *opts;&lt;br /&gt;
     const QDictEntry *e;&lt;br /&gt;
     bool force_json = false;&lt;br /&gt;
 @@ -688,11 +688,13 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0&lt;br /&gt;
     if (!force_json &amp;amp;&amp;amp; bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]) {&lt;br /&gt;
         snprintf(bs-&amp;gt;exact_filename, sizeof(bs-&amp;gt;exact_filename),&lt;br /&gt;
                  &amp;quot;blkdebug:%s:%s&amp;quot;, s-&amp;gt;config_file ?: &amp;quot;&amp;quot;,&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }&lt;br /&gt;
 +#endif&lt;br /&gt;
 &lt;br /&gt;
     opts = qdict_new();&lt;br /&gt;
     qdict_put_obj(opts, &amp;quot;driver&amp;quot;, QOBJECT(qstring_from_str(&amp;quot;blkdebug&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
* block/blkverify.c&lt;br /&gt;
 diff --git a/block/blkverify.c b/block/blkverify.c&lt;br /&gt;
 index 9a1e21c6ad..aa5d5ccdad 100644&lt;br /&gt;
 --- a/block/blkverify.c&lt;br /&gt;
 +++ b/block/blkverify.c&lt;br /&gt;
 @@ -302,6 +302,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         bs-&amp;gt;full_open_options = opts;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0  &lt;br /&gt;
     if (bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]&lt;br /&gt;
         &amp;amp;&amp;amp; s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename[0])&lt;br /&gt;
     {&lt;br /&gt;
 @@ -310,6 +311,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename,&lt;br /&gt;
                  s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }  &lt;br /&gt;
 +#endif&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static BlockDriver bdrv_blkverify = {&lt;br /&gt;
&lt;br /&gt;
* hw/usb/bus.c&lt;br /&gt;
 diff --git a/hw/usb/bus.c b/hw/usb/bus.c&lt;br /&gt;
 index 24f1608b4b..2f2abc1824 100644&lt;br /&gt;
 --- a/hw/usb/bus.c&lt;br /&gt;
 +++ b/hw/usb/bus.c&lt;br /&gt;
 @@ -407,8 +407,8 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],&lt;br /&gt;
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)&lt;br /&gt;
 {&lt;br /&gt;
     if (upstream) {&lt;br /&gt;
 -        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 -                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
 +//        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 +//                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
         downstream-&amp;gt;hubcount = upstream-&amp;gt;hubcount + 1;&lt;br /&gt;
     } else {&lt;br /&gt;
         snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%d&amp;quot;, portnr);&lt;br /&gt;
&lt;br /&gt;
I verified with fprintf(stderr....) that these are not hit in typical usage. I also expect they will be upstream patched soon.  &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
Now we can do:&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 # qemu-system-x86_64 -machine help| grep q35&lt;br /&gt;
 q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.9)&lt;br /&gt;
 pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
&lt;br /&gt;
The last line shows we can run qemu and have the machine available.&lt;br /&gt;
&lt;br /&gt;
== Running Clear Containers ==&lt;br /&gt;
You will need a couple of logins onto the target. &lt;br /&gt;
=== More configuration ===&lt;br /&gt;
We have the CC runtime, now we need to let docker know about it. We change the startup of the docker systemd service to know about the new cor runtime and we also turn on debugging. Note, for faster performance, we would drop the -D and do &amp;lt;code&amp;gt; --add-runtime cor=/usr/bin/cc-oci-runtime&amp;lt;/code&amp;gt; the .sh script is a clever interceptor that let&#039;s us turn on additional debugging features in case we need to.  &lt;br /&gt;
 &lt;br /&gt;
# diff /lib/systemd/system/docker.service ~/docker.service &lt;br /&gt;
 12c12&lt;br /&gt;
 &amp;lt; ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime.sh -H fd://&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ExecStart=/usr/bin/dockerd -H fd://&lt;br /&gt;
&lt;br /&gt;
Once the systemd service has been modified, you need to tell systemd to reload, and then restart docker&lt;br /&gt;
 # systemctl daemon-reload   &lt;br /&gt;
 # systemctl  stop docker&lt;br /&gt;
 # systemctl  start docker&lt;br /&gt;
&lt;br /&gt;
=== The Proxy ===&lt;br /&gt;
* by hand:&lt;br /&gt;
 /usr/libexec/cc-proxy -v 3&lt;br /&gt;
This will show the connections and is quite reassuring early.   This can also be run using the systemd service that got installed while building the runtime.&lt;br /&gt;
 # ls /lib/systemd/system/cc-proxy.s*&lt;br /&gt;
 /lib/systemd/system/cc-proxy.service  /lib/systemd/system/cc-proxy.socket&lt;br /&gt;
=== A Container ===&lt;br /&gt;
Now all the pieces are in place for the big finale. This will run a &amp;quot;normal&amp;quot; docker container&lt;br /&gt;
 # docker run -it --rm busybox sh&lt;br /&gt;
and &lt;br /&gt;
 # ps augxww | grep qemu &lt;br /&gt;
should be empty.&lt;br /&gt;
Now, let&#039;s run a Clear Container:&lt;br /&gt;
 # docker run -it --rm --runtime cor busybox sh                                               &lt;br /&gt;
 / # &lt;br /&gt;
This is the success we&#039;ve been aiming for all along!!! Yay! &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do we know it worked?&lt;br /&gt;
* ps This will show us a qemu instance running:&lt;br /&gt;
 #ps augxww | grep qemu&lt;br /&gt;
 root     10192  0.7  0.9 716620 73864 ?        Ssl  18:00   0:00 /usr/local/bin/qemu-system-x86_64 -name 0966e97e19a2 -machine &lt;br /&gt;
 q35,accel=kvm,kernel_irqchip,nvdimm ..... and much more ....&lt;br /&gt;
* our proxy will have some nifty information, here&#039;s a snippet:&lt;br /&gt;
 I0708 18:00:35.512724   10139 vm.go:114] [vm e9276e31 hyperstart] hyper_channel_read&lt;br /&gt;
 I0708 18:00:35.512813   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.512933   10139 vm.go:114] [vm e9276e31 hyperstart] get length 41&lt;br /&gt;
 I0708 18:00:35.513016   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.513148   10139 vm.go:114] [vm e9276e31 hyperstart] 0 0 0 b 0 0 0 29 7b 22 73 65 71 22 3a 31 2c 20 &lt;br /&gt;
 22 72 6f 77 22 3a 34 38 2c 20 22 63 6f 6c 75 6d 6e 22 3a 31 31 33 7d &lt;br /&gt;
 I0708 18:00:35.513213   10139 vm.go:114] [vm e9276e31 hyperstart]  hyper_channel_handle, type 11, len 41&lt;br /&gt;
 I0708 18:00:35.513295   10139 vm.go:114] [vm e9276e31 hyperstart] call hyper_win_size, json {&amp;quot;seq&amp;quot;:1, &amp;quot;row&amp;quot;:48, &amp;quot;&lt;br /&gt;
 column&amp;quot;:113}, len 33&lt;br /&gt;
 I0708 18:00:35.513429   10139 vm.go:114] [vm e9276e31 hyperstart] exec seq 1, seq 1&lt;br /&gt;
 I0708 18:00:35.513525   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 9, len 0&lt;br /&gt;
&lt;br /&gt;
* and , since we are running the debug version (Remember, we set docker up with -D and the runtime to point to /usr/bin/cc-oci-runtime.sh, we also have a CC logfile in /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 # cat /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 ... much stuff ...&lt;br /&gt;
 2017-07-08T18:00:35.487831Z:10216:cc-oci-runtime:debug:proxy msg length: 16&lt;br /&gt;
 2017-07-08T18:00:35.487868Z:10216:cc-oci-runtime:debug:message read from proxy socket: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487940Z:10216:cc-oci-runtime:debug:msg received: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487954Z:10216:cc-oci-runtime:debug:disconnecting from proxy&lt;br /&gt;
 2017-07-08T18:00:35.488579Z:10216:cc-oci-runtime:debug:created state file /var/run/cc-oci-&lt;br /&gt;
 runtime/e9276e3130766473ecf58edaf76fea76c3df46db9c1dff5dc5113e6e7a85a205/state.json&lt;br /&gt;
* as you can see, we also have a state file.  This shows things like&lt;br /&gt;
 &amp;quot;vm&amp;quot; : {&lt;br /&gt;
    &amp;quot;pid&amp;quot; : 10192,&lt;br /&gt;
    &amp;quot;hypervisor_path&amp;quot; : &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
    &amp;quot;image_path&amp;quot; : &amp;quot;/usr/share/clear-containers/clear-16050-containers.img&amp;quot;, &lt;br /&gt;
    &amp;quot;kernel_path&amp;quot; : &amp;quot;/usr/share/clear-containers/vmlinux-4.9.33-74.container&amp;quot;,  &lt;br /&gt;
    &amp;quot;workload_path&amp;quot; : &amp;quot;&amp;quot;,  &lt;br /&gt;
  ....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
There is a lot of debugging information on the CC site, so I won&#039;t repeat it here. I used 3 main things when I was debugging this:&lt;br /&gt;
* the stderr/stdout for the proxy.&lt;br /&gt;
* the CC runtime log /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
* I also added an additional debug to the /usr/bin/cc-oci-runtime.sh.  I added debugging for the hypervisor itself.&lt;br /&gt;
 # mkdir /tmp/hypervisor&lt;br /&gt;
 # diff /usr/bin/cc-oci-runtime.sh /usr/bin/cc-oci-runtime.sh.orig&lt;br /&gt;
 64c64&lt;br /&gt;
 &amp;lt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;  --hypervisor-log-dir=/tmp/hypervisor &amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The hypervisor logs are empty unless there&#039;s a problem..,&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29198</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29198"/>
		<updated>2017-07-26T21:08:53Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Building It */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What &amp;amp; Why ==&lt;br /&gt;
Clear containers (CC) offer a hybrid solution that encompasses the advantages of hypervisor security and container deployment.  So, we wanted to see if they could be used in a YP environment. This was done for Clear Containers 2.2 based on YP master around the time of 2.4 RC1/2.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Note: this is a Proof of Concept, done by building on target. The eventual goal would be to create a standard recipe to allow the clear containers to be built in the standard way. &amp;lt;/strong&amp;gt; Hopefully, this guide will help with that by outlining the parts, dependencies, and configuration steps. This guide assumes you already have docker running on your target by having followed [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ].  The target example is being done with an Intel Nuc. I have successfully run the same code on a Minnowboard Turbot.&lt;br /&gt;
&lt;br /&gt;
== Dependencies you need ==&lt;br /&gt;
=== Layers ===&lt;br /&gt;
The layers I am using:&lt;br /&gt;
 meta-openembedded/meta-oe                                                                               &lt;br /&gt;
 meta-openembedded/meta-python                                                                                 &lt;br /&gt;
 meta-openembedded/meta-networking                                                                      &lt;br /&gt;
 meta-openembedded/meta-filesystems                                                                            &lt;br /&gt;
 meta-virtualization                                                                                          &lt;br /&gt;
 meta-clear&lt;br /&gt;
&lt;br /&gt;
All of these layers can be found on [https://layers.openembedded.org/layerindex/branch/master/layers/ layer.openembedded.org] except the meta-clear. The meta-clear layer was created with the script yocto-layer. It&#039;s only purpose is to turn on CONFIG_VHOST_NET=m for the kernel.  Here&#039;s a tree of the layer:&lt;br /&gt;
 &lt;br /&gt;
 ├── conf&lt;br /&gt;
 │  └── layer.conf&lt;br /&gt;
 ├── COPYING.MIT&lt;br /&gt;
 ├── README&lt;br /&gt;
 └── recipes-kernel&lt;br /&gt;
    └── linux&lt;br /&gt;
        ├── linux-yocto&lt;br /&gt;
        │   ├── clear.cfg&lt;br /&gt;
        │   └── clear.scc&lt;br /&gt;
        ├── linux-yocto_4.10.bbappend&lt;br /&gt;
        └── linux-yocto_4.9.bbappend&lt;br /&gt;
&lt;br /&gt;
I am using the 4.9 kernel. Here&#039;s the linux-yocto_4.9.bbappend:&lt;br /&gt;
 FILESEXTRAPATHS_prepend := &amp;quot;${THISDIR}/${PN}:&amp;quot;&lt;br /&gt;
 SRC_URI += &amp;quot;file://clear.scc \&lt;br /&gt;
           &amp;quot;&lt;br /&gt;
 KERNEL_MODULE_AUTOLOAD += &amp;quot;vhost-net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The scc file:&lt;br /&gt;
 define KFEATURE_DESCRIPTION &amp;quot;Enable clearcon support&amp;quot;&lt;br /&gt;
 define KFEATURE_COMPATIBILITY board&lt;br /&gt;
 kconf non-hardware clear.cfg&lt;br /&gt;
&lt;br /&gt;
And finally the cfg file:&lt;br /&gt;
 CONFIG_VHOST_NET=m&lt;br /&gt;
&lt;br /&gt;
=== Conf Changes ===&lt;br /&gt;
This guide presumes you have the setup in your conf file described in  [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ]. In &amp;lt;strong&amp;gt;addition&amp;lt;/strong&amp;gt;, to make on target building easier, I add the following to my conf/local.conf:&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot; dev-pkgs tools-sdk tools-debug tools-profile   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Additional Dependencies to Bitbake ===&lt;br /&gt;
These are the additional recipes I built in addition to the base I outlined above.  They could be added all at once in the local.conf, if you want by doing a &lt;br /&gt;
 IMAGE_INSTALL_append += libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
These are additional packages I built for convenience, but they are not required:&lt;br /&gt;
 bitbake less zile ntp rsync minicom&lt;br /&gt;
Once built these can be installed on the board. Note that we need the dev pkgs as we are mostly completing build requirements for pieces of CC.&lt;br /&gt;
 dnf install tunctl python-dev python-setuptools-dev libcap-ng-dev libcheck-dev libmnl-dev libjson-glib-1.0-dev  autoconf-archive-dev libcap-ng-dev python-setuptools-dev go wget sudo&lt;br /&gt;
and the convenient ones:&lt;br /&gt;
 dnf install zile less ntp rsync minicom&lt;br /&gt;
&lt;br /&gt;
=== The Image to Build ===&lt;br /&gt;
 bitbake core-image--base&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Pieces of CC==&lt;br /&gt;
Clear Containers are comprised of a set of software and binaries. The main code is a slightly forked (2.9 currently) qemu hypervisor configured to be minimal, a command proxy, a shim, and the oci runtime.  The command proxy is written in go. The rest is c/c++.  We build the hypervisor itself, but the binaries for the hypervisor are downloaded from the CC site. &lt;br /&gt;
=== The Runtime,Shim &amp;amp; Proxy ===&lt;br /&gt;
This comes from [[https://github.com/01org/cc-oci-runtime clear oci runtime]].  While getting it to work, I followed the development model outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds Leveraging Rpm Package Feeds]. Here I will list the dependencies to make it shorter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Which Clear was this?&lt;br /&gt;
 cc-oci-runtime version: 2.2.0&lt;br /&gt;
 spec version: 1.0.0-rc1&lt;br /&gt;
 commit: f92d50ad54003298c139de59777f07588683cdc2&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
We will pretty much follow the (very good) instructions in the [https://github.com/01org/cc-oci-runtime README]. Because it is a go project we will follow the go flow...&lt;br /&gt;
 go get -d github.com/01org/cc-oci-runtime/...&lt;br /&gt;
The &amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt; is necessary.  If you are behind a proxy, make sure you export http_proxy and https_proxy into your shell.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will put the src in ~/go/src/github.com/01org/cc-oci-runtime/ by default.&lt;br /&gt;
&lt;br /&gt;
==== Building It ====&lt;br /&gt;
Again, following their  [https://github.com/01org/cc-oci-runtime README] do&lt;br /&gt;
 ./autogen.sh --disable-functional-tests&lt;br /&gt;
We disable functional tests because I was not able to easily find a recipe for BATS (Bash automated testing).&lt;br /&gt;
 make&lt;br /&gt;
The make install is quite clean and show where everything is going:&lt;br /&gt;
 # make install&lt;br /&gt;
 make[1]: Entering directory &#039;/home/root/go/src/github.com/01org/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-oci-runtime &#039;/usr/bin&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-oci-runtime /usr/bin/cc-oci-runtime&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
  /usr/bin/install -c data/cc-oci-runtime.sh &#039;/usr/bin&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-shim &#039;/usr/libexec&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-shim /usr/libexec/cc-shim&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
  /usr/bin/install -c cc-proxy &#039;/usr/libexec&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 data/vm.json data/hypervisor.args data/kernel-cmdline &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/lib/systemd/system&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 proxy/cc-proxy.service proxy/cc-proxy.socket &#039;/lib/systemd/system&#039;&lt;br /&gt;
==== Getting the Artifacts ====&lt;br /&gt;
We need a kernel and an image for the hypervisor. &lt;br /&gt;
* The kernel  comes from [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] For example, I used  release 16050 ~ June 2017. This can be found in the following rpm   [[https://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm kernel rpm 16050]]&lt;br /&gt;
* The image (rootfs) also comes from   [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] I again picked the [[https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
* Here&#039;s the commands to download the above and install it.&lt;br /&gt;
 wget http://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 wget https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz&lt;br /&gt;
 rpm --install ./linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 xz --decompress clear-16050-containers.img.xz &lt;br /&gt;
 cp clear-16050-containers.img /usr/share/clear-containers/&lt;br /&gt;
 pushd /usr/share/clear-containers/&lt;br /&gt;
 ln -s clear-16050-containers.img clear-containers.img&lt;br /&gt;
 popd&lt;br /&gt;
After this, you should have a /usr/share/clear-containers directory that looks like this:&lt;br /&gt;
 |-- clear-16050-containers.img&lt;br /&gt;
 |-- clear-containers.img -&amp;gt; clear-16050-containers.img&lt;br /&gt;
 |-- vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinux.container -&amp;gt; vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinuz-4.9.33-74.container&lt;br /&gt;
 `-- vmlinuz.container -&amp;gt; vmlinuz-4.9.33-74.container&lt;br /&gt;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
The configuration is located in /usr/share/defaults/cc-oci-runtime. There are 3 files. &lt;br /&gt;
*  vm.json defines which hypervisor, kernel and rootfs we use:&lt;br /&gt;
 {&lt;br /&gt;
        &amp;quot;vm&amp;quot;: {&lt;br /&gt;
                &amp;quot;path&amp;quot;: &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
                &amp;quot;image&amp;quot;: &amp;quot;/usr/share/clear-containers/clear-containers.img&amp;quot;,&lt;br /&gt;
                &amp;quot;kernel&amp;quot;: {&lt;br /&gt;
                        &amp;quot;path&amp;quot;: &amp;quot;/usr/share/clear-containers/vmlinux.container&amp;quot;,&lt;br /&gt;
                        &amp;quot;parameters&amp;quot;: &amp;quot;root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check &lt;br /&gt;
 rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 &lt;br /&gt;
 initcall_debug init=/usr/lib/systemd/systemd systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service &lt;br /&gt;
 systemd.mask=systemd-networkd.socket systemd.show_status=false cryptomgr.notests net.ifnames=0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
* kernel-cmdline is  well, the kernel command line&lt;br /&gt;
 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 &lt;br /&gt;
 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug init=/usr/lib/systemd/systemd &lt;br /&gt;
 systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket &lt;br /&gt;
 systemd.show_status=false cryptomgr.notests net.ifnames=0&lt;br /&gt;
* hypervisor.args defines how we start up the qemu hypervisor&lt;br /&gt;
 /usr/local/bin/qemu-system-x86_64&lt;br /&gt;
 -name&lt;br /&gt;
 @NAME@&lt;br /&gt;
 -machine&lt;br /&gt;
 pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 -device&lt;br /&gt;
 nvdimm,memdev=mem0,id=nv0&lt;br /&gt;
 -object&lt;br /&gt;
 memory-backend-file,id=mem0,mem-path=@IMAGE@,size=@SIZE@&lt;br /&gt;
 -m&lt;br /&gt;
 2G,slots=2,maxmem=3G&lt;br /&gt;
 -kernel&lt;br /&gt;
 @KERNEL@&lt;br /&gt;
 -append&lt;br /&gt;
 @KERNEL_PARAMS@ @KERNEL_NET_PARAMS@&lt;br /&gt;
 -smp&lt;br /&gt;
 2,sockets=1,cores=2,threads=1&lt;br /&gt;
 -cpu&lt;br /&gt;
 host&lt;br /&gt;
&lt;br /&gt;
This is the file we need to change to accommodate our small memory availability on the Minnowboard Turbot (4 G total) . We are also using a newer qemu and machine type than the hypervisor.args file assumes. This helps to make the Atom processor happy. Here&#039;s the diff:&lt;br /&gt;
 # diff hypervisor.args.orig hypervisor.args&lt;br /&gt;
 5c5&lt;br /&gt;
 &amp;lt; pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; q35,accel=kvm,kernel_irqchip,nvdimm,nosmm,nosmbus,nosata,nopit,nofw&lt;br /&gt;
 11c11&lt;br /&gt;
 &amp;lt; 2G,slots=2,maxmem=3G&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; 256M,slots=2,maxmem=1G&lt;br /&gt;
&lt;br /&gt;
I capped it at 1G for now. This setting would definitely need to be tweaked depending on needs/usage...&lt;br /&gt;
&lt;br /&gt;
===The Qemu Hypervisor ===&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
 git clone https://github.com/clearcontainers/qemu qemu-cc&lt;br /&gt;
 cd qemu-cc&lt;br /&gt;
 git checkout -b qemu-lite-v2.9.0 origin/qemu-lite-v2.9.0&lt;br /&gt;
 &lt;br /&gt;
==== Building It ====&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
 ../configure &#039;--disable-tools&#039; &#039;--disable-libssh2&#039; &#039;--disable-tcmalloc&#039; &#039;--disable-glusterfs&#039; &#039;--disable-seccomp&#039; &#039;--disable-bzip2&#039; &#039;--disable-snappy&#039; &#039;--disable-lzo&#039; &#039;--disable-usb-redir&#039; &#039;--disable-libusb&#039; &#039;--disable-libnfs&#039; &#039;--disable-tcg-interpreter&#039; &#039;--disable-debug-tcg&#039; &#039;--disable-libiscsi&#039; &#039;--disable-rbd&#039; &#039;--disable-spice&#039; &#039;--disable-attr&#039; &#039;--disable-cap-ng&#039; &#039;--disable-linux-aio&#039; &#039;--disable-brlapi&#039; &#039;--disable-vnc-jpeg&#039; &#039;--disable-vnc-png&#039; &#039;--disable-vnc-sasl&#039; &#039;--disable-rdma&#039; &#039;--disable-bluez&#039; &#039;--disable-fdt&#039; &#039;--disable-curl&#039; &#039;--disable-curses&#039; &#039;--disable-sdl&#039; &#039;--disable-gtk&#039; &#039;--disable-tpm&#039; &#039;--disable-vte&#039; &#039;--disable-vnc&#039; &#039;--disable-xen&#039; &#039;--disable-opengl&#039; &#039;--disable-slirp&#039; &#039;--enable-trace-backend=nop&#039; &#039;--enable-virtfs&#039; &#039;--enable-attr&#039; &#039;--enable-cap-ng&#039; &#039;--extra-cflags=-Wno-format-truncation&#039; &#039;--target-list=x86_64-softmmu&#039; &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
In order to build it with gcc-7 (current YP compiler which is ahead of most/all std distros, I needed to &amp;lt;strong&amp;gt; HACK &amp;lt;/strong&amp;gt; the following files:&lt;br /&gt;
       modified:   ../block/blkdebug.c&lt;br /&gt;
       modified:   ../block/blkverify.c&lt;br /&gt;
       modified:   ../hw/usb/bus.c&lt;br /&gt;
Here are the individual diffs:&lt;br /&gt;
* block/blkdebug.c&lt;br /&gt;
 diff --git a/block/blkdebug.c b/block/blkdebug.c&lt;br /&gt;
 index 67e8024e36..e3ab19b947 100644&lt;br /&gt;
 --- a/block/blkdebug.c&lt;br /&gt;
 +++ b/block/blkdebug.c&lt;br /&gt;
 @@ -668,7 +668,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)&lt;br /&gt;
 &lt;br /&gt;
 static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
 {&lt;br /&gt;
 -    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
 +//    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
     QDict *opts;&lt;br /&gt;
     const QDictEntry *e;&lt;br /&gt;
     bool force_json = false;&lt;br /&gt;
 @@ -688,11 +688,13 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0&lt;br /&gt;
     if (!force_json &amp;amp;&amp;amp; bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]) {&lt;br /&gt;
         snprintf(bs-&amp;gt;exact_filename, sizeof(bs-&amp;gt;exact_filename),&lt;br /&gt;
                  &amp;quot;blkdebug:%s:%s&amp;quot;, s-&amp;gt;config_file ?: &amp;quot;&amp;quot;,&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }&lt;br /&gt;
 +#endif&lt;br /&gt;
 &lt;br /&gt;
     opts = qdict_new();&lt;br /&gt;
     qdict_put_obj(opts, &amp;quot;driver&amp;quot;, QOBJECT(qstring_from_str(&amp;quot;blkdebug&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
* block/blkverify.c&lt;br /&gt;
 diff --git a/block/blkverify.c b/block/blkverify.c&lt;br /&gt;
 index 9a1e21c6ad..aa5d5ccdad 100644&lt;br /&gt;
 --- a/block/blkverify.c&lt;br /&gt;
 +++ b/block/blkverify.c&lt;br /&gt;
 @@ -302,6 +302,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         bs-&amp;gt;full_open_options = opts;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0  &lt;br /&gt;
     if (bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]&lt;br /&gt;
         &amp;amp;&amp;amp; s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename[0])&lt;br /&gt;
     {&lt;br /&gt;
 @@ -310,6 +311,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename,&lt;br /&gt;
                  s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }  &lt;br /&gt;
 +#endif&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static BlockDriver bdrv_blkverify = {&lt;br /&gt;
&lt;br /&gt;
* hw/usb/bus.c&lt;br /&gt;
 diff --git a/hw/usb/bus.c b/hw/usb/bus.c&lt;br /&gt;
 index 24f1608b4b..2f2abc1824 100644&lt;br /&gt;
 --- a/hw/usb/bus.c&lt;br /&gt;
 +++ b/hw/usb/bus.c&lt;br /&gt;
 @@ -407,8 +407,8 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],&lt;br /&gt;
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)&lt;br /&gt;
 {&lt;br /&gt;
     if (upstream) {&lt;br /&gt;
 -        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 -                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
 +//        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 +//                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
         downstream-&amp;gt;hubcount = upstream-&amp;gt;hubcount + 1;&lt;br /&gt;
     } else {&lt;br /&gt;
         snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%d&amp;quot;, portnr);&lt;br /&gt;
&lt;br /&gt;
I verified with fprintf(stderr....) that these are not hit in typical usage. I also expect they will be upstream patched soon.  &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
Now we can do:&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 # qemu-system-x86_64 -machine help| grep q35&lt;br /&gt;
 q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.9)&lt;br /&gt;
 pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
&lt;br /&gt;
The last line shows we can run qemu and have the machine available.&lt;br /&gt;
&lt;br /&gt;
== Running Clear Containers ==&lt;br /&gt;
You will need a couple of logins onto the target. &lt;br /&gt;
=== More configuration ===&lt;br /&gt;
We have the CC runtime, now we need to let docker know about it. We change the startup of the docker systemd service to know about the new cor runtime and we also turn on debugging. Note, for faster performance, we would drop the -D and do &amp;lt;code&amp;gt; --add-runtime cor=/usr/bin/cc-oci-runtime&amp;lt;/code&amp;gt; the .sh script is a clever interceptor that let&#039;s us turn on additional debugging features in case we need to.  &lt;br /&gt;
 &lt;br /&gt;
# diff /lib/systemd/system/docker.service ~/docker.service &lt;br /&gt;
 12c12&lt;br /&gt;
 &amp;lt; ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime.sh -H fd://&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ExecStart=/usr/bin/dockerd -H fd://&lt;br /&gt;
&lt;br /&gt;
Once the systemd service has been modified, you need to tell systemd to reload, and then restart docker&lt;br /&gt;
 # systemctl daemon-reload   &lt;br /&gt;
 # systemctl  stop docker&lt;br /&gt;
 # systemctl  start docker&lt;br /&gt;
&lt;br /&gt;
=== The Proxy ===&lt;br /&gt;
* by hand:&lt;br /&gt;
 /usr/libexec/cc-proxy -v 3&lt;br /&gt;
This will show the connections and is quite reassuring early.   This can also be run using the systemd service that got installed while building the runtime.&lt;br /&gt;
 # ls /lib/systemd/system/cc-proxy.s*&lt;br /&gt;
 /lib/systemd/system/cc-proxy.service  /lib/systemd/system/cc-proxy.socket&lt;br /&gt;
=== A Container ===&lt;br /&gt;
Now all the pieces are in place for the big finale. This will run a &amp;quot;normal&amp;quot; docker container&lt;br /&gt;
 # docker run -it --rm busybox sh&lt;br /&gt;
and &lt;br /&gt;
 # ps augxww | grep qemu &lt;br /&gt;
should be empty.&lt;br /&gt;
Now, let&#039;s run a Clear Container:&lt;br /&gt;
 # docker run -it --rm --runtime cor busybox sh                                               &lt;br /&gt;
 / # &lt;br /&gt;
This is the success we&#039;ve been aiming for all along!!! Yay! &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do we know it worked?&lt;br /&gt;
* ps This will show us a qemu instance running:&lt;br /&gt;
 #ps augxww | grep qemu&lt;br /&gt;
 root     10192  0.7  0.9 716620 73864 ?        Ssl  18:00   0:00 /usr/local/bin/qemu-system-x86_64 -name 0966e97e19a2 -machine &lt;br /&gt;
 q35,accel=kvm,kernel_irqchip,nvdimm ..... and much more ....&lt;br /&gt;
* our proxy will have some nifty information, here&#039;s a snippet:&lt;br /&gt;
 I0708 18:00:35.512724   10139 vm.go:114] [vm e9276e31 hyperstart] hyper_channel_read&lt;br /&gt;
 I0708 18:00:35.512813   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.512933   10139 vm.go:114] [vm e9276e31 hyperstart] get length 41&lt;br /&gt;
 I0708 18:00:35.513016   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.513148   10139 vm.go:114] [vm e9276e31 hyperstart] 0 0 0 b 0 0 0 29 7b 22 73 65 71 22 3a 31 2c 20 &lt;br /&gt;
 22 72 6f 77 22 3a 34 38 2c 20 22 63 6f 6c 75 6d 6e 22 3a 31 31 33 7d &lt;br /&gt;
 I0708 18:00:35.513213   10139 vm.go:114] [vm e9276e31 hyperstart]  hyper_channel_handle, type 11, len 41&lt;br /&gt;
 I0708 18:00:35.513295   10139 vm.go:114] [vm e9276e31 hyperstart] call hyper_win_size, json {&amp;quot;seq&amp;quot;:1, &amp;quot;row&amp;quot;:48, &amp;quot;&lt;br /&gt;
 column&amp;quot;:113}, len 33&lt;br /&gt;
 I0708 18:00:35.513429   10139 vm.go:114] [vm e9276e31 hyperstart] exec seq 1, seq 1&lt;br /&gt;
 I0708 18:00:35.513525   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 9, len 0&lt;br /&gt;
&lt;br /&gt;
* and , since we are running the debug version (Remember, we set docker up with -D and the runtime to point to /usr/bin/cc-oci-runtime.sh, we also have a CC logfile in /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 # cat /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 ... much stuff ...&lt;br /&gt;
 2017-07-08T18:00:35.487831Z:10216:cc-oci-runtime:debug:proxy msg length: 16&lt;br /&gt;
 2017-07-08T18:00:35.487868Z:10216:cc-oci-runtime:debug:message read from proxy socket: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487940Z:10216:cc-oci-runtime:debug:msg received: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487954Z:10216:cc-oci-runtime:debug:disconnecting from proxy&lt;br /&gt;
 2017-07-08T18:00:35.488579Z:10216:cc-oci-runtime:debug:created state file /var/run/cc-oci-&lt;br /&gt;
 runtime/e9276e3130766473ecf58edaf76fea76c3df46db9c1dff5dc5113e6e7a85a205/state.json&lt;br /&gt;
* as you can see, we also have a state file.  This shows things like&lt;br /&gt;
 &amp;quot;vm&amp;quot; : {&lt;br /&gt;
    &amp;quot;pid&amp;quot; : 10192,&lt;br /&gt;
    &amp;quot;hypervisor_path&amp;quot; : &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
    &amp;quot;image_path&amp;quot; : &amp;quot;/usr/share/clear-containers/clear-16050-containers.img&amp;quot;, &lt;br /&gt;
    &amp;quot;kernel_path&amp;quot; : &amp;quot;/usr/share/clear-containers/vmlinux-4.9.33-74.container&amp;quot;,  &lt;br /&gt;
    &amp;quot;workload_path&amp;quot; : &amp;quot;&amp;quot;,  &lt;br /&gt;
  ....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
There is a lot of debugging information on the CC site, so I won&#039;t repeat it here. I used 3 main things when I was debugging this:&lt;br /&gt;
* the stderr/stdout for the proxy.&lt;br /&gt;
* the CC runtime log /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
* I also added an additional debug to the /usr/bin/cc-oci-runtime.sh.  I added debugging for the hypervisor itself.&lt;br /&gt;
 # mkdir /tmp/hypervisor&lt;br /&gt;
 # diff /usr/bin/cc-oci-runtime.sh /usr/bin/cc-oci-runtime.sh.orig&lt;br /&gt;
 64c64&lt;br /&gt;
 &amp;lt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;  --hypervisor-log-dir=/tmp/hypervisor &amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The hypervisor logs are empty unless there&#039;s a problem..,&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29174</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29174"/>
		<updated>2017-07-25T23:38:58Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Configuring It */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What &amp;amp; Why ==&lt;br /&gt;
Clear containers (CC) offer a hybrid solution that encompasses the advantages of hypervisor security and container deployment.  So, we wanted to see if they could be used in a YP environment. This was done for Clear Containers 2.2 based on YP master around the time of 2.4 RC1/2.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Note: this is a Proof of Concept, done by building on target. The eventual goal would be to create a standard recipe to allow the clear containers to be built in the standard way. &amp;lt;/strong&amp;gt; Hopefully, this guide will help with that by outlining the parts, dependencies, and configuration steps. This guide assumes you already have docker running on your target by having followed [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ].  The target example is being done with an Intel Nuc. I have successfully run the same code on a Minnowboard Turbot.&lt;br /&gt;
&lt;br /&gt;
== Dependencies you need ==&lt;br /&gt;
=== Layers ===&lt;br /&gt;
The layers I am using:&lt;br /&gt;
 meta-openembedded/meta-oe                                                                               &lt;br /&gt;
 meta-openembedded/meta-python                                                                                 &lt;br /&gt;
 meta-openembedded/meta-networking                                                                      &lt;br /&gt;
 meta-openembedded/meta-filesystems                                                                            &lt;br /&gt;
 meta-virtualization                                                                                          &lt;br /&gt;
 meta-clear&lt;br /&gt;
&lt;br /&gt;
All of these layers can be found on [https://layers.openembedded.org/layerindex/branch/master/layers/ layer.openembedded.org] except the meta-clear. The meta-clear layer was created with the script yocto-layer. It&#039;s only purpose is to turn on CONFIG_VHOST_NET=m for the kernel.  Here&#039;s a tree of the layer:&lt;br /&gt;
 &lt;br /&gt;
 ├── conf&lt;br /&gt;
 │  └── layer.conf&lt;br /&gt;
 ├── COPYING.MIT&lt;br /&gt;
 ├── README&lt;br /&gt;
 └── recipes-kernel&lt;br /&gt;
    └── linux&lt;br /&gt;
        ├── linux-yocto&lt;br /&gt;
        │   ├── clear.cfg&lt;br /&gt;
        │   └── clear.scc&lt;br /&gt;
        ├── linux-yocto_4.10.bbappend&lt;br /&gt;
        └── linux-yocto_4.9.bbappend&lt;br /&gt;
&lt;br /&gt;
I am using the 4.9 kernel. Here&#039;s the linux-yocto_4.9.bbappend:&lt;br /&gt;
 FILESEXTRAPATHS_prepend := &amp;quot;${THISDIR}/${PN}:&amp;quot;&lt;br /&gt;
 SRC_URI += &amp;quot;file://clear.scc \&lt;br /&gt;
           &amp;quot;&lt;br /&gt;
 KERNEL_MODULE_AUTOLOAD += &amp;quot;vhost-net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The scc file:&lt;br /&gt;
 define KFEATURE_DESCRIPTION &amp;quot;Enable clearcon support&amp;quot;&lt;br /&gt;
 define KFEATURE_COMPATIBILITY board&lt;br /&gt;
 kconf non-hardware clear.cfg&lt;br /&gt;
&lt;br /&gt;
And finally the cfg file:&lt;br /&gt;
 CONFIG_VHOST_NET=m&lt;br /&gt;
&lt;br /&gt;
=== Conf Changes ===&lt;br /&gt;
This guide presumes you have the setup in your conf file described in  [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ]. In &amp;lt;strong&amp;gt;addition&amp;lt;/strong&amp;gt;, to make on target building easier, I add the following to my conf/local.conf:&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot; dev-pkgs tools-sdk tools-debug tools-profile   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Additional Dependencies to Bitbake ===&lt;br /&gt;
These are the additional recipes I built in addition to the base I outlined above.  They could be added all at once in the local.conf, if you want by doing a &lt;br /&gt;
 IMAGE_INSTALL_append += libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
These are additional packages I built for convenience, but they are not required:&lt;br /&gt;
 bitbake less zile ntp rsync minicom&lt;br /&gt;
Once built these can be installed on the board. Note that we need the dev pkgs as we are mostly completing build requirements for pieces of CC.&lt;br /&gt;
 dnf install tunctl python-dev python-setuptools-dev libcap-ng-dev libcheck-dev libmnl-dev libjson-glib-1.0-dev  autoconf-archive-dev libcap-ng-dev python-setuptools-dev go wget sudo&lt;br /&gt;
and the convenient ones:&lt;br /&gt;
 dnf install zile less ntp rsync minicom&lt;br /&gt;
&lt;br /&gt;
=== The Image to Build ===&lt;br /&gt;
 bitbake core-image--base&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Pieces of CC==&lt;br /&gt;
Clear Containers are comprised of a set of software and binaries. The main code is a slightly forked (2.9 currently) qemu hypervisor configured to be minimal, a command proxy, a shim, and the oci runtime.  The command proxy is written in go. The rest is c/c++.  We build the hypervisor itself, but the binaries for the hypervisor are downloaded from the CC site. &lt;br /&gt;
=== The Runtime,Shim &amp;amp; Proxy ===&lt;br /&gt;
This comes from [[https://github.com/01org/cc-oci-runtime clear oci runtime]].  While getting it to work, I followed the development model outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds Leveraging Rpm Package Feeds]. Here I will list the dependencies to make it shorter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Which Clear was this?&lt;br /&gt;
 cc-oci-runtime version: 2.2.0&lt;br /&gt;
 spec version: 1.0.0-rc1&lt;br /&gt;
 commit: f92d50ad54003298c139de59777f07588683cdc2&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
We will pretty much follow the (very good) instructions in the [https://github.com/01org/cc-oci-runtime README]. Because it is a go project we will follow the go flow...&lt;br /&gt;
 go get -d github.com/01org/cc-oci-runtime/...&lt;br /&gt;
The &amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt; is necessary.  If you are behind a proxy, make sure you export http_proxy and https_proxy into your shell.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will put the src in ~/go/src/github.com/01org/cc-oci-runtime/ by default.&lt;br /&gt;
&lt;br /&gt;
==== Building It ====&lt;br /&gt;
Again, following their  [https://github.com/01org/cc-oci-runtime README] do&lt;br /&gt;
 ./autogen.sh --disable-functional-tests&lt;br /&gt;
We disable functional tests because I was not able to easily find a recipe for BATS (Bash automated testing).&lt;br /&gt;
 make&lt;br /&gt;
The make install is quite clean and show where everything is going:&lt;br /&gt;
 # make install&lt;br /&gt;
 make[1]: Entering directory &#039;/home/root/go/src/github.com/01org/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-oci-runtime &#039;/usr/bin&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-oci-runtime /usr/bin/cc-oci-runtime&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
  /usr/bin/install -c data/cc-oci-runtime.sh &#039;/usr/bin&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-shim &#039;/usr/libexec&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-shim /usr/libexec/cc-shim&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
  /usr/bin/install -c cc-proxy &#039;/usr/libexec&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 data/vm.json data/hypervisor.args data/kernel-cmdline &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/lib/systemd/system&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 proxy/cc-proxy.service proxy/cc-proxy.socket &#039;/lib/systemd/system&#039;&lt;br /&gt;
==== Getting the Artifacts ====&lt;br /&gt;
We need a kernel and an image for the hypervisor. &lt;br /&gt;
* The kernel  comes from [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] For example, I used  release 16050 ~ June 2017. This can be found in the following rpm   [[https://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm kernel rpm 16050]]&lt;br /&gt;
* The image (rootfs) also comes from   [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] I again picked the [[https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
* Here&#039;s the commands to download the above and install it.&lt;br /&gt;
 wget http://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 wget https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz&lt;br /&gt;
 rpm --install ./linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 xz --decompress clear-16050-containers.img.xz &lt;br /&gt;
 cp clear-16050-containers.img /usr/share/clear-containers/&lt;br /&gt;
 pushd /usr/share/clear-containers/&lt;br /&gt;
 ln -s clear-16050-containers.img clear-containers.img&lt;br /&gt;
 popd&lt;br /&gt;
After this, you should have a /usr/share/clear-containers directory that looks like this:&lt;br /&gt;
 |-- clear-16050-containers.img&lt;br /&gt;
 |-- clear-containers.img -&amp;gt; clear-16050-containers.img&lt;br /&gt;
 |-- vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinux.container -&amp;gt; vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinuz-4.9.33-74.container&lt;br /&gt;
 `-- vmlinuz.container -&amp;gt; vmlinuz-4.9.33-74.container&lt;br /&gt;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
The configuration is located in /usr/share/defaults/cc-oci-runtime. There are 3 files. &lt;br /&gt;
*  vm.json defines which hypervisor, kernel and rootfs we use:&lt;br /&gt;
 {&lt;br /&gt;
        &amp;quot;vm&amp;quot;: {&lt;br /&gt;
                &amp;quot;path&amp;quot;: &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
                &amp;quot;image&amp;quot;: &amp;quot;/usr/share/clear-containers/clear-containers.img&amp;quot;,&lt;br /&gt;
                &amp;quot;kernel&amp;quot;: {&lt;br /&gt;
                        &amp;quot;path&amp;quot;: &amp;quot;/usr/share/clear-containers/vmlinux.container&amp;quot;,&lt;br /&gt;
                        &amp;quot;parameters&amp;quot;: &amp;quot;root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check &lt;br /&gt;
 rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 &lt;br /&gt;
 initcall_debug init=/usr/lib/systemd/systemd systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service &lt;br /&gt;
 systemd.mask=systemd-networkd.socket systemd.show_status=false cryptomgr.notests net.ifnames=0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
* kernel-cmdline is  well, the kernel command line&lt;br /&gt;
 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 &lt;br /&gt;
 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug init=/usr/lib/systemd/systemd &lt;br /&gt;
 systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket &lt;br /&gt;
 systemd.show_status=false cryptomgr.notests net.ifnames=0&lt;br /&gt;
* hypervisor.args defines how we start up the qemu hypervisor&lt;br /&gt;
 /usr/local/bin/qemu-system-x86_64&lt;br /&gt;
 -name&lt;br /&gt;
 @NAME@&lt;br /&gt;
 -machine&lt;br /&gt;
 pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 -device&lt;br /&gt;
 nvdimm,memdev=mem0,id=nv0&lt;br /&gt;
 -object&lt;br /&gt;
 memory-backend-file,id=mem0,mem-path=@IMAGE@,size=@SIZE@&lt;br /&gt;
 -m&lt;br /&gt;
 2G,slots=2,maxmem=3G&lt;br /&gt;
 -kernel&lt;br /&gt;
 @KERNEL@&lt;br /&gt;
 -append&lt;br /&gt;
 @KERNEL_PARAMS@ @KERNEL_NET_PARAMS@&lt;br /&gt;
 -smp&lt;br /&gt;
 2,sockets=1,cores=2,threads=1&lt;br /&gt;
 -cpu&lt;br /&gt;
 host&lt;br /&gt;
&lt;br /&gt;
This is the file we need to change to accommodate our small memory availability on the Minnowboard Turbot (4 G total) . We are also using a newer qemu and machine type than the hypervisor.args file assumes. This helps to make the Atom processor happy. Here&#039;s the diff:&lt;br /&gt;
 # diff hypervisor.args.orig hypervisor.args&lt;br /&gt;
 5c5&lt;br /&gt;
 &amp;lt; pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; q35,accel=kvm,kernel_irqchip,nvdimm,nosmm,nosmbus,nosata,nopit,nofw&lt;br /&gt;
 11c11&lt;br /&gt;
 &amp;lt; 2G,slots=2,maxmem=3G&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; 256M,slots=2,maxmem=1G&lt;br /&gt;
&lt;br /&gt;
I capped it at 1G for now. This setting would definitely need to be tweaked depending on needs/usage...&lt;br /&gt;
&lt;br /&gt;
===The Qemu Hypervisor ===&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
 git clone https://github.com/clearcontainers/qemu qemu-cc&lt;br /&gt;
 cd qemu-cc&lt;br /&gt;
 git checkout -b qemu-lite-v2.9.0 origin/qemu-lite-v2.9.0&lt;br /&gt;
 &lt;br /&gt;
==== Building It ====&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
  ../configure &#039;--disable-tools&#039; &#039;--disable-libssh2&#039; &#039;--disable-tcmalloc&#039; &#039;--disable-glusterfs&#039; &#039;--disable-seccomp&#039; &#039;--disable-bzip2&#039; &#039;--disable-snappy&#039; &#039;--disable-lzo&#039; &#039;--disable-usb-redir&#039; &#039;--disable-libusb&#039; &#039;--disable-libnfs&#039; &#039;--disable-tcg-interpreter&#039; &#039;--disable-debug-tcg&#039; &#039;--disable-libiscsi&#039; &#039;--disable-rbd&#039; &#039;--disable-spice&#039; &#039;--disable-attr&#039; &#039;--disable-cap-ng&#039; &#039;--disable-linux-aio&#039; &#039;--disable-brlapi&#039; &#039;--disable-vnc-jpeg&#039; &#039;--disable-vnc-png&#039; &#039;--disable-vnc-sasl&#039; &#039;--disable-rdma&#039; &#039;--disable-bluez&#039; &#039;--disable-fdt&#039; &#039;--disable-curl&#039; &#039;--disable-curses&#039; &#039;--disable-sdl&#039; &#039;--disable-gtk&#039; &#039;--disable-tpm&#039; &#039;--disable-vte&#039; &#039;--disable-vnc&#039; &#039;--disable-xen&#039; &#039;--disable-opengl&#039; &#039;--disable-slirp&#039; &#039;--enable-trace-backend=nop&#039; &#039;--enable-virtfs&#039; &#039;--enable-attr&#039; &#039;--enable-cap-ng&#039; &#039;--target-list=x86_64-softmmu&#039; &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In order to build it with gcc-7 (current YP compiler which is ahead of most/all std distros, I needed to &amp;lt;strong&amp;gt; HACK &amp;lt;/strong&amp;gt; the following files:&lt;br /&gt;
       modified:   ../block/blkdebug.c&lt;br /&gt;
       modified:   ../block/blkverify.c&lt;br /&gt;
       modified:   ../hw/usb/bus.c&lt;br /&gt;
Here are the individual diffs:&lt;br /&gt;
* block/blkdebug.c&lt;br /&gt;
 diff --git a/block/blkdebug.c b/block/blkdebug.c&lt;br /&gt;
 index 67e8024e36..e3ab19b947 100644&lt;br /&gt;
 --- a/block/blkdebug.c&lt;br /&gt;
 +++ b/block/blkdebug.c&lt;br /&gt;
 @@ -668,7 +668,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)&lt;br /&gt;
 &lt;br /&gt;
 static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
 {&lt;br /&gt;
 -    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
 +//    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
     QDict *opts;&lt;br /&gt;
     const QDictEntry *e;&lt;br /&gt;
     bool force_json = false;&lt;br /&gt;
 @@ -688,11 +688,13 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0&lt;br /&gt;
     if (!force_json &amp;amp;&amp;amp; bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]) {&lt;br /&gt;
         snprintf(bs-&amp;gt;exact_filename, sizeof(bs-&amp;gt;exact_filename),&lt;br /&gt;
                  &amp;quot;blkdebug:%s:%s&amp;quot;, s-&amp;gt;config_file ?: &amp;quot;&amp;quot;,&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }&lt;br /&gt;
 +#endif&lt;br /&gt;
 &lt;br /&gt;
     opts = qdict_new();&lt;br /&gt;
     qdict_put_obj(opts, &amp;quot;driver&amp;quot;, QOBJECT(qstring_from_str(&amp;quot;blkdebug&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
* block/blkverify.c&lt;br /&gt;
 diff --git a/block/blkverify.c b/block/blkverify.c&lt;br /&gt;
 index 9a1e21c6ad..aa5d5ccdad 100644&lt;br /&gt;
 --- a/block/blkverify.c&lt;br /&gt;
 +++ b/block/blkverify.c&lt;br /&gt;
 @@ -302,6 +302,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         bs-&amp;gt;full_open_options = opts;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0  &lt;br /&gt;
     if (bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]&lt;br /&gt;
         &amp;amp;&amp;amp; s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename[0])&lt;br /&gt;
     {&lt;br /&gt;
 @@ -310,6 +311,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename,&lt;br /&gt;
                  s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }  &lt;br /&gt;
 +#endif&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static BlockDriver bdrv_blkverify = {&lt;br /&gt;
&lt;br /&gt;
* hw/usb/bus.c&lt;br /&gt;
 diff --git a/hw/usb/bus.c b/hw/usb/bus.c&lt;br /&gt;
 index 24f1608b4b..2f2abc1824 100644&lt;br /&gt;
 --- a/hw/usb/bus.c&lt;br /&gt;
 +++ b/hw/usb/bus.c&lt;br /&gt;
 @@ -407,8 +407,8 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],&lt;br /&gt;
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)&lt;br /&gt;
 {&lt;br /&gt;
     if (upstream) {&lt;br /&gt;
 -        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 -                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
 +//        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 +//                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
         downstream-&amp;gt;hubcount = upstream-&amp;gt;hubcount + 1;&lt;br /&gt;
     } else {&lt;br /&gt;
         snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%d&amp;quot;, portnr);&lt;br /&gt;
&lt;br /&gt;
I verified with fprintf(stderr....) that these are not hit in typical usage. I also expect they will be upstream patched soon.  Now we can do:&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 # qemu-system-x86_64 -machine help| grep q35&lt;br /&gt;
 q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.9)&lt;br /&gt;
 pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
&lt;br /&gt;
The last line shows we can run qemu and have the machine available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Clear Containers ==&lt;br /&gt;
You will need a couple of logins onto the target. &lt;br /&gt;
=== More configuration ===&lt;br /&gt;
We have the CC runtime, now we need to let docker know about it. We change the startup of the docker systemd service to know about the new cor runtime and we also turn on debugging. Note, for faster performance, we would drop the -D and do &amp;lt;code&amp;gt; --add-runtime cor=/usr/bin/cc-oci-runtime&amp;lt;/code&amp;gt; the .sh script is a clever interceptor that let&#039;s us turn on additional debugging features in case we need to.  &lt;br /&gt;
 &lt;br /&gt;
# diff /lib/systemd/system/docker.service ~/docker.service &lt;br /&gt;
 12c12&lt;br /&gt;
 &amp;lt; ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime.sh -H fd://&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ExecStart=/usr/bin/dockerd -H fd://&lt;br /&gt;
&lt;br /&gt;
Once the systemd service has been modified, you need to tell systemd to reload, and then restart docker&lt;br /&gt;
 # systemctl daemon-reload   &lt;br /&gt;
 # systemctl  stop docker&lt;br /&gt;
 # systemctl  start docker&lt;br /&gt;
&lt;br /&gt;
=== The Proxy ===&lt;br /&gt;
* by hand:&lt;br /&gt;
 /usr/libexec/cc-proxy -v 3&lt;br /&gt;
This will show the connections and is quite reassuring early.   This can also be run using the systemd service that got installed while building the runtime.&lt;br /&gt;
 # ls /lib/systemd/system/cc-proxy.s*&lt;br /&gt;
 /lib/systemd/system/cc-proxy.service  /lib/systemd/system/cc-proxy.socket&lt;br /&gt;
=== A Container ===&lt;br /&gt;
Now all the pieces are in place for the big finale. This will run a &amp;quot;normal&amp;quot; docker container&lt;br /&gt;
 # docker run -it --rm busybox sh&lt;br /&gt;
and &lt;br /&gt;
 # ps augxww | grep qemu &lt;br /&gt;
should be empty.&lt;br /&gt;
Now, let&#039;s run a Clear Container:&lt;br /&gt;
 # docker run -it --rm --runtime cor busybox sh                                               &lt;br /&gt;
 / # &lt;br /&gt;
This is the success we&#039;ve been aiming for all along!!! Yay! &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do we know it worked?&lt;br /&gt;
* ps This will show us a qemu instance running:&lt;br /&gt;
 #ps augxww | grep qemu&lt;br /&gt;
 root     10192  0.7  0.9 716620 73864 ?        Ssl  18:00   0:00 /usr/local/bin/qemu-system-x86_64 -name 0966e97e19a2 -machine &lt;br /&gt;
 q35,accel=kvm,kernel_irqchip,nvdimm ..... and much more ....&lt;br /&gt;
* our proxy will have some nifty information, here&#039;s a snippet:&lt;br /&gt;
 I0708 18:00:35.512724   10139 vm.go:114] [vm e9276e31 hyperstart] hyper_channel_read&lt;br /&gt;
 I0708 18:00:35.512813   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.512933   10139 vm.go:114] [vm e9276e31 hyperstart] get length 41&lt;br /&gt;
 I0708 18:00:35.513016   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.513148   10139 vm.go:114] [vm e9276e31 hyperstart] 0 0 0 b 0 0 0 29 7b 22 73 65 71 22 3a 31 2c 20 &lt;br /&gt;
 22 72 6f 77 22 3a 34 38 2c 20 22 63 6f 6c 75 6d 6e 22 3a 31 31 33 7d &lt;br /&gt;
 I0708 18:00:35.513213   10139 vm.go:114] [vm e9276e31 hyperstart]  hyper_channel_handle, type 11, len 41&lt;br /&gt;
 I0708 18:00:35.513295   10139 vm.go:114] [vm e9276e31 hyperstart] call hyper_win_size, json {&amp;quot;seq&amp;quot;:1, &amp;quot;row&amp;quot;:48, &amp;quot;&lt;br /&gt;
 column&amp;quot;:113}, len 33&lt;br /&gt;
 I0708 18:00:35.513429   10139 vm.go:114] [vm e9276e31 hyperstart] exec seq 1, seq 1&lt;br /&gt;
 I0708 18:00:35.513525   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 9, len 0&lt;br /&gt;
&lt;br /&gt;
* and , since we are running the debug version (Remember, we set docker up with -D and the runtime to point to /usr/bin/cc-oci-runtime.sh, we also have a CC logfile in /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 # cat /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 ... much stuff ...&lt;br /&gt;
 2017-07-08T18:00:35.487831Z:10216:cc-oci-runtime:debug:proxy msg length: 16&lt;br /&gt;
 2017-07-08T18:00:35.487868Z:10216:cc-oci-runtime:debug:message read from proxy socket: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487940Z:10216:cc-oci-runtime:debug:msg received: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487954Z:10216:cc-oci-runtime:debug:disconnecting from proxy&lt;br /&gt;
 2017-07-08T18:00:35.488579Z:10216:cc-oci-runtime:debug:created state file /var/run/cc-oci-&lt;br /&gt;
 runtime/e9276e3130766473ecf58edaf76fea76c3df46db9c1dff5dc5113e6e7a85a205/state.json&lt;br /&gt;
* as you can see, we also have a state file.  This shows things like&lt;br /&gt;
 &amp;quot;vm&amp;quot; : {&lt;br /&gt;
    &amp;quot;pid&amp;quot; : 10192,&lt;br /&gt;
    &amp;quot;hypervisor_path&amp;quot; : &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
    &amp;quot;image_path&amp;quot; : &amp;quot;/usr/share/clear-containers/clear-16050-containers.img&amp;quot;, &lt;br /&gt;
    &amp;quot;kernel_path&amp;quot; : &amp;quot;/usr/share/clear-containers/vmlinux-4.9.33-74.container&amp;quot;,  &lt;br /&gt;
    &amp;quot;workload_path&amp;quot; : &amp;quot;&amp;quot;,  &lt;br /&gt;
  ....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
There is a lot of debugging information on the CC site, so I won&#039;t repeat it here. I used 3 main things when I was debugging this:&lt;br /&gt;
* the stderr/stdout for the proxy.&lt;br /&gt;
* the CC runtime log /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
* I also added an additional debug to the /usr/bin/cc-oci-runtime.sh.  I added debugging for the hypervisor itself.&lt;br /&gt;
 # mkdir /tmp/hypervisor&lt;br /&gt;
 # diff /usr/bin/cc-oci-runtime.sh /usr/bin/cc-oci-runtime.sh.orig&lt;br /&gt;
 64c64&lt;br /&gt;
 &amp;lt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;  --hypervisor-log-dir=/tmp/hypervisor &amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The hypervisor logs are empty unless there&#039;s a problem..,&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29173</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=29173"/>
		<updated>2017-07-25T23:38:30Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Configuring It */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What &amp;amp; Why ==&lt;br /&gt;
Clear containers (CC) offer a hybrid solution that encompasses the advantages of hypervisor security and container deployment.  So, we wanted to see if they could be used in a YP environment. This was done for Clear Containers 2.2 based on YP master around the time of 2.4 RC1/2.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Note: this is a Proof of Concept, done by building on target. The eventual goal would be to create a standard recipe to allow the clear containers to be built in the standard way. &amp;lt;/strong&amp;gt; Hopefully, this guide will help with that by outlining the parts, dependencies, and configuration steps. This guide assumes you already have docker running on your target by having followed [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ].  The target example is being done with an Intel Nuc. I have successfully run the same code on a Minnowboard Turbot.&lt;br /&gt;
&lt;br /&gt;
== Dependencies you need ==&lt;br /&gt;
=== Layers ===&lt;br /&gt;
The layers I am using:&lt;br /&gt;
 meta-openembedded/meta-oe                                                                               &lt;br /&gt;
 meta-openembedded/meta-python                                                                                 &lt;br /&gt;
 meta-openembedded/meta-networking                                                                      &lt;br /&gt;
 meta-openembedded/meta-filesystems                                                                            &lt;br /&gt;
 meta-virtualization                                                                                          &lt;br /&gt;
 meta-clear&lt;br /&gt;
&lt;br /&gt;
All of these layers can be found on [https://layers.openembedded.org/layerindex/branch/master/layers/ layer.openembedded.org] except the meta-clear. The meta-clear layer was created with the script yocto-layer. It&#039;s only purpose is to turn on CONFIG_VHOST_NET=m for the kernel.  Here&#039;s a tree of the layer:&lt;br /&gt;
 &lt;br /&gt;
 ├── conf&lt;br /&gt;
 │  └── layer.conf&lt;br /&gt;
 ├── COPYING.MIT&lt;br /&gt;
 ├── README&lt;br /&gt;
 └── recipes-kernel&lt;br /&gt;
    └── linux&lt;br /&gt;
        ├── linux-yocto&lt;br /&gt;
        │   ├── clear.cfg&lt;br /&gt;
        │   └── clear.scc&lt;br /&gt;
        ├── linux-yocto_4.10.bbappend&lt;br /&gt;
        └── linux-yocto_4.9.bbappend&lt;br /&gt;
&lt;br /&gt;
I am using the 4.9 kernel. Here&#039;s the linux-yocto_4.9.bbappend:&lt;br /&gt;
 FILESEXTRAPATHS_prepend := &amp;quot;${THISDIR}/${PN}:&amp;quot;&lt;br /&gt;
 SRC_URI += &amp;quot;file://clear.scc \&lt;br /&gt;
           &amp;quot;&lt;br /&gt;
 KERNEL_MODULE_AUTOLOAD += &amp;quot;vhost-net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The scc file:&lt;br /&gt;
 define KFEATURE_DESCRIPTION &amp;quot;Enable clearcon support&amp;quot;&lt;br /&gt;
 define KFEATURE_COMPATIBILITY board&lt;br /&gt;
 kconf non-hardware clear.cfg&lt;br /&gt;
&lt;br /&gt;
And finally the cfg file:&lt;br /&gt;
 CONFIG_VHOST_NET=m&lt;br /&gt;
&lt;br /&gt;
=== Conf Changes ===&lt;br /&gt;
This guide presumes you have the setup in your conf file described in  [https://wiki.yoctoproject.org/wiki/TipsAndTricks/DockerOnImage Running Docker on your image ]. In &amp;lt;strong&amp;gt;addition&amp;lt;/strong&amp;gt;, to make on target building easier, I add the following to my conf/local.conf:&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot; dev-pkgs tools-sdk tools-debug tools-profile   &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Additional Dependencies to Bitbake ===&lt;br /&gt;
These are the additional recipes I built in addition to the base I outlined above.  They could be added all at once in the local.conf, if you want by doing a &lt;br /&gt;
 IMAGE_INSTALL_append += libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget sudo&lt;br /&gt;
These are additional packages I built for convenience, but they are not required:&lt;br /&gt;
 bitbake less zile ntp rsync minicom&lt;br /&gt;
Once built these can be installed on the board. Note that we need the dev pkgs as we are mostly completing build requirements for pieces of CC.&lt;br /&gt;
 dnf install tunctl python-dev python-setuptools-dev libcap-ng-dev libcheck-dev libmnl-dev libjson-glib-1.0-dev  autoconf-archive-dev libcap-ng-dev python-setuptools-dev go wget sudo&lt;br /&gt;
and the convenient ones:&lt;br /&gt;
 dnf install zile less ntp rsync minicom&lt;br /&gt;
&lt;br /&gt;
=== The Image to Build ===&lt;br /&gt;
 bitbake core-image--base&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Pieces of CC==&lt;br /&gt;
Clear Containers are comprised of a set of software and binaries. The main code is a slightly forked (2.9 currently) qemu hypervisor configured to be minimal, a command proxy, a shim, and the oci runtime.  The command proxy is written in go. The rest is c/c++.  We build the hypervisor itself, but the binaries for the hypervisor are downloaded from the CC site. &lt;br /&gt;
=== The Runtime,Shim &amp;amp; Proxy ===&lt;br /&gt;
This comes from [[https://github.com/01org/cc-oci-runtime clear oci runtime]].  While getting it to work, I followed the development model outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds Leveraging Rpm Package Feeds]. Here I will list the dependencies to make it shorter.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Which Clear was this?&lt;br /&gt;
 cc-oci-runtime version: 2.2.0&lt;br /&gt;
 spec version: 1.0.0-rc1&lt;br /&gt;
 commit: f92d50ad54003298c139de59777f07588683cdc2&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
We will pretty much follow the (very good) instructions in the [https://github.com/01org/cc-oci-runtime README]. Because it is a go project we will follow the go flow...&lt;br /&gt;
 go get -d github.com/01org/cc-oci-runtime/...&lt;br /&gt;
The &amp;lt;strong&amp;gt;...&amp;lt;/strong&amp;gt; is necessary.  If you are behind a proxy, make sure you export http_proxy and https_proxy into your shell.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
This will put the src in ~/go/src/github.com/01org/cc-oci-runtime/ by default.&lt;br /&gt;
&lt;br /&gt;
==== Building It ====&lt;br /&gt;
Again, following their  [https://github.com/01org/cc-oci-runtime README] do&lt;br /&gt;
 ./autogen.sh --disable-functional-tests&lt;br /&gt;
We disable functional tests because I was not able to easily find a recipe for BATS (Bash automated testing).&lt;br /&gt;
 make&lt;br /&gt;
The make install is quite clean and show where everything is going:&lt;br /&gt;
 # make install&lt;br /&gt;
 make[1]: Entering directory &#039;/home/root/go/src/github.com/01org/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-oci-runtime &#039;/usr/bin&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-oci-runtime /usr/bin/cc-oci-runtime&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/bin&#039;&lt;br /&gt;
  /usr/bin/install -c data/cc-oci-runtime.sh &#039;/usr/bin&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
   /bin/sh ./libtool   --mode=install /usr/bin/install -c cc-shim &#039;/usr/libexec&#039;&lt;br /&gt;
 libtool: install: /usr/bin/install -c cc-shim /usr/libexec/cc-shim&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/libexec&#039;&lt;br /&gt;
  /usr/bin/install -c cc-proxy &#039;/usr/libexec&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 data/vm.json data/hypervisor.args data/kernel-cmdline &#039;/usr/share/defaults/cc-oci-runtime&#039;&lt;br /&gt;
  /bin/mkdir -p &#039;/lib/systemd/system&#039;&lt;br /&gt;
  /usr/bin/install -c -m 644 proxy/cc-proxy.service proxy/cc-proxy.socket &#039;/lib/systemd/system&#039;&lt;br /&gt;
==== Getting the Artifacts ====&lt;br /&gt;
We need a kernel and an image for the hypervisor. &lt;br /&gt;
* The kernel  comes from [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] For example, I used  release 16050 ~ June 2017. This can be found in the following rpm   [[https://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm kernel rpm 16050]]&lt;br /&gt;
* The image (rootfs) also comes from   [[https://download.clearlinux.org/releases/ Clear Linux Releases.]] I again picked the [[https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
* Here&#039;s the commands to download the above and install it.&lt;br /&gt;
 wget http://download.clearlinux.org/releases/16050/clear/x86_64/os/Packages/linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 wget https://download.clearlinux.org/releases/16050/clear/clear-16050-containers.img.xz&lt;br /&gt;
 rpm --install ./linux-container-4.9.33-74.x86_64.rpm&lt;br /&gt;
 xz --decompress clear-16050-containers.img.xz &lt;br /&gt;
 cp clear-16050-containers.img /usr/share/clear-containers/&lt;br /&gt;
 pushd /usr/share/clear-containers/&lt;br /&gt;
 ln -s clear-16050-containers.img clear-containers.img&lt;br /&gt;
 popd&lt;br /&gt;
After this, you should have a /usr/share/clear-containers directory that looks like this:&lt;br /&gt;
 |-- clear-16050-containers.img&lt;br /&gt;
 |-- clear-containers.img -&amp;gt; clear-16050-containers.img&lt;br /&gt;
 |-- vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinux.container -&amp;gt; vmlinux-4.9.33-74.container&lt;br /&gt;
 |-- vmlinuz-4.9.33-74.container&lt;br /&gt;
 `-- vmlinuz.container -&amp;gt; vmlinuz-4.9.33-74.container&lt;br /&gt;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
The configuration is located in /usr/share/defaults/cc-oci-runtime. There are 3 files. &lt;br /&gt;
*  vm.json defines which hypervisor, kernel and rootfs we use:&lt;br /&gt;
 {&lt;br /&gt;
        &amp;quot;vm&amp;quot;: {&lt;br /&gt;
                &amp;quot;path&amp;quot;: &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
                &amp;quot;image&amp;quot;: &amp;quot;/usr/share/clear-containers/clear-containers.img&amp;quot;,&lt;br /&gt;
                &amp;quot;kernel&amp;quot;: {&lt;br /&gt;
                        &amp;quot;path&amp;quot;: &amp;quot;/usr/share/clear-containers/vmlinux.container&amp;quot;,&lt;br /&gt;
                        &amp;quot;parameters&amp;quot;: &amp;quot;root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check &lt;br /&gt;
 rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 &lt;br /&gt;
 initcall_debug init=/usr/lib/systemd/systemd systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service &lt;br /&gt;
 systemd.mask=systemd-networkd.socket systemd.show_status=false cryptomgr.notests net.ifnames=0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;br /&gt;
* kernel-cmdline is  well, the kernel command line&lt;br /&gt;
 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 &lt;br /&gt;
 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k panic=1 console=hvc0 console=hvc1 initcall_debug init=/usr/lib/systemd/systemd &lt;br /&gt;
 systemd.unit=cc-agent.target iommu=off quiet systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket &lt;br /&gt;
 systemd.show_status=false cryptomgr.notests net.ifnames=0&lt;br /&gt;
* hypervisor.args defines how we start up the qemu hypervisor&lt;br /&gt;
 /usr/bin/qemu-system-x86_64&lt;br /&gt;
 -name&lt;br /&gt;
 @NAME@&lt;br /&gt;
 -machine&lt;br /&gt;
 pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 -device&lt;br /&gt;
 nvdimm,memdev=mem0,id=nv0&lt;br /&gt;
 -object&lt;br /&gt;
 memory-backend-file,id=mem0,mem-path=@IMAGE@,size=@SIZE@&lt;br /&gt;
 -m&lt;br /&gt;
 2G,slots=2,maxmem=3G&lt;br /&gt;
 -kernel&lt;br /&gt;
 @KERNEL@&lt;br /&gt;
 -append&lt;br /&gt;
 @KERNEL_PARAMS@ @KERNEL_NET_PARAMS@&lt;br /&gt;
 -smp&lt;br /&gt;
 2,sockets=1,cores=2,threads=1&lt;br /&gt;
 -cpu&lt;br /&gt;
 host&lt;br /&gt;
&lt;br /&gt;
This is the file we need to change to accommodate our small memory availability on the Minnowboard Turbot (4 G total) . We are also using a newer qemu and machine type than the hypervisor.args file assumes. This helps to make the Atom processor happy. Here&#039;s the diff:&lt;br /&gt;
 # diff hypervisor.args.orig hypervisor.args&lt;br /&gt;
 5c5&lt;br /&gt;
 &amp;lt; pc-lite,accel=kvm,kernel_irqchip,nvdimm&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; q35,accel=kvm,kernel_irqchip,nvdimm,nosmm,nosmbus,nosata,nopit,nofw&lt;br /&gt;
 11c11&lt;br /&gt;
 &amp;lt; 2G,slots=2,maxmem=3G&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; 256M,slots=2,maxmem=1G&lt;br /&gt;
&lt;br /&gt;
I capped it at 1G for now. This setting would definitely need to be tweaked depending on needs/usage...&lt;br /&gt;
&lt;br /&gt;
===The Qemu Hypervisor ===&lt;br /&gt;
==== Getting the Source Code ====&lt;br /&gt;
 git clone https://github.com/clearcontainers/qemu qemu-cc&lt;br /&gt;
 cd qemu-cc&lt;br /&gt;
 git checkout -b qemu-lite-v2.9.0 origin/qemu-lite-v2.9.0&lt;br /&gt;
 &lt;br /&gt;
==== Building It ====&lt;br /&gt;
 mkdir build&lt;br /&gt;
 cd build&lt;br /&gt;
  ../configure &#039;--disable-tools&#039; &#039;--disable-libssh2&#039; &#039;--disable-tcmalloc&#039; &#039;--disable-glusterfs&#039; &#039;--disable-seccomp&#039; &#039;--disable-bzip2&#039; &#039;--disable-snappy&#039; &#039;--disable-lzo&#039; &#039;--disable-usb-redir&#039; &#039;--disable-libusb&#039; &#039;--disable-libnfs&#039; &#039;--disable-tcg-interpreter&#039; &#039;--disable-debug-tcg&#039; &#039;--disable-libiscsi&#039; &#039;--disable-rbd&#039; &#039;--disable-spice&#039; &#039;--disable-attr&#039; &#039;--disable-cap-ng&#039; &#039;--disable-linux-aio&#039; &#039;--disable-brlapi&#039; &#039;--disable-vnc-jpeg&#039; &#039;--disable-vnc-png&#039; &#039;--disable-vnc-sasl&#039; &#039;--disable-rdma&#039; &#039;--disable-bluez&#039; &#039;--disable-fdt&#039; &#039;--disable-curl&#039; &#039;--disable-curses&#039; &#039;--disable-sdl&#039; &#039;--disable-gtk&#039; &#039;--disable-tpm&#039; &#039;--disable-vte&#039; &#039;--disable-vnc&#039; &#039;--disable-xen&#039; &#039;--disable-opengl&#039; &#039;--disable-slirp&#039; &#039;--enable-trace-backend=nop&#039; &#039;--enable-virtfs&#039; &#039;--enable-attr&#039; &#039;--enable-cap-ng&#039; &#039;--target-list=x86_64-softmmu&#039; &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In order to build it with gcc-7 (current YP compiler which is ahead of most/all std distros, I needed to &amp;lt;strong&amp;gt; HACK &amp;lt;/strong&amp;gt; the following files:&lt;br /&gt;
       modified:   ../block/blkdebug.c&lt;br /&gt;
       modified:   ../block/blkverify.c&lt;br /&gt;
       modified:   ../hw/usb/bus.c&lt;br /&gt;
Here are the individual diffs:&lt;br /&gt;
* block/blkdebug.c&lt;br /&gt;
 diff --git a/block/blkdebug.c b/block/blkdebug.c&lt;br /&gt;
 index 67e8024e36..e3ab19b947 100644&lt;br /&gt;
 --- a/block/blkdebug.c&lt;br /&gt;
 +++ b/block/blkdebug.c&lt;br /&gt;
 @@ -668,7 +668,7 @@ static int blkdebug_truncate(BlockDriverState *bs, int64_t offset)&lt;br /&gt;
 &lt;br /&gt;
 static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
 {&lt;br /&gt;
 -    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
 +//    BDRVBlkdebugState *s = bs-&amp;gt;opaque;&lt;br /&gt;
     QDict *opts;&lt;br /&gt;
     const QDictEntry *e;&lt;br /&gt;
     bool force_json = false;&lt;br /&gt;
 @@ -688,11 +688,13 @@ static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0&lt;br /&gt;
     if (!force_json &amp;amp;&amp;amp; bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]) {&lt;br /&gt;
         snprintf(bs-&amp;gt;exact_filename, sizeof(bs-&amp;gt;exact_filename),&lt;br /&gt;
                  &amp;quot;blkdebug:%s:%s&amp;quot;, s-&amp;gt;config_file ?: &amp;quot;&amp;quot;,&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }&lt;br /&gt;
 +#endif&lt;br /&gt;
 &lt;br /&gt;
     opts = qdict_new();&lt;br /&gt;
     qdict_put_obj(opts, &amp;quot;driver&amp;quot;, QOBJECT(qstring_from_str(&amp;quot;blkdebug&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
* block/blkverify.c&lt;br /&gt;
 diff --git a/block/blkverify.c b/block/blkverify.c&lt;br /&gt;
 index 9a1e21c6ad..aa5d5ccdad 100644&lt;br /&gt;
 --- a/block/blkverify.c&lt;br /&gt;
 +++ b/block/blkverify.c&lt;br /&gt;
 @@ -302,6 +302,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
         bs-&amp;gt;full_open_options = opts;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 +#if 0  &lt;br /&gt;
     if (bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename[0]&lt;br /&gt;
         &amp;amp;&amp;amp; s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename[0])&lt;br /&gt;
     {&lt;br /&gt;
 @@ -310,6 +311,7 @@ static void blkverify_refresh_filename(BlockDriverState *bs, QDict *options)&lt;br /&gt;
                  bs-&amp;gt;file-&amp;gt;bs-&amp;gt;exact_filename,&lt;br /&gt;
                  s-&amp;gt;test_file-&amp;gt;bs-&amp;gt;exact_filename);&lt;br /&gt;
     }  &lt;br /&gt;
 +#endif&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 static BlockDriver bdrv_blkverify = {&lt;br /&gt;
&lt;br /&gt;
* hw/usb/bus.c&lt;br /&gt;
 diff --git a/hw/usb/bus.c b/hw/usb/bus.c&lt;br /&gt;
 index 24f1608b4b..2f2abc1824 100644&lt;br /&gt;
 --- a/hw/usb/bus.c&lt;br /&gt;
 +++ b/hw/usb/bus.c&lt;br /&gt;
 @@ -407,8 +407,8 @@ void usb_register_companion(const char *masterbus, USBPort *ports[],&lt;br /&gt;
 void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)&lt;br /&gt;
 {&lt;br /&gt;
     if (upstream) {&lt;br /&gt;
 -        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 -                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
 +//        snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%s.%d&amp;quot;,&lt;br /&gt;
 +//                 upstream-&amp;gt;path, portnr);&lt;br /&gt;
         downstream-&amp;gt;hubcount = upstream-&amp;gt;hubcount + 1;&lt;br /&gt;
     } else {&lt;br /&gt;
         snprintf(downstream-&amp;gt;path, sizeof(downstream-&amp;gt;path), &amp;quot;%d&amp;quot;, portnr);&lt;br /&gt;
&lt;br /&gt;
I verified with fprintf(stderr....) that these are not hit in typical usage. I also expect they will be upstream patched soon.  Now we can do:&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 # qemu-system-x86_64 -machine help| grep q35&lt;br /&gt;
 q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.9)&lt;br /&gt;
 pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
 pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)&lt;br /&gt;
&lt;br /&gt;
The last line shows we can run qemu and have the machine available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Clear Containers ==&lt;br /&gt;
You will need a couple of logins onto the target. &lt;br /&gt;
=== More configuration ===&lt;br /&gt;
We have the CC runtime, now we need to let docker know about it. We change the startup of the docker systemd service to know about the new cor runtime and we also turn on debugging. Note, for faster performance, we would drop the -D and do &amp;lt;code&amp;gt; --add-runtime cor=/usr/bin/cc-oci-runtime&amp;lt;/code&amp;gt; the .sh script is a clever interceptor that let&#039;s us turn on additional debugging features in case we need to.  &lt;br /&gt;
 &lt;br /&gt;
# diff /lib/systemd/system/docker.service ~/docker.service &lt;br /&gt;
 12c12&lt;br /&gt;
 &amp;lt; ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime.sh -H fd://&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ExecStart=/usr/bin/dockerd -H fd://&lt;br /&gt;
&lt;br /&gt;
Once the systemd service has been modified, you need to tell systemd to reload, and then restart docker&lt;br /&gt;
 # systemctl daemon-reload   &lt;br /&gt;
 # systemctl  stop docker&lt;br /&gt;
 # systemctl  start docker&lt;br /&gt;
&lt;br /&gt;
=== The Proxy ===&lt;br /&gt;
* by hand:&lt;br /&gt;
 /usr/libexec/cc-proxy -v 3&lt;br /&gt;
This will show the connections and is quite reassuring early.   This can also be run using the systemd service that got installed while building the runtime.&lt;br /&gt;
 # ls /lib/systemd/system/cc-proxy.s*&lt;br /&gt;
 /lib/systemd/system/cc-proxy.service  /lib/systemd/system/cc-proxy.socket&lt;br /&gt;
=== A Container ===&lt;br /&gt;
Now all the pieces are in place for the big finale. This will run a &amp;quot;normal&amp;quot; docker container&lt;br /&gt;
 # docker run -it --rm busybox sh&lt;br /&gt;
and &lt;br /&gt;
 # ps augxww | grep qemu &lt;br /&gt;
should be empty.&lt;br /&gt;
Now, let&#039;s run a Clear Container:&lt;br /&gt;
 # docker run -it --rm --runtime cor busybox sh                                               &lt;br /&gt;
 / # &lt;br /&gt;
This is the success we&#039;ve been aiming for all along!!! Yay! &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
How do we know it worked?&lt;br /&gt;
* ps This will show us a qemu instance running:&lt;br /&gt;
 #ps augxww | grep qemu&lt;br /&gt;
 root     10192  0.7  0.9 716620 73864 ?        Ssl  18:00   0:00 /usr/local/bin/qemu-system-x86_64 -name 0966e97e19a2 -machine &lt;br /&gt;
 q35,accel=kvm,kernel_irqchip,nvdimm ..... and much more ....&lt;br /&gt;
* our proxy will have some nifty information, here&#039;s a snippet:&lt;br /&gt;
 I0708 18:00:35.512724   10139 vm.go:114] [vm e9276e31 hyperstart] hyper_channel_read&lt;br /&gt;
 I0708 18:00:35.512813   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.512933   10139 vm.go:114] [vm e9276e31 hyperstart] get length 41&lt;br /&gt;
 I0708 18:00:35.513016   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 14, len 4&lt;br /&gt;
 I0708 18:00:35.513148   10139 vm.go:114] [vm e9276e31 hyperstart] 0 0 0 b 0 0 0 29 7b 22 73 65 71 22 3a 31 2c 20 &lt;br /&gt;
 22 72 6f 77 22 3a 34 38 2c 20 22 63 6f 6c 75 6d 6e 22 3a 31 31 33 7d &lt;br /&gt;
 I0708 18:00:35.513213   10139 vm.go:114] [vm e9276e31 hyperstart]  hyper_channel_handle, type 11, len 41&lt;br /&gt;
 I0708 18:00:35.513295   10139 vm.go:114] [vm e9276e31 hyperstart] call hyper_win_size, json {&amp;quot;seq&amp;quot;:1, &amp;quot;row&amp;quot;:48, &amp;quot;&lt;br /&gt;
 column&amp;quot;:113}, len 33&lt;br /&gt;
 I0708 18:00:35.513429   10139 vm.go:114] [vm e9276e31 hyperstart] exec seq 1, seq 1&lt;br /&gt;
 I0708 18:00:35.513525   10139 vm.go:114] [vm e9276e31 hyperstart] hyper send type 9, len 0&lt;br /&gt;
&lt;br /&gt;
* and , since we are running the debug version (Remember, we set docker up with -D and the runtime to point to /usr/bin/cc-oci-runtime.sh, we also have a CC logfile in /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 # cat /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
 ... much stuff ...&lt;br /&gt;
 2017-07-08T18:00:35.487831Z:10216:cc-oci-runtime:debug:proxy msg length: 16&lt;br /&gt;
 2017-07-08T18:00:35.487868Z:10216:cc-oci-runtime:debug:message read from proxy socket: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487940Z:10216:cc-oci-runtime:debug:msg received: {&amp;quot;success&amp;quot;:true}&lt;br /&gt;
 2017-07-08T18:00:35.487954Z:10216:cc-oci-runtime:debug:disconnecting from proxy&lt;br /&gt;
 2017-07-08T18:00:35.488579Z:10216:cc-oci-runtime:debug:created state file /var/run/cc-oci-&lt;br /&gt;
 runtime/e9276e3130766473ecf58edaf76fea76c3df46db9c1dff5dc5113e6e7a85a205/state.json&lt;br /&gt;
* as you can see, we also have a state file.  This shows things like&lt;br /&gt;
 &amp;quot;vm&amp;quot; : {&lt;br /&gt;
    &amp;quot;pid&amp;quot; : 10192,&lt;br /&gt;
    &amp;quot;hypervisor_path&amp;quot; : &amp;quot;/usr/local/bin/qemu-system-x86_64&amp;quot;,&lt;br /&gt;
    &amp;quot;image_path&amp;quot; : &amp;quot;/usr/share/clear-containers/clear-16050-containers.img&amp;quot;, &lt;br /&gt;
    &amp;quot;kernel_path&amp;quot; : &amp;quot;/usr/share/clear-containers/vmlinux-4.9.33-74.container&amp;quot;,  &lt;br /&gt;
    &amp;quot;workload_path&amp;quot; : &amp;quot;&amp;quot;,  &lt;br /&gt;
  ....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
There is a lot of debugging information on the CC site, so I won&#039;t repeat it here. I used 3 main things when I was debugging this:&lt;br /&gt;
* the stderr/stdout for the proxy.&lt;br /&gt;
* the CC runtime log /run/cc-oci-runtime/cc-oci-runtime.log&lt;br /&gt;
* I also added an additional debug to the /usr/bin/cc-oci-runtime.sh.  I added debugging for the hypervisor itself.&lt;br /&gt;
 # mkdir /tmp/hypervisor&lt;br /&gt;
 # diff /usr/bin/cc-oci-runtime.sh /usr/bin/cc-oci-runtime.sh.orig&lt;br /&gt;
 64c64&lt;br /&gt;
 &amp;lt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;  --hypervisor-log-dir=/tmp/hypervisor &amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; runtime_args=&amp;quot;$runtime_args --global-log=\&amp;quot;$global_log\&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The hypervisor logs are empty unless there&#039;s a problem..,&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28263</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28263"/>
		<updated>2017-06-26T21:48:08Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your bitbake build environment ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal window and navigate to your poky directory. We&#039;ll refer to this terminal as your &#039;bitbake terminal&#039;.&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK ==&lt;br /&gt;
&lt;br /&gt;
 bitbake -c populate_sdk_ext core-image-minimal&lt;br /&gt;
Alternatively, if you are based on a poky derivative for a particular release, you can download the minimal esdk and install it. For example, the pyro core-image-minimal esdk release for x86-64 is located [[http://downloads.yoctoproject.org/releases/yocto/yocto-2.3/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.3.sh here]].&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK ==&lt;br /&gt;
&lt;br /&gt;
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh&lt;br /&gt;
&lt;br /&gt;
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto&lt;br /&gt;
&lt;br /&gt;
If you are just using a kernel from somewhere else, for example kernel.org, you can just clone it instead of using devtool modify in this step.&lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;&lt;br /&gt;
&lt;br /&gt;
 . /path_to_esdk/environment-setup-corei7-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
NOTE: If you see the message below you will really need to open a new terminal :).&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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;
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Build your kernel (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto&lt;br /&gt;
and build the kernel&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes (ESDK terminal)==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.&lt;br /&gt;
 &lt;br /&gt;
== Build an image with your kernel changes (optional) (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
For faster iteration, in 2.4 some wic commands are being included to allow you to insert the kernel in an image without going through the full recreation of the image. For older releases you can do:&lt;br /&gt;
 sudo kpartx -a &amp;lt;foo&amp;gt;.wic&lt;br /&gt;
 sudo mount /dev/mapper/loopNpM /mnt/wic-partionM&lt;br /&gt;
In this case, it will be the next available loopback device. If you are not using any , it will be loop0. so in the std case it would look like&lt;br /&gt;
 sudo mount /dev/mapper/loop0p1 /mnt/wic-partion1&lt;br /&gt;
Then you could dd the kernel into the kernel partion.  Then unmount and unkaprtx...&lt;br /&gt;
 sudo umount mnt/wic-partionM&lt;br /&gt;
 sudo kaprtx -d /dev/loopN&lt;br /&gt;
&lt;br /&gt;
Note that this requires root/sudo rights. The assumption here is most kernel devs would have this or could do it in a vm/container.&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file (bitbake terminal) ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28183</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28183"/>
		<updated>2017-06-22T23:41:33Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Setup your ESDK build environment (ESDK terminal) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your bitbake build environment ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal window and navigat to your poky directory. We&#039;ll refer to this terminal as your &#039;bitbake terminal&#039;.&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 bitbake -c populate_sdk_ext core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh&lt;br /&gt;
&lt;br /&gt;
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;&lt;br /&gt;
&lt;br /&gt;
 . /path_to_esdk/environment-setup-corei7-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
NOTE: If you see the message below you will really need to open a new terminal :).&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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;
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Build your kernel (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto&lt;br /&gt;
and build the kernel&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes (ESDK terminal)==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.&lt;br /&gt;
 &lt;br /&gt;
== Build an image with your kernel changes (optional) (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file (bitbake terminal) ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28182</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28182"/>
		<updated>2017-06-22T23:41:16Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Setup your ESDK build environment (ESDK terminal) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your bitbake build environment ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal window and navigat to your poky directory. We&#039;ll refer to this terminal as your &#039;bitbake terminal&#039;.&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 bitbake -c populate_sdk_ext core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh&lt;br /&gt;
&lt;br /&gt;
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;&lt;br /&gt;
&lt;br /&gt;
 . /path_to_esdk/environment-setup-corei7-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
NOTE: If you see this message you will really need to open a new terminal :).&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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;
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Build your kernel (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto&lt;br /&gt;
and build the kernel&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes (ESDK terminal)==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.&lt;br /&gt;
 &lt;br /&gt;
== Build an image with your kernel changes (optional) (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file (bitbake terminal) ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28181</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28181"/>
		<updated>2017-06-22T23:40:51Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Setup your ESDK build environment (ESDK terminal) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your bitbake build environment ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal window and navigat to your poky directory. We&#039;ll refer to this terminal as your &#039;bitbake terminal&#039;.&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 bitbake -c populate_sdk_ext core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh&lt;br /&gt;
&lt;br /&gt;
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and setup your build environment. We&#039;ll refer to this terminal as your &#039;ESDK terminal&#039;&lt;br /&gt;
&lt;br /&gt;
 . /path_to_esdk/environment-setup-corei7-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
NOTE: If you see this message you will really need to open a new terminal :).&lt;br /&gt;
&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;
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.&lt;br /&gt;
&lt;br /&gt;
== Build your kernel (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto&lt;br /&gt;
and build the kernel&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes (ESDK terminal)==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.&lt;br /&gt;
 &lt;br /&gt;
== Build an image with your kernel changes (optional) (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file (bitbake terminal) ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28180</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28180"/>
		<updated>2017-06-22T23:39:49Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your bitbake build environment ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal window and navigat to your poky directory. We&#039;ll refer to this terminal as your &#039;bitbake terminal&#039;.&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Build Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 bitbake -c populate_sdk_ext core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Install Extensible SDK (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
The ESDK installer can be found in /path_to_build_directory/kernel-dev/tmp/deploy/sdk/&lt;br /&gt;
&lt;br /&gt;
 ./tmp/deploy/sdk/poky-glibc-x86_64-core-image-minimal-corei7-64-toolchain-ext-2.3.sh&lt;br /&gt;
&lt;br /&gt;
Follow the installer instructions and provide a target directory for your ESDK installation e.g /path_to_esdk/&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Setup your ESDK build environment (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and setup your build environment. Let&#039;s refer to this terminal as your &#039;ESDK terminal&#039;&lt;br /&gt;
&lt;br /&gt;
 . /path_to_esdk/environment-setup-corei7-64-poky-linux&lt;br /&gt;
&lt;br /&gt;
NOTE: If you see this message you will really need to open a new terminal :).&lt;br /&gt;
&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;
WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Build your kernel (ESDK terminal) ==&lt;br /&gt;
&lt;br /&gt;
Navigate to your workspace directory e.g /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto&lt;br /&gt;
and build the kernel&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes (ESDK terminal)==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel. Commit your kernel changes.&lt;br /&gt;
 &lt;br /&gt;
== Build an image with your kernel changes (optional) (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file (bitbake terminal) ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image with your modified kernel (bitbake terminal) ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28137</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28137"/>
		<updated>2017-06-21T23:59:15Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your environment ==&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Modify your kernel and commit your changes ==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel.&lt;br /&gt;
&lt;br /&gt;
== Build your kernel ==&lt;br /&gt;
&lt;br /&gt;
Build the kernel in your workspace directory&lt;br /&gt;
&lt;br /&gt;
 devtool build linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Build an image with your kernel changes ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28136</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=28136"/>
		<updated>2017-06-21T23:58:53Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: Created page with &amp;quot;= Overview =  This manual describes the Linux kernel development process with Yocto and devtool.  == Setup your environment ==  The following command will configure the Yocto ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This manual describes the Linux kernel development process with Yocto and devtool.&lt;br /&gt;
&lt;br /&gt;
== Setup your environment ==&lt;br /&gt;
&lt;br /&gt;
The following command will configure the Yocto build environment&lt;br /&gt;
&lt;br /&gt;
 source poky/oe-init-build-env kernel-dev&lt;br /&gt;
&lt;br /&gt;
== Checkout the kernel source tree and construct .config ==&lt;br /&gt;
&lt;br /&gt;
Check out the Linux kernel source and construct a .config from the Yocto kernel configuration segments. The sources can be found in /path_to_build_directory/kernel-dev/workspace/sources/linux-yocto.&lt;br /&gt;
&lt;br /&gt;
 devtool modify linux-yocto &lt;br /&gt;
 &lt;br /&gt;
== Modify your kernel and commit your changes ==&lt;br /&gt;
&lt;br /&gt;
You can navigate to the Linux source directory (/path_to_build_directory/kernel-dev/workspace/sources/linux-yocto) and modify the kernel.&lt;br /&gt;
&lt;br /&gt;
== Build your kernel ==&lt;br /&gt;
&lt;br /&gt;
Build the kernel in your workspace directory&lt;br /&gt;
&lt;br /&gt;
 devtool build linux-yocto &lt;br /&gt;
&lt;br /&gt;
== Build an image with your kernel changes ==&lt;br /&gt;
&lt;br /&gt;
 devtool build-image core-image-minimal&lt;br /&gt;
&lt;br /&gt;
== Export patches and create a bbappend file ==&lt;br /&gt;
To export your commits to patches and a bbappend file use the following command. &lt;br /&gt;
&lt;br /&gt;
 devtool finish linux-yocto /path_to_poky_directory/meta-yocto-bsp/&lt;br /&gt;
&lt;br /&gt;
The patches and the bbappend can be found in /path_to_poky_directory/meta-yocto-bsp/recipes-kernel/linux.&lt;br /&gt;
&lt;br /&gt;
== Build image ==&lt;br /&gt;
&lt;br /&gt;
You can now build an image which will include your kernel patches.&lt;br /&gt;
&lt;br /&gt;
Execute the following command from your build directory ( e.g /path_to_build_directory/kernel-dev/)&lt;br /&gt;
&lt;br /&gt;
 bitbake core-image-minimal&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks&amp;diff=28135</id>
		<title>TipsAndTricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks&amp;diff=28135"/>
		<updated>2017-06-21T23:27:31Z</updated>

		<summary type="html">&lt;p&gt;Todor Minchev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
This wiki page captures ideas for &amp;quot;Tips and tricks&amp;quot; articles that are aimed Yocto Project users that have a basic understanding of the core tools and want to extend their knowledge. Articles will written and published using the following process&lt;br /&gt;
* Articles must refer to the current (or earlier) release. They must not cover features in development in the master branch.&lt;br /&gt;
* Anyone can add entries to the &#039;&#039;&#039;Ideas for Articles&#039;&#039;&#039; section based on challenges they have encountered when using the Yocto Project&lt;br /&gt;
* More experienced developers can start to flesh out articles in the &#039;&#039;Ideas&#039;&#039; section move then to &#039;&#039;&#039;Articles in Development&#039;&#039;&#039; or contribute directly to this section.&lt;br /&gt;
* Approximately once a month an article ready for publishing will be chosen for publication by [mailto:jeffrey.osier-mixon@intel.com Jefro] and moved to the &#039;&#039;&#039;Finished Articles &#039;&#039;&#039; section. &lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:henry.bruce@intel.com?Subject=Yocto%20Project%20Tips%20and%20Tricks Henry Bruce] with any questions.&lt;br /&gt;
&lt;br /&gt;
== Ideas for Articles ==&lt;br /&gt;
* [[TipsAndTricks/GeneratingASDK]] (Ross, Paul help please...)&lt;br /&gt;
* [[TipsAndTricks/AddingALicense]] (Ross)&lt;br /&gt;
* [[TipsAndTricks/UsingBuildstatsDiff]] (Ross)&lt;br /&gt;
* [[TipsAndTricks/DevPyShell]] (Richard Purdie)&lt;br /&gt;
* [[TipsAndTricks/CreatingABSP]]. And what not to put in it.&lt;br /&gt;
* [[TipsAndTricks/Patchwork]]&lt;br /&gt;
* [[TipsAndTricks/Patchtest]] (Leo)&lt;br /&gt;
* [[TipsAndTricks/CreateNewLayer]] (Brendan)&lt;br /&gt;
* [[TipsAndTricks/DockerOnImage]] (bavery)&lt;br /&gt;
&lt;br /&gt;
== Articles in development ==&lt;br /&gt;
* [[TipsAndTricks/KernelDevelopment]] (Todor Minchev)&lt;br /&gt;
* [[TipsAndTricks/DebugNativeRecipeWithGdb]] (Joshua Lock)&lt;br /&gt;
* [[TipsAndTricks/Netconsole]] (Ross Burton)&lt;br /&gt;
* [[TipsAndTricks/ParsingProfiling]] (Richard Purdie)&lt;br /&gt;
* [[TipsAndTricks/DemystifyingTheLinuxYoctoKernel]] (Tom Zanussi)&lt;br /&gt;
* [[TipsAndTricks/Patching the source for a recipe]] (Paul Eggleton)&lt;br /&gt;
* [[TipsAndTricks/Incorporating closed source components]] (Paul Eggleton)&lt;br /&gt;
* [[TipsAndTricks/DebuggingAvoidingRebuilds]] (Richard Purdie)&lt;br /&gt;
* [[TipsAndTricks/GitBisectABitbake]]  (Ross)&lt;br /&gt;
* [[TipsAndTricks/RunningEclipseAgainstBuiltImage]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/PrelinkSomePointersAndWorkarounds]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/RunningQemuOnMacOSX]] (Stephano)&lt;br /&gt;
* [[TipsAndTricks/Understanding what changed (diffsigs etc)]] (Joshua)&lt;br /&gt;
* [[TipsAndTricks/CropsCLIContainers]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/QuickAndDirtyKernelConfig]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/TestingToasterWithContainers]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/InvestigatingBuildTime]] (Leo Sandoval)&lt;br /&gt;
* [[TipsAndTricks/ResolvingLocaleIssues]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/DebuggingBitbakeInPudb]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/DebuggingBitbakeInWingIDE]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/CliBuildsInToasterBuilddir]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/BuildingZephyrImages]] (Henry)&lt;br /&gt;
* [[TipsAndTricks/Cmake,Eclipse, and SDKS]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/LinuxKernelAndSDKs]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/Running YP binaries on Ubuntu and Vice Versa]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/LockSharedState]] (Stephano)&lt;br /&gt;
* [[TipsAndTricks/Building and booting for Joule or MinnowBoard]] (Cal)&lt;br /&gt;
* [[TipsAndTricks/EnablingAPackageFeed]] (Henry)&lt;br /&gt;
* [[TipsAndTricks/Creating Recipes for ROS modules]] (Henry)&lt;br /&gt;
&lt;br /&gt;
== Finished Articles ==&lt;br /&gt;
* [[TipsAndTricks/Packaging Prebuilt Libraries | Packaging Prebuilt Libraries]] (Ross and Henry)&lt;br /&gt;
* [[TipsAndTricks/NPM | Packaging Node.js Projects]]  (Brendan and Henry)&lt;/div&gt;</summary>
		<author><name>Todor Minchev</name></author>
	</entry>
</feed>