<?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=Bavery</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=Bavery"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/Bavery"/>
	<updated>2026-06-04T11:16:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32798</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32798"/>
		<updated>2017-11-03T01:03:04Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will be.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt;to making a quick build! Here&#039;s a  sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note, time to image is only 2 1/2 minutes . Pretty nice!&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;br /&gt;
= Results = &lt;br /&gt;
* Time to build core-image-minimal leveraging a release sstate-mirror - 2.5 minutes&lt;br /&gt;
* Cost on AWS (on demand cost which is higher than spot) - $0.29&lt;br /&gt;
** this includes me pulling in the necessary build dependencies, cloning poky, and building.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32797</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32797"/>
		<updated>2017-11-03T01:00:32Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will be.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt;to making a quick build! Here&#039;s a  sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note, time to image is only 2 1/2 minutes . Pretty nice!&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;br /&gt;
= Results = &lt;br /&gt;
* Time to build core-image-minimal leveraging a release sstate-mirror - 2.5 minutes&lt;br /&gt;
* Cost on AWS (on demand cost which is higher than spot) - $0.29&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32783</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32783"/>
		<updated>2017-11-02T01:18:21Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* After you have successfully ssh&amp;#039;ed into your EC2 Instance, what now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will be.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt;to making a quick build! Here&#039;s a  sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note, time to image is only 2 1/2 minutes . Pretty nice!&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32782</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32782"/>
		<updated>2017-11-02T01:17:20Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* After you have successfully ssh&amp;#039;ed into your EC2 Instance, what now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will be.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32781</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32781"/>
		<updated>2017-11-02T01:16:23Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* What&amp;#039;s the Big Deal? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32780</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32780"/>
		<updated>2017-11-02T01:16:07Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;br /&gt;
* make sure to terminate the instance when you are done with it. this will delete the files, so make sure you have what you want saved.&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the Big Deal? =&lt;br /&gt;
Nothing, really. The point of this very short article is that it is trivial to get an EC2 instance up that can build a YP image and do so in a very short time, assuming you leverage our sstate mirrors.&lt;br /&gt;
Note: The free tier instance type &amp;lt;italic&amp;gt;t2.micro&amp;lt;/italic&amp;gt; can NOT build core-image-minimal as it runs out of ram in it&#039;s default configuration.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32779</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32779"/>
		<updated>2017-11-02T01:11:52Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* After you have successfully ssh&amp;#039;ed into your EC2 Instance, what now? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32778</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32778"/>
		<updated>2017-11-02T01:11:31Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
=== Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32777</id>
		<title>TipsAndTricks/Building core-image-minimal on AWS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/Building_core-image-minimal_on_AWS&amp;diff=32777"/>
		<updated>2017-11-02T01:11:17Z</updated>

		<summary type="html">&lt;p&gt;Bavery: Created page with &amp;quot;= Sometimes, a Cloud Server is just easier =  I won&amp;#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&amp;#039;ll outline what I did and how long...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sometimes, a Cloud Server is just easier =&lt;br /&gt;
&lt;br /&gt;
I won&#039;t rehash the already very good instructions on how to create an EC2 instance. Instead, I&#039;ll outline what I did and how long it took.&lt;br /&gt;
Here&#039;s a good starting point to get an EC2 instance up and connect to it: [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html]&lt;br /&gt;
&lt;br /&gt;
= My Setup =  &lt;br /&gt;
Machine (AMI) Chosen - Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-6e1a0117&lt;br /&gt;
Instance Type - m4.xlarge (4 cpu, 16 Gb memory, high network performance )&lt;br /&gt;
 === Changes from Default ===&lt;br /&gt;
* I have a security group that allows ssh/http/https/icmp from my ip into my AWS instances, I chose this security group.&lt;br /&gt;
* I upped storage to 90 GB; note since everything was setscened using sstate, I only ended up using 1.7Gb total ,&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 du -sh ~/work&lt;br /&gt;
 1.7G	/home/ubuntu/work &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
= After you have successfully ssh&#039;ed into your EC2 Instance, what now? =&lt;br /&gt;
* From the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html quick start guide], you can just cut and paste the sudo apt-get install line for ubuntu.&lt;br /&gt;
* clone poky as usual: &amp;lt;code&amp;gt; $ git clone git://git.yoctoproject.org/poky &amp;lt;/code&amp;gt; and checkout the release: &amp;lt;code&amp;gt; $ git checkout yocto-2.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
** Note: the sstate for the rolling branch (in this case rocko) may not be available, but the tagged sstate will.&lt;br /&gt;
* set up the environment &amp;lt;code&amp;gt; $ . ./poky/oe-init-build-env &amp;lt;/code&amp;gt;&lt;br /&gt;
* create (or cp ) a site.conf into the conf directory that leverages the sstate YP publishes. This is &amp;lt;strong&amp;gt; key &amp;lt;/strong&amp;gt; Sample site.conf, (this was done for the 2.4 release):&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 SSTATE_MIRRORS = &amp;quot;\&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/2.4/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \&lt;br /&gt;
 &amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* build it &amp;lt;code&amp;gt; $ time bitbake core-image-minimal &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; &lt;br /&gt;
 ... many setscene tasks ...&lt;br /&gt;
 NOTE: Executing SetScene Tasks&lt;br /&gt;
 NOTE: Executing RunQueue Tasks&lt;br /&gt;
 NOTE: Tasks Summary: Attempted 2384 tasks of which 2177 didn&#039;t need to be rerun and all succeeded.&lt;br /&gt;
&lt;br /&gt;
 real	2m26.947s&lt;br /&gt;
 user	0m5.832s&lt;br /&gt;
 sys	0m0.924s&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
* you could then rsync the images or whatever else you&#039;d like to grab from the instance. or store it on S3, or ...&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks&amp;diff=32776</id>
		<title>TipsAndTricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks&amp;diff=32776"/>
		<updated>2017-11-02T00:40:00Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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/JenkinsPipelinesForContinuousIntegration]] (Tim Orling)&lt;br /&gt;
&lt;br /&gt;
== Articles in development ==&lt;br /&gt;
* [[TipsAndTricks/Building core-image-minimal on AWS]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/DockerOnImage]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/BuildingAndRunningClearContainersonTarget]] (bavery)&lt;br /&gt;
* [[TipsAndTricks/KernelDevelopmentWithEsdk]] (Todor Minchev, Henry Bruce)&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;
* [[TipsAndTricks/TeamWorkflows]] (Joshua)&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32483</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32483"/>
		<updated>2017-10-19T22:25:15Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* DEPRECATED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &amp;lt;strong&amp;gt;DEPRECATED&amp;lt;/strong&amp;gt; =&lt;br /&gt;
&amp;lt;strong&amp;gt;&amp;lt;p&amp;gt; There is now a http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-clear-containers/ layer that can be built as part of a standard YP build. &amp;lt;/p&amp;gt;&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Historical value only =&lt;br /&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32482</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32482"/>
		<updated>2017-10-19T22:24:43Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* DEPRECATED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &amp;lt;strong&amp;gt;DEPRECATED&amp;lt;/strong&amp;gt; =&lt;br /&gt;
&amp;lt;strong&amp;gt;&amp;lt;p&amp;gt; There is now a http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-clear-containers/ layer that can be built as part of a standard YP build. &amp;lt;/p&amp;gt;&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32481</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=32481"/>
		<updated>2017-10-19T22:24:33Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &amp;lt;strong&amp;gt;DEPRECATED&amp;lt;strong&amp;gt; =&lt;br /&gt;
&amp;lt;strong&amp;gt;&amp;lt;p&amp;gt; There is now a http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-clear-containers/ layer that can be built as part of a standard YP build. &amp;lt;/p&amp;gt;&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=32120</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=32120"/>
		<updated>2017-10-04T19:50:43Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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;
 $ cd ~&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;
&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;
== 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;
== Create a Layer ==&lt;br /&gt;
We also need to create a layer to take the kernel patches we&#039;ll be creating.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ~/poky&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] &lt;br /&gt;
 Would you like to have an example bbappend file created? (y/n) [default: n]&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;
 $ cd ~/poky/build&lt;br /&gt;
 $ bitbake-layers add-layer ../../meta-my-kernel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
Alternatively, you can run&lt;br /&gt;
 $ devtool build linux-yocto&lt;br /&gt;
&lt;br /&gt;
=== Create image with new kernel  2.4 Way ===&lt;br /&gt;
Note: There are several bugs outstanding to make this process a little easier as of 9/2017.  They mostly deal with unwieldy paths and are easy to work around. I will detail the workarounds here and if it is clear that you don&#039;t need them due to the bugs getting fixed and merged, so much the better.  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Below I detail using kpartx to pull apart a wic image so you can just copy your kernel (and other artifacts if needed like a dtd) into the image to shorten turnaround time.  In this section, we will exploit the new features in wic that allow us to do the same thing but easier. This does require you to install the host side mtools package, currently.&lt;br /&gt;
&lt;br /&gt;
==== Image manipulation with wic to facilitate kernel development ====&lt;br /&gt;
* See what&#039;s in your image:&lt;br /&gt;
  $ wic ls /tmp/core-image-base-qemux86-64.wic &lt;br /&gt;
  Num     Start        End          Size      Fstype&lt;br /&gt;
   1       1048576     25534463     24485888  fat16&lt;br /&gt;
   2      26214400  13938011135  13911796736  ext4&lt;br /&gt;
* See what&#039;s in your partition:&lt;br /&gt;
 $ wic ls /tmp/core-image-base-qemux86-64.wic:1&lt;br /&gt;
&lt;br /&gt;
If you see the following error:&lt;br /&gt;
  ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned &#039;1&#039; instead of 0&lt;br /&gt;
  output: Total number of sectors (47824) not a multiple of sectors per track (32)!&lt;br /&gt;
  Add mtools_skip_check=1 to your .mtoolsrc file to skip this test&lt;br /&gt;
Just do what it says and put &lt;br /&gt;
 mtools_skip_check=1 &lt;br /&gt;
into your ~/.mtoolsrc file and you will get:&lt;br /&gt;
 $wic ls /tmp/core-image-base-qemux86-64.wic:1&lt;br /&gt;
 Volume in drive : is boot       &lt;br /&gt;
  Volume Serial Number is 6BF1-7DEC &lt;br /&gt;
 Directory for ::/&lt;br /&gt;
&lt;br /&gt;
 libcom32 c32    186500 2017-10-03  21:53 &lt;br /&gt;
 libutil  c32     24148 2017-10-03  21:53 &lt;br /&gt;
 syslinux cfg       220 2017-10-03  21:53 &lt;br /&gt;
 vesamenu c32     27104 2017-10-03  21:53 &lt;br /&gt;
 vmlinuz        7397936 2017-10-03  21:53 &lt;br /&gt;
        5 files           7 635 908 bytes&lt;br /&gt;
                         16 582 656 bytes free&lt;br /&gt;
&lt;br /&gt;
* remove the old kernel from your image:&lt;br /&gt;
 $ wic rm /tmp/core-image-base-qemux86-64.wic:1/vmlinuz&lt;br /&gt;
* add in your freshly constructed kernel.&lt;br /&gt;
** if you built the kernel with devtool, the resulting bzImage is in the tmp/work directory as below.&lt;br /&gt;
 $ wic cp ~/poky_sdk/tmp/work/qemux86_64-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage /tmp/core-image-base-qemux86-64.wic:1/vmlinuz&lt;br /&gt;
** if you built it straight with make in the workspace/linux-yocto directory, it is in a more standard place:&lt;br /&gt;
 $  cp workspace/sources/linux-yocto/arch/x86/boot/bzImage /tmp/core-image-base-qemux86-64.wic:1/vmlinuz&lt;br /&gt;
&lt;br /&gt;
* then you can dd your wic image onto a sd card/usb key and you can test your target.&lt;br /&gt;
** note: bmap-copy using the bmap tools is generally ~ 10x-20x faster than a straight dd. Docs -&amp;gt; [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#flashing-images-using-bmaptool Official bmaptool copy docs]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create image with new kernel Pre 2.4 Way ===&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 several minutes 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. NOTE: 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 is automatically allocated. The example command output here uses a variable &amp;quot;X&amp;quot; to indicate the loopback device.  The actual output you get when you run the command will list the actual loopback devices (e.g. &amp;quot;loop0p1&amp;quot;, &amp;quot;loop0p2&amp;quot;, and &amp;quot;loop0p3&amp;quot;).&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 loop0p1).&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 &amp;quot;loopX&amp;quot; with the automatically allocated loopback device from earlier (e.g &amp;quot;loop0&amp;quot;).&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=32119</id>
		<title>TipsAndTricks/KernelDevelopmentWithEsdk</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/KernelDevelopmentWithEsdk&amp;diff=32119"/>
		<updated>2017-10-04T18:26:00Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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;
 $ cd ~&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;
&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;
== 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;
== Create a Layer ==&lt;br /&gt;
We also need to create a layer to take the kernel patches we&#039;ll be creating.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ cd ~/poky&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] &lt;br /&gt;
 Would you like to have an example bbappend file created? (y/n) [default: n]&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;
 $ cd ~/poky/build&lt;br /&gt;
 $ bitbake-layers add-layer ../../meta-my-kernel&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&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;
Alternatively, you can run&lt;br /&gt;
 $ devtool build linux-yocto&lt;br /&gt;
&lt;br /&gt;
=== Create image with new kernel  2.4 Way ===&lt;br /&gt;
Note: There are several bugs outstanding to make this process a little easier as of 9/2017.  They mostly deal with unwieldy paths and are easy to work around. I will detail the workarounds here and if it is clear that you don&#039;t need them due to the bugs getting fixed and merged, so much the better.  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Below I detail using kpartx to pull apart a wic image so you can just copy your kernel (and other artifacts if needed like a dtd) into the image to shorten turnaround time.  In this section, we will exploit the new features in wic that allow us to do the same thing but easier. This does require you to install the host side mtools package, currently.&lt;br /&gt;
&lt;br /&gt;
==== Image manipulation with wic to facilitate kernel development ====&lt;br /&gt;
* See what&#039;s in your image:&lt;br /&gt;
  $ wic ls /tmp/core-image-base-qemux86-64.wic &lt;br /&gt;
  Num     Start        End          Size      Fstype&lt;br /&gt;
   1       1048576     25534463     24485888  fat16&lt;br /&gt;
   2      26214400  13938011135  13911796736  ext4&lt;br /&gt;
* See what&#039;s in your partition:&lt;br /&gt;
 $ wic ls /tmp/core-image-base-qemux86-64.wic:1&lt;br /&gt;
&lt;br /&gt;
If you see the following error:&lt;br /&gt;
  ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned &#039;1&#039; instead of 0&lt;br /&gt;
  output: Total number of sectors (47824) not a multiple of sectors per track (32)!&lt;br /&gt;
  Add mtools_skip_check=1 to your .mtoolsrc file to skip this test&lt;br /&gt;
Just do what it says and put &lt;br /&gt;
 mtools_skip_check=1 &lt;br /&gt;
into your ~/.mtoolsrc file and you will get:&lt;br /&gt;
 $wic ls /tmp/core-image-base-qemux86-64.wic:1&lt;br /&gt;
 Volume in drive : is boot       &lt;br /&gt;
  Volume Serial Number is 6BF1-7DEC &lt;br /&gt;
 Directory for ::/&lt;br /&gt;
&lt;br /&gt;
 libcom32 c32    186500 2017-10-03  21:53 &lt;br /&gt;
 libutil  c32     24148 2017-10-03  21:53 &lt;br /&gt;
 syslinux cfg       220 2017-10-03  21:53 &lt;br /&gt;
 vesamenu c32     27104 2017-10-03  21:53 &lt;br /&gt;
 vmlinuz        7397936 2017-10-03  21:53 &lt;br /&gt;
        5 files           7 635 908 bytes&lt;br /&gt;
                         16 582 656 bytes free&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create image with new kernel Pre 2.4 Way ===&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 several minutes 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. NOTE: 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 is automatically allocated. The example command output here uses a variable &amp;quot;X&amp;quot; to indicate the loopback device.  The actual output you get when you run the command will list the actual loopback devices (e.g. &amp;quot;loop0p1&amp;quot;, &amp;quot;loop0p2&amp;quot;, and &amp;quot;loop0p3&amp;quot;).&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 loop0p1).&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 &amp;quot;loopX&amp;quot; with the automatically allocated loopback device from earlier (e.g &amp;quot;loop0&amp;quot;).&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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31750</id>
		<title>TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31750"/>
		<updated>2017-09-20T18:24:45Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Ways to Serve up the rpm repo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Leveraging Pkg Feeds or How I got Tired of Burning Images =&lt;br /&gt;
I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I tend to do this first, if I want to make a recipe from scratch for software that I am not too familiar with.  This way, I can follow the instructions for building w/o reinterpretation, verify that I have or can build the necessary dependencies, and check that the sw works properly; all before diving into recipes.  I have found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.&lt;br /&gt;
&amp;lt;strong&amp;gt; Note: This works as well with kernel modules as it does with libraries/binaries&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this example, we will be building znc 1.6.5, an irc bouncer.  This is just a good complex example.   In order to use this guide, you should set up your bitbake environment and your target as outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]&lt;br /&gt;
== Steps ==&lt;br /&gt;
* It&#039;s typically easies to make an image that has *most* of what you think you&#039;ll need. In this example, I added the following to my local.conf:&lt;br /&gt;
  EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile &amp;quot;&lt;br /&gt;
* Now I&#039;ll grab the src code we will try to build &amp;lt;strong&amp;gt;Note: this is an ON TARGET build&amp;lt;/strong&amp;gt; the build host side is just for the dependencies...&lt;br /&gt;
 git clone https://github.com/znc/znc.git&lt;br /&gt;
 cd znc&lt;br /&gt;
 git checkout -b 1.6.5 znc-1.6.5&lt;br /&gt;
 * follow the build instructions&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure&lt;br /&gt;
This worked, but we decide we want to have cyrus support as well.&lt;br /&gt;
* First we try &lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
but we get&lt;br /&gt;
 configure: error: could not find libsasl2. Try --disable-cyrus.&lt;br /&gt;
&lt;br /&gt;
* So we need the cyrus-sals-dev pkg.  If we aren&#039;t sure where that is, we can use [https://layers.openembedded.org/layerindex/branch/master/layers/ openembedded layer index] and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.&lt;br /&gt;
  bitbake cyrus-sasl&lt;br /&gt;
and remake the package index&lt;br /&gt;
 bitbake package-index&lt;br /&gt;
* target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.&lt;br /&gt;
 $dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)&lt;br /&gt;
If this fails, make sure you followed the instructions in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]. You should have set up the on target repo in  /etc/yum.repos.d/myrepo.repo and have a web server of some type pointed to tmp/deploy/rpm (like twistd -n web --path tmp/deploy/rpm -p 5678) on your build host.&lt;br /&gt;
* now we rerun configure and get:&lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
&lt;br /&gt;
  ZNC 1.6.5 configured&lt;br /&gt;
 prefix:       /usr/local&lt;br /&gt;
 debug:        no&lt;br /&gt;
 ipv6:         yes&lt;br /&gt;
 openssl:      yes&lt;br /&gt;
 dns:          threads&lt;br /&gt;
 perl:         no&lt;br /&gt;
 python:       no&lt;br /&gt;
 swig:         not needed&lt;br /&gt;
 cyrus:        yes&lt;br /&gt;
 tcl:          no&lt;br /&gt;
 charset:      yes&lt;br /&gt;
 zlib:         yes&lt;br /&gt;
 run from src: no&lt;br /&gt;
&lt;br /&gt;
Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects. &lt;br /&gt;
* Let&#039;s build it&lt;br /&gt;
 ~/znc# make&lt;br /&gt;
 Packing man page znc.1.gz...&lt;br /&gt;
 Packing man page znc-buildmod.1.gz...&lt;br /&gt;
 It looks like git submodules are not initialized. Run: git submodule update --init --recursive&lt;br /&gt;
 make: *** [Makefile:168: third_party/Csocket/Csocket.h] Error 1&lt;br /&gt;
 ~/znc# git submodule update --init --recursive&lt;br /&gt;
 git: &#039;submodule&#039; is not a git command. See &#039;git --help&#039;.&lt;br /&gt;
Whoops, we need git submodule...  This one is harder to find. After verifying that we already have git-dev installed, I ended up searching the poky tree for git-submodule&lt;br /&gt;
 $ git grep git-submodule&lt;br /&gt;
 bitbake/lib/bb/tests/fetch.py:            fetcher = bb.fetch.Fetch([&amp;quot;gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165&lt;br /&gt;
 meta/recipes-devtools/git/git.inc:    ${libexecdir}/git-core/git-submodule \&lt;br /&gt;
If we look in meta/recipes-devtools/git/git.inc we can see that the git-submodule is included in git-perltools:&lt;br /&gt;
 PACKAGES =+ &amp;quot;${PN}-perltools&amp;quot;.&lt;br /&gt;
So we can pull in the git-perltools as well on the target:&lt;br /&gt;
 # dnf install git-perltools&lt;br /&gt;
and rerun the git submodule init&lt;br /&gt;
 # git submodule update --init --recursive&lt;br /&gt;
 Submodule &#039;Csocket&#039; (https://github.com/jimloco/Csocket.git) registered for path &#039;third_party/Csocket&#039;&lt;br /&gt;
 Cloning into &#039;/home/root/znc/third_party/Csocket&#039;...&lt;br /&gt;
 Submodule path &#039;third_party/Csocket&#039;: checked out &#039;448e18a29ed383451db3cb648a72da4fcbb3f8e5&#039;&lt;br /&gt;
&lt;br /&gt;
It worked :), and now we can successfully type make.  Having to reflash the image for each of these steps would have been much slower!&lt;br /&gt;
 # make&lt;br /&gt;
 Building module autocycle...&lt;br /&gt;
 Linking  module autocycle...&lt;br /&gt;
 ...&lt;br /&gt;
 Building core object SSLVerifyHost...&lt;br /&gt;
 Linking znc...&lt;br /&gt;
&lt;br /&gt;
 ZNC was successfully compiled.&lt;br /&gt;
 Use &#039;make install&#039; to install ZNC to &#039;/usr/local&#039;.&lt;br /&gt;
&lt;br /&gt;
* I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:&lt;br /&gt;
 $ bitbake zile&lt;br /&gt;
 $ bitbake package-index&lt;br /&gt;
Target -&amp;gt;&lt;br /&gt;
 # dnf install zile&lt;br /&gt;
&lt;br /&gt;
== Ways to Serve up the rpm repo == &lt;br /&gt;
&lt;br /&gt;
* very simple - use python twistd.&lt;br /&gt;
** let&#039;s suppose you have an rpm repo on the host that is in dir /home/me/mrrepo.  &lt;br /&gt;
** &amp;lt;code &amp;gt; &lt;br /&gt;
     cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path . -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
** similarly, if you are just serving up the build directories rpm&#039;s you can just do &lt;br /&gt;
*** &amp;lt;code &amp;gt; &lt;br /&gt;
     cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path tmp/deploy/rpm -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
***  Note , only 1 process can own a given port.&lt;br /&gt;
* less simple, but better response and better stability- use lighthttpd.  &lt;br /&gt;
** I advocate using this from a container as it is simpler to maintain.&lt;br /&gt;
** &amp;lt;code&amp;gt;&lt;br /&gt;
  docker run -it --rm --name user-rpm-server -v /home/me/mrrepo:/var/www/localhost/htdocs -v /home/me/lighttpd:/etc/lighttpd -p 5678:80 sebp/lighttpd &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** What goes in /home/me/lighttpd? the config for the lighthttpd container you are running.&lt;br /&gt;
** Where did they come from? Copied from inside the container &lt;br /&gt;
*** &amp;lt;code&amp;gt; docker run -it --rm --user=root --entrypoint=/bin/sh -v /home/me/lighttpd:/frog sebp/lighttpd &amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt; # cp -a /etc/lighttpd/* /frog &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Now your /home/me/lightppd has the necessary config files.&lt;br /&gt;
** The files in /home/me/lighthttpd:&lt;br /&gt;
*** lighttpd.conf  lighttpd.conf~  mime-types.conf  mod_cgi.conf  mod_fastcgi.conf  mod_fastcgi_fpm.conf&lt;br /&gt;
**** From this you can see I run emacs.  The only change I did was to turn on directory listing .&lt;br /&gt;
**** diff  lighttpd.conf  lighttpd.conf~&lt;br /&gt;
*****  &amp;lt;code&amp;gt; &lt;br /&gt;
 114c114&lt;br /&gt;
 &amp;lt; dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; #   dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
** the  -p 5678:80  exposes the default port the container runs it&#039;s service (aka 80)  on to the host port 5678.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31749</id>
		<title>TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31749"/>
		<updated>2017-09-20T18:24:05Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Ways to Serve up the rpm repo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Leveraging Pkg Feeds or How I got Tired of Burning Images =&lt;br /&gt;
I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I tend to do this first, if I want to make a recipe from scratch for software that I am not too familiar with.  This way, I can follow the instructions for building w/o reinterpretation, verify that I have or can build the necessary dependencies, and check that the sw works properly; all before diving into recipes.  I have found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.&lt;br /&gt;
&amp;lt;strong&amp;gt; Note: This works as well with kernel modules as it does with libraries/binaries&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this example, we will be building znc 1.6.5, an irc bouncer.  This is just a good complex example.   In order to use this guide, you should set up your bitbake environment and your target as outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]&lt;br /&gt;
== Steps ==&lt;br /&gt;
* It&#039;s typically easies to make an image that has *most* of what you think you&#039;ll need. In this example, I added the following to my local.conf:&lt;br /&gt;
  EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile &amp;quot;&lt;br /&gt;
* Now I&#039;ll grab the src code we will try to build &amp;lt;strong&amp;gt;Note: this is an ON TARGET build&amp;lt;/strong&amp;gt; the build host side is just for the dependencies...&lt;br /&gt;
 git clone https://github.com/znc/znc.git&lt;br /&gt;
 cd znc&lt;br /&gt;
 git checkout -b 1.6.5 znc-1.6.5&lt;br /&gt;
 * follow the build instructions&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure&lt;br /&gt;
This worked, but we decide we want to have cyrus support as well.&lt;br /&gt;
* First we try &lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
but we get&lt;br /&gt;
 configure: error: could not find libsasl2. Try --disable-cyrus.&lt;br /&gt;
&lt;br /&gt;
* So we need the cyrus-sals-dev pkg.  If we aren&#039;t sure where that is, we can use [https://layers.openembedded.org/layerindex/branch/master/layers/ openembedded layer index] and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.&lt;br /&gt;
  bitbake cyrus-sasl&lt;br /&gt;
and remake the package index&lt;br /&gt;
 bitbake package-index&lt;br /&gt;
* target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.&lt;br /&gt;
 $dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)&lt;br /&gt;
If this fails, make sure you followed the instructions in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]. You should have set up the on target repo in  /etc/yum.repos.d/myrepo.repo and have a web server of some type pointed to tmp/deploy/rpm (like twistd -n web --path tmp/deploy/rpm -p 5678) on your build host.&lt;br /&gt;
* now we rerun configure and get:&lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
&lt;br /&gt;
  ZNC 1.6.5 configured&lt;br /&gt;
 prefix:       /usr/local&lt;br /&gt;
 debug:        no&lt;br /&gt;
 ipv6:         yes&lt;br /&gt;
 openssl:      yes&lt;br /&gt;
 dns:          threads&lt;br /&gt;
 perl:         no&lt;br /&gt;
 python:       no&lt;br /&gt;
 swig:         not needed&lt;br /&gt;
 cyrus:        yes&lt;br /&gt;
 tcl:          no&lt;br /&gt;
 charset:      yes&lt;br /&gt;
 zlib:         yes&lt;br /&gt;
 run from src: no&lt;br /&gt;
&lt;br /&gt;
Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects. &lt;br /&gt;
* Let&#039;s build it&lt;br /&gt;
 ~/znc# make&lt;br /&gt;
 Packing man page znc.1.gz...&lt;br /&gt;
 Packing man page znc-buildmod.1.gz...&lt;br /&gt;
 It looks like git submodules are not initialized. Run: git submodule update --init --recursive&lt;br /&gt;
 make: *** [Makefile:168: third_party/Csocket/Csocket.h] Error 1&lt;br /&gt;
 ~/znc# git submodule update --init --recursive&lt;br /&gt;
 git: &#039;submodule&#039; is not a git command. See &#039;git --help&#039;.&lt;br /&gt;
Whoops, we need git submodule...  This one is harder to find. After verifying that we already have git-dev installed, I ended up searching the poky tree for git-submodule&lt;br /&gt;
 $ git grep git-submodule&lt;br /&gt;
 bitbake/lib/bb/tests/fetch.py:            fetcher = bb.fetch.Fetch([&amp;quot;gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165&lt;br /&gt;
 meta/recipes-devtools/git/git.inc:    ${libexecdir}/git-core/git-submodule \&lt;br /&gt;
If we look in meta/recipes-devtools/git/git.inc we can see that the git-submodule is included in git-perltools:&lt;br /&gt;
 PACKAGES =+ &amp;quot;${PN}-perltools&amp;quot;.&lt;br /&gt;
So we can pull in the git-perltools as well on the target:&lt;br /&gt;
 # dnf install git-perltools&lt;br /&gt;
and rerun the git submodule init&lt;br /&gt;
 # git submodule update --init --recursive&lt;br /&gt;
 Submodule &#039;Csocket&#039; (https://github.com/jimloco/Csocket.git) registered for path &#039;third_party/Csocket&#039;&lt;br /&gt;
 Cloning into &#039;/home/root/znc/third_party/Csocket&#039;...&lt;br /&gt;
 Submodule path &#039;third_party/Csocket&#039;: checked out &#039;448e18a29ed383451db3cb648a72da4fcbb3f8e5&#039;&lt;br /&gt;
&lt;br /&gt;
It worked :), and now we can successfully type make.  Having to reflash the image for each of these steps would have been much slower!&lt;br /&gt;
 # make&lt;br /&gt;
 Building module autocycle...&lt;br /&gt;
 Linking  module autocycle...&lt;br /&gt;
 ...&lt;br /&gt;
 Building core object SSLVerifyHost...&lt;br /&gt;
 Linking znc...&lt;br /&gt;
&lt;br /&gt;
 ZNC was successfully compiled.&lt;br /&gt;
 Use &#039;make install&#039; to install ZNC to &#039;/usr/local&#039;.&lt;br /&gt;
&lt;br /&gt;
* I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:&lt;br /&gt;
 $ bitbake zile&lt;br /&gt;
 $ bitbake package-index&lt;br /&gt;
Target -&amp;gt;&lt;br /&gt;
 # dnf install zile&lt;br /&gt;
&lt;br /&gt;
== Ways to Serve up the rpm repo == &lt;br /&gt;
&lt;br /&gt;
* very simple - use python twistd.&lt;br /&gt;
** let&#039;s suppose you have an rpm repo on the host that is in dir /home/me/mrrepo.  &lt;br /&gt;
** &amp;lt;code &amp;gt; &lt;br /&gt;
     cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path . -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
** similarly, if you are just serving up the build directories rpm&#039;s you can just do &lt;br /&gt;
*** &amp;lt;code &amp;gt; &lt;br /&gt;
     cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path tmp/deploy/rpm -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
***  Note , only 1 process can own a given port.&lt;br /&gt;
* less simple, but better response and better stability- use lighthttpd.  &lt;br /&gt;
** I advocate using this from a container as it is simpler to maintain.&lt;br /&gt;
** &amp;lt;code&amp;gt;&lt;br /&gt;
  docker run -it --rm --name user-rpm-server -v /home/me/mrrepo:/var/www/localhost/htdocs -v /home/me/lighttpd:/etc/lighttpd -p 5678:80 sebp/lighttpd &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** What goes in /home/me/lighttpd? the config for the lighthttpd container you are running.&lt;br /&gt;
** Where did they come from? Copied from inside the container &lt;br /&gt;
*** &amp;lt;code&amp;gt; docker run -it --rm --user=root --entrypoint=/bin/sh -v /home/me/lighttpd:/frog sebp/lighttpd &amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt; # cp -a /etc/lighttpd/* /frog &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Now your /home/me/lightppd has the necessary config files.&lt;br /&gt;
** The files in /home/me/lighthttpd:&lt;br /&gt;
*** lighttpd.conf  lighttpd.conf~  mime-types.conf  mod_cgi.conf  mod_fastcgi.conf  mod_fastcgi_fpm.conf&lt;br /&gt;
**** From this you can see I run emacs.  The only change I did was to turn on directory listing .&lt;br /&gt;
**** diff  lighttpd.conf  lighttpd.conf~&lt;br /&gt;
*****  &amp;lt;code&amp;gt; 114c114&lt;br /&gt;
 &amp;lt; dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; #   dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
** the  -p 5678:80  exposes the default port the container runs it&#039;s service (aka 80)  on to the host port 5678.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31748</id>
		<title>TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31748"/>
		<updated>2017-09-20T18:23:53Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Ways to Serve up the rpm repo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Leveraging Pkg Feeds or How I got Tired of Burning Images =&lt;br /&gt;
I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I tend to do this first, if I want to make a recipe from scratch for software that I am not too familiar with.  This way, I can follow the instructions for building w/o reinterpretation, verify that I have or can build the necessary dependencies, and check that the sw works properly; all before diving into recipes.  I have found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.&lt;br /&gt;
&amp;lt;strong&amp;gt; Note: This works as well with kernel modules as it does with libraries/binaries&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this example, we will be building znc 1.6.5, an irc bouncer.  This is just a good complex example.   In order to use this guide, you should set up your bitbake environment and your target as outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]&lt;br /&gt;
== Steps ==&lt;br /&gt;
* It&#039;s typically easies to make an image that has *most* of what you think you&#039;ll need. In this example, I added the following to my local.conf:&lt;br /&gt;
  EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile &amp;quot;&lt;br /&gt;
* Now I&#039;ll grab the src code we will try to build &amp;lt;strong&amp;gt;Note: this is an ON TARGET build&amp;lt;/strong&amp;gt; the build host side is just for the dependencies...&lt;br /&gt;
 git clone https://github.com/znc/znc.git&lt;br /&gt;
 cd znc&lt;br /&gt;
 git checkout -b 1.6.5 znc-1.6.5&lt;br /&gt;
 * follow the build instructions&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure&lt;br /&gt;
This worked, but we decide we want to have cyrus support as well.&lt;br /&gt;
* First we try &lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
but we get&lt;br /&gt;
 configure: error: could not find libsasl2. Try --disable-cyrus.&lt;br /&gt;
&lt;br /&gt;
* So we need the cyrus-sals-dev pkg.  If we aren&#039;t sure where that is, we can use [https://layers.openembedded.org/layerindex/branch/master/layers/ openembedded layer index] and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.&lt;br /&gt;
  bitbake cyrus-sasl&lt;br /&gt;
and remake the package index&lt;br /&gt;
 bitbake package-index&lt;br /&gt;
* target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.&lt;br /&gt;
 $dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)&lt;br /&gt;
If this fails, make sure you followed the instructions in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]. You should have set up the on target repo in  /etc/yum.repos.d/myrepo.repo and have a web server of some type pointed to tmp/deploy/rpm (like twistd -n web --path tmp/deploy/rpm -p 5678) on your build host.&lt;br /&gt;
* now we rerun configure and get:&lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
&lt;br /&gt;
  ZNC 1.6.5 configured&lt;br /&gt;
 prefix:       /usr/local&lt;br /&gt;
 debug:        no&lt;br /&gt;
 ipv6:         yes&lt;br /&gt;
 openssl:      yes&lt;br /&gt;
 dns:          threads&lt;br /&gt;
 perl:         no&lt;br /&gt;
 python:       no&lt;br /&gt;
 swig:         not needed&lt;br /&gt;
 cyrus:        yes&lt;br /&gt;
 tcl:          no&lt;br /&gt;
 charset:      yes&lt;br /&gt;
 zlib:         yes&lt;br /&gt;
 run from src: no&lt;br /&gt;
&lt;br /&gt;
Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects. &lt;br /&gt;
* Let&#039;s build it&lt;br /&gt;
 ~/znc# make&lt;br /&gt;
 Packing man page znc.1.gz...&lt;br /&gt;
 Packing man page znc-buildmod.1.gz...&lt;br /&gt;
 It looks like git submodules are not initialized. Run: git submodule update --init --recursive&lt;br /&gt;
 make: *** [Makefile:168: third_party/Csocket/Csocket.h] Error 1&lt;br /&gt;
 ~/znc# git submodule update --init --recursive&lt;br /&gt;
 git: &#039;submodule&#039; is not a git command. See &#039;git --help&#039;.&lt;br /&gt;
Whoops, we need git submodule...  This one is harder to find. After verifying that we already have git-dev installed, I ended up searching the poky tree for git-submodule&lt;br /&gt;
 $ git grep git-submodule&lt;br /&gt;
 bitbake/lib/bb/tests/fetch.py:            fetcher = bb.fetch.Fetch([&amp;quot;gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165&lt;br /&gt;
 meta/recipes-devtools/git/git.inc:    ${libexecdir}/git-core/git-submodule \&lt;br /&gt;
If we look in meta/recipes-devtools/git/git.inc we can see that the git-submodule is included in git-perltools:&lt;br /&gt;
 PACKAGES =+ &amp;quot;${PN}-perltools&amp;quot;.&lt;br /&gt;
So we can pull in the git-perltools as well on the target:&lt;br /&gt;
 # dnf install git-perltools&lt;br /&gt;
and rerun the git submodule init&lt;br /&gt;
 # git submodule update --init --recursive&lt;br /&gt;
 Submodule &#039;Csocket&#039; (https://github.com/jimloco/Csocket.git) registered for path &#039;third_party/Csocket&#039;&lt;br /&gt;
 Cloning into &#039;/home/root/znc/third_party/Csocket&#039;...&lt;br /&gt;
 Submodule path &#039;third_party/Csocket&#039;: checked out &#039;448e18a29ed383451db3cb648a72da4fcbb3f8e5&#039;&lt;br /&gt;
&lt;br /&gt;
It worked :), and now we can successfully type make.  Having to reflash the image for each of these steps would have been much slower!&lt;br /&gt;
 # make&lt;br /&gt;
 Building module autocycle...&lt;br /&gt;
 Linking  module autocycle...&lt;br /&gt;
 ...&lt;br /&gt;
 Building core object SSLVerifyHost...&lt;br /&gt;
 Linking znc...&lt;br /&gt;
&lt;br /&gt;
 ZNC was successfully compiled.&lt;br /&gt;
 Use &#039;make install&#039; to install ZNC to &#039;/usr/local&#039;.&lt;br /&gt;
&lt;br /&gt;
* I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:&lt;br /&gt;
 $ bitbake zile&lt;br /&gt;
 $ bitbake package-index&lt;br /&gt;
Target -&amp;gt;&lt;br /&gt;
 # dnf install zile&lt;br /&gt;
&lt;br /&gt;
== Ways to Serve up the rpm repo == &lt;br /&gt;
&lt;br /&gt;
* very simple - use python twistd.&lt;br /&gt;
** let&#039;s suppose you have an rpm repo on the host that is in dir /home/me/mrrepo.  &lt;br /&gt;
** &amp;lt;code &amp;gt; cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path . -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
** similarly, if you are just serving up the build directories rpm&#039;s you can just do &lt;br /&gt;
*** &amp;lt;code &amp;gt; &lt;br /&gt;
     cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path tmp/deploy/rpm -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
***  Note , only 1 process can own a given port.&lt;br /&gt;
* less simple, but better response and better stability- use lighthttpd.  &lt;br /&gt;
** I advocate using this from a container as it is simpler to maintain.&lt;br /&gt;
** &amp;lt;code&amp;gt;&lt;br /&gt;
  docker run -it --rm --name user-rpm-server -v /home/me/mrrepo:/var/www/localhost/htdocs -v /home/me/lighttpd:/etc/lighttpd -p 5678:80 sebp/lighttpd &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** What goes in /home/me/lighttpd? the config for the lighthttpd container you are running.&lt;br /&gt;
** Where did they come from? Copied from inside the container &lt;br /&gt;
*** &amp;lt;code&amp;gt; docker run -it --rm --user=root --entrypoint=/bin/sh -v /home/me/lighttpd:/frog sebp/lighttpd &amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt; # cp -a /etc/lighttpd/* /frog &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Now your /home/me/lightppd has the necessary config files.&lt;br /&gt;
** The files in /home/me/lighthttpd:&lt;br /&gt;
*** lighttpd.conf  lighttpd.conf~  mime-types.conf  mod_cgi.conf  mod_fastcgi.conf  mod_fastcgi_fpm.conf&lt;br /&gt;
**** From this you can see I run emacs.  The only change I did was to turn on directory listing .&lt;br /&gt;
**** diff  lighttpd.conf  lighttpd.conf~&lt;br /&gt;
*****  &amp;lt;code&amp;gt; 114c114&lt;br /&gt;
 &amp;lt; dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; #   dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
** the  -p 5678:80  exposes the default port the container runs it&#039;s service (aka 80)  on to the host port 5678.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31747</id>
		<title>TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=31747"/>
		<updated>2017-09-20T18:23:32Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Leveraging Pkg Feeds or How I got Tired of Burning Images =&lt;br /&gt;
I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I tend to do this first, if I want to make a recipe from scratch for software that I am not too familiar with.  This way, I can follow the instructions for building w/o reinterpretation, verify that I have or can build the necessary dependencies, and check that the sw works properly; all before diving into recipes.  I have found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.&lt;br /&gt;
&amp;lt;strong&amp;gt; Note: This works as well with kernel modules as it does with libraries/binaries&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this example, we will be building znc 1.6.5, an irc bouncer.  This is just a good complex example.   In order to use this guide, you should set up your bitbake environment and your target as outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]&lt;br /&gt;
== Steps ==&lt;br /&gt;
* It&#039;s typically easies to make an image that has *most* of what you think you&#039;ll need. In this example, I added the following to my local.conf:&lt;br /&gt;
  EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile &amp;quot;&lt;br /&gt;
* Now I&#039;ll grab the src code we will try to build &amp;lt;strong&amp;gt;Note: this is an ON TARGET build&amp;lt;/strong&amp;gt; the build host side is just for the dependencies...&lt;br /&gt;
 git clone https://github.com/znc/znc.git&lt;br /&gt;
 cd znc&lt;br /&gt;
 git checkout -b 1.6.5 znc-1.6.5&lt;br /&gt;
 * follow the build instructions&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure&lt;br /&gt;
This worked, but we decide we want to have cyrus support as well.&lt;br /&gt;
* First we try &lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
but we get&lt;br /&gt;
 configure: error: could not find libsasl2. Try --disable-cyrus.&lt;br /&gt;
&lt;br /&gt;
* So we need the cyrus-sals-dev pkg.  If we aren&#039;t sure where that is, we can use [https://layers.openembedded.org/layerindex/branch/master/layers/ openembedded layer index] and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.&lt;br /&gt;
  bitbake cyrus-sasl&lt;br /&gt;
and remake the package index&lt;br /&gt;
 bitbake package-index&lt;br /&gt;
* target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.&lt;br /&gt;
 $dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)&lt;br /&gt;
If this fails, make sure you followed the instructions in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]. You should have set up the on target repo in  /etc/yum.repos.d/myrepo.repo and have a web server of some type pointed to tmp/deploy/rpm (like twistd -n web --path tmp/deploy/rpm -p 5678) on your build host.&lt;br /&gt;
* now we rerun configure and get:&lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
&lt;br /&gt;
  ZNC 1.6.5 configured&lt;br /&gt;
 prefix:       /usr/local&lt;br /&gt;
 debug:        no&lt;br /&gt;
 ipv6:         yes&lt;br /&gt;
 openssl:      yes&lt;br /&gt;
 dns:          threads&lt;br /&gt;
 perl:         no&lt;br /&gt;
 python:       no&lt;br /&gt;
 swig:         not needed&lt;br /&gt;
 cyrus:        yes&lt;br /&gt;
 tcl:          no&lt;br /&gt;
 charset:      yes&lt;br /&gt;
 zlib:         yes&lt;br /&gt;
 run from src: no&lt;br /&gt;
&lt;br /&gt;
Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects. &lt;br /&gt;
* Let&#039;s build it&lt;br /&gt;
 ~/znc# make&lt;br /&gt;
 Packing man page znc.1.gz...&lt;br /&gt;
 Packing man page znc-buildmod.1.gz...&lt;br /&gt;
 It looks like git submodules are not initialized. Run: git submodule update --init --recursive&lt;br /&gt;
 make: *** [Makefile:168: third_party/Csocket/Csocket.h] Error 1&lt;br /&gt;
 ~/znc# git submodule update --init --recursive&lt;br /&gt;
 git: &#039;submodule&#039; is not a git command. See &#039;git --help&#039;.&lt;br /&gt;
Whoops, we need git submodule...  This one is harder to find. After verifying that we already have git-dev installed, I ended up searching the poky tree for git-submodule&lt;br /&gt;
 $ git grep git-submodule&lt;br /&gt;
 bitbake/lib/bb/tests/fetch.py:            fetcher = bb.fetch.Fetch([&amp;quot;gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165&lt;br /&gt;
 meta/recipes-devtools/git/git.inc:    ${libexecdir}/git-core/git-submodule \&lt;br /&gt;
If we look in meta/recipes-devtools/git/git.inc we can see that the git-submodule is included in git-perltools:&lt;br /&gt;
 PACKAGES =+ &amp;quot;${PN}-perltools&amp;quot;.&lt;br /&gt;
So we can pull in the git-perltools as well on the target:&lt;br /&gt;
 # dnf install git-perltools&lt;br /&gt;
and rerun the git submodule init&lt;br /&gt;
 # git submodule update --init --recursive&lt;br /&gt;
 Submodule &#039;Csocket&#039; (https://github.com/jimloco/Csocket.git) registered for path &#039;third_party/Csocket&#039;&lt;br /&gt;
 Cloning into &#039;/home/root/znc/third_party/Csocket&#039;...&lt;br /&gt;
 Submodule path &#039;third_party/Csocket&#039;: checked out &#039;448e18a29ed383451db3cb648a72da4fcbb3f8e5&#039;&lt;br /&gt;
&lt;br /&gt;
It worked :), and now we can successfully type make.  Having to reflash the image for each of these steps would have been much slower!&lt;br /&gt;
 # make&lt;br /&gt;
 Building module autocycle...&lt;br /&gt;
 Linking  module autocycle...&lt;br /&gt;
 ...&lt;br /&gt;
 Building core object SSLVerifyHost...&lt;br /&gt;
 Linking znc...&lt;br /&gt;
&lt;br /&gt;
 ZNC was successfully compiled.&lt;br /&gt;
 Use &#039;make install&#039; to install ZNC to &#039;/usr/local&#039;.&lt;br /&gt;
&lt;br /&gt;
* I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:&lt;br /&gt;
 $ bitbake zile&lt;br /&gt;
 $ bitbake package-index&lt;br /&gt;
Target -&amp;gt;&lt;br /&gt;
 # dnf install zile&lt;br /&gt;
&lt;br /&gt;
== Ways to Serve up the rpm repo == &lt;br /&gt;
&lt;br /&gt;
* very simple - use python twistd.&lt;br /&gt;
** let&#039;s suppose you have an rpm repo on the host that is in dir /home/me/mrrepo.  &lt;br /&gt;
** &amp;lt;code &amp;gt; cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path . -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
** similarly, if you are just serving up the build directories rpm&#039;s you can just do &lt;br /&gt;
*** &amp;lt;code &amp;gt; cd /home/me/mrrepo;&lt;br /&gt;
     twistd -n web --path tmp/deploy/rpm -p 5678&lt;br /&gt;
  &amp;lt;/code&amp;gt;&lt;br /&gt;
***  Note , only 1 process can own a given port.&lt;br /&gt;
* less simple, but better response and better stability- use lighthttpd.  &lt;br /&gt;
** I advocate using this from a container as it is simpler to maintain.&lt;br /&gt;
** &amp;lt;code&amp;gt;&lt;br /&gt;
  docker run -it --rm --name user-rpm-server -v /home/me/mrrepo:/var/www/localhost/htdocs -v /home/me/lighttpd:/etc/lighttpd -p 5678:80 sebp/lighttpd &lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
** What goes in /home/me/lighttpd? the config for the lighthttpd container you are running.&lt;br /&gt;
** Where did they come from? Copied from inside the container &lt;br /&gt;
*** &amp;lt;code&amp;gt; docker run -it --rm --user=root --entrypoint=/bin/sh -v /home/me/lighttpd:/frog sebp/lighttpd &amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt; # cp -a /etc/lighttpd/* /frog &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Now your /home/me/lightppd has the necessary config files.&lt;br /&gt;
** The files in /home/me/lighthttpd:&lt;br /&gt;
*** lighttpd.conf  lighttpd.conf~  mime-types.conf  mod_cgi.conf  mod_fastcgi.conf  mod_fastcgi_fpm.conf&lt;br /&gt;
**** From this you can see I run emacs.  The only change I did was to turn on directory listing .&lt;br /&gt;
**** diff  lighttpd.conf  lighttpd.conf~&lt;br /&gt;
*****  &amp;lt;code&amp;gt; 114c114&lt;br /&gt;
 &amp;lt; dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; #   dir-listing.activate      = &amp;quot;enable&amp;quot;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
** the  -p 5678:80  exposes the default port the container runs it&#039;s service (aka 80)  on to the host port 5678.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31632</id>
		<title>TipsAndTricks/RunningEclipseAgainstBuiltImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31632"/>
		<updated>2017-09-14T20:59:38Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Cookbook guide to Making an Eclipse Debug Capable Image =&lt;br /&gt;
Suppose you are building images and would like to be able to use Eclipse and the Yocto Eclipse plugin to develop/debug a C/C++ application on either a remote hardware target or on qemu.  This cookbook will explain the small number of steps needed to accomplish this.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So that the commands are  specific and can be cut and pasted to try, we will assume the following:&lt;br /&gt;
* Target Image-&amp;gt; core-image-sato-sdk&lt;br /&gt;
** see section[[#Why SDK Image]] for why you have to build the sdk image and how to work around it if you really don&#039;t want to.&lt;br /&gt;
*  Target Machine -&amp;gt; qemux86&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== Making a Suitable Qemux86 Image===&lt;br /&gt;
* We need to build a core-image-sato-sdk that has the pieces needed by Eclipse, so we add/change the following in our conf/local.conf:&lt;br /&gt;
** We add the following to EXTRA_IMAGE_FEATURES in conf/local.conf&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; eclipse-debug  &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds gdbserver,tcf-agent (for Target Communication Framework), and openssh-sftp-server)&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; tools-sdk &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds the build requirements on the target rootfs.  This is needed since the Yocto Eclipse plugin is assuming that the qemu rootfs and the sysroot are synonymous.&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This defaults to the openssl ssh server rather than dropbear. You can use either so this line can be omitted since the sftp server works with either.&lt;br /&gt;
** Execute: &amp;lt;code&amp;gt; $bitbake core-image-sato&amp;lt;/code&amp;gt;&lt;br /&gt;
*** This makes a rootfs in tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2&lt;br /&gt;
* We need to build the toolchain eclipse will use&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake core-image-sato -c populate_sdk &amp;lt;/code&amp;gt;&lt;br /&gt;
***  This makes sdk stuff  such as the toolchains eclipse will use to build, &lt;br /&gt;
* We need to build a version of qemu that can run natively on our workstation as well as a userspace nfs daemon.&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake meta-ide-support &amp;lt;/code&amp;gt;&lt;br /&gt;
* We need an extracted rootfs that can be used by the userspace nfs daemon to boot qemu.  &lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $mkdir MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Execute &amp;lt;code&amp;gt; $runqemu-extract-sdk tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 MY_QEMU_ROOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This will result in a fully extracted rootfs in MY_QEMU_ROOTFS and a set of permissions maintained by pseudo (a yocto tool similar to but more functional than fakeroot) for the rootfs in MY_QEMU_ROOTFS.pseudo_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Built Qemux86 Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration For the Built Image ====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Build System Derived Toolchain&lt;br /&gt;
** enter Toolchain Root Location: &amp;lt;build dir&amp;gt;&lt;br /&gt;
*** this is  where you have been running bitbake core-image-sato, bitbake etc.&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: &amp;lt;path&amp;gt;/tmp/deploy/images/qemux86/bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel we built&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
=== Alternatively, Downloading what we need for Qemux86===&lt;br /&gt;
Sometimes, you may not want to build everything yourself but just want to download what you need.  These instructions will target the Yocto 2.1 release, but you should be able to translate it into other releases pretty easily.&lt;br /&gt;
* Download the image http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/core-image-sato-sdk-qemux86.tar.bz2  Note, the image MUST be an SDK image.  Images without sdk in the name will NOT work.&lt;br /&gt;
* Download the toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh  Note, the toolchain must NOT be one with -ext in the name. The ext toolchains are for the extensible SDK which is useful for CLI and recipe development but which is not currently compatible with Eclipse.&lt;br /&gt;
* unpack the toolchain to a dir by running the shell script file you downloaded:&lt;br /&gt;
 &amp;lt;code&amp;gt;$chmod a+x poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;$sh poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
This will put the toolchain in /opt/poky/2.1 by default.&lt;br /&gt;
* source the toolchain environment file &lt;br /&gt;
 &amp;lt;code&amp;gt; $source environment-setup-i586-poky-linux &amp;lt;/code&amp;gt;&lt;br /&gt;
* extract the image you downloaded so that Qemu can use it&lt;br /&gt;
 &amp;lt;code&amp;gt; $runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2  MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
* Downloads a kernel Qemu can use to boot: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/bzImage-qemux86.bin&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Downloaded Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration  For the Downloaded Image====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Standalone pre built toolchain&lt;br /&gt;
** enter Toolchain Root Location: /opt/poky/2.1&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel you downloaded&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run Qemu ===&lt;br /&gt;
* goto &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; and select qemu_i586-poky-linux (in our example; in general it will be architecture-distro-os)&lt;br /&gt;
** click Run - this will bring up a Qemu instance.&lt;br /&gt;
==== Put the binary on the Qemu instance and debug it ====&lt;br /&gt;
* goto &amp;lt;code&amp;gt;Run-&amp;gt;Debug Configurations...&amp;lt;/code&amp;gt; and select your project (looks like hello_gdb_i586-poky-linux in our case if you named the project hello)&lt;br /&gt;
* make a new connection - I prefer SSH so I&#039;ll show that here. TCF should also work.&lt;br /&gt;
** Click New... on Connection line&lt;br /&gt;
** put 192.168.7.2 (probably, look at the end of the qemu xterm that launched and find ip=192.168.7.XX::192.168.7.XX-1 ) in the Host name&lt;br /&gt;
** name it&lt;br /&gt;
** click finish&lt;br /&gt;
===== Eclipse Oxygen and TCF =====&lt;br /&gt;
* In Mars, TCF would appear as a connection type alongside ssh. &lt;br /&gt;
* In Oxygen, this is no longer true. If you want to use tcf as the connection type you need to do the following:&lt;br /&gt;
** At the bottom of the DEbug Configuration page, by default, you will be in &amp;quot;Using GDB (DSF) Automatic Remote Debugging Launcher&amp;quot; - Select other...&lt;br /&gt;
** Click on &amp;quot;Select other...&amp;quot; and you can choose GDB (DSF) Automatic REmove Debugging via TCF/TE Launcher. This is the oxygen equivalent of a TCF connection.&lt;br /&gt;
** If they cannot be selected, you may need to select the &amp;quot;Use configuration specific settings&amp;quot; checkbox at the top of the dialog box.&lt;br /&gt;
*** at this point, your connection will be of type tcf&lt;br /&gt;
** I found the neon implementation of tcf to be buggy...&lt;br /&gt;
===== Back to Using the Connection whether it be ssh or tcf =====&lt;br /&gt;
* Browse to where the prog will go. I tend to use /home/root.&lt;br /&gt;
** Remote Absolute File Path for C/C++ Application -&amp;gt; click Browse...&lt;br /&gt;
** Goto Root-&amp;gt;/-&amp;gt;home-&amp;gt;root  remember the user is root and the password is empty by default.&lt;br /&gt;
** double click root&lt;br /&gt;
** click ok&lt;br /&gt;
** If the browse to Remote Absolute File Path for C/C++ Application hangs or errors out Check&lt;br /&gt;
*** qemu is running&lt;br /&gt;
*** you can ssh root@&amp;lt;address&amp;gt; from a terminal window&lt;br /&gt;
*** make sure that the proxies eclipse knows about in Window-&amp;gt;Preferences-&amp;gt;Network Connections is not &amp;quot;eating&amp;quot; the ssh connection traffic.  On Oxygen, for instance, I need to switch the network connection to manual and add 192.168.7.2 as a Proxy bypass host.&lt;br /&gt;
* click Apply&lt;br /&gt;
* click Debug and open the Debug Perspective.&lt;br /&gt;
&lt;br /&gt;
== Other Useful Info ==&lt;br /&gt;
=== Why SDK Image ===&lt;br /&gt;
The current poky-eclipse plugin mashes together 2 concepts that should have been disjoint: namely, the target sysroot and the rootfs image qemu will boot.  Under &amp;lt;code&amp;gt; Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt;, you choose a sysroot location.  Up above I told you to point this to the MY_QEMU_ROOTFS you extracted with runqemu-extract-sdk.  This will work, but only if you have built the sdk image.  If you built the core-image-sato instead, then the MY_QEMU_ROOTFS will be missing a lot of important development files like stdio.h... &lt;br /&gt;
====  How to Work around this ====&lt;br /&gt;
Let&#039;s say you build core-image-sato (this is a standin for your particular image that can&#039;t have the sdk parts tossed in for some reason).  You can still use eclipse and qemu. You need to do the same things as above with the following changes:&lt;br /&gt;
*  &amp;lt;code&amp;gt;Sysroot in  Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt; points to &amp;lt;builddir&amp;gt;/tmp/sysroots/qemux86-64.  This will give the build system access to the development files it needs.&lt;br /&gt;
* In the dialog for &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; you will need to read the long Argument string in the big box.   It will have something like &amp;lt;code&amp;gt; -e &amp;quot;source env-setup-&amp;lt;sdkarch&amp;gt;;  runqemu &amp;lt;kernel path&amp;gt; &amp;lt;rootfs path&amp;gt; &amp;lt;/code&amp;gt; Because the current plugin munges the sysroot and qemu image concepts, the &amp;lt;rootfs path&amp;gt; will incorrectly be pointing to your sysroot. Just delete the &amp;lt;rootfs path&amp;gt; and put in the ABSOLUTE path to the MY_QEMU_ROOTFS you extracted with the runqemu-extract-sdk tool. This way, you can build &amp;amp; debug the image even if it&#039;s not an sdk image.&lt;br /&gt;
&lt;br /&gt;
=== Adding static tap devices ===&lt;br /&gt;
It is often easier to preconfigure several tap devices so that qemu can run and use them without needing to be root or use sudo.  To do this, run &amp;lt;code&amp;gt; runqemu-gen-tapdevs `id -u &amp;lt;username&amp;gt;` `id -g &amp;lt;username&amp;gt;` 4 `find ./tmp/sysroots -iname tunctl`&amp;lt;/code&amp;gt; as root. This will make the inet devices tap0,tap1,tap2,tap3.  You can see them with &amp;lt;code&amp;gt; ifconfig -a | grep tap &amp;lt;/code&amp;gt;.  Typically, tap0 is 192.168.7.1 and so when the first qemu is run it&#039;s address will be 192.168.7.2 and 192.168.7.1 will be that qemu instance&#039;s gateway. The runqemu-gen-tapdevs  is located in bitbake/scripts.&lt;br /&gt;
&lt;br /&gt;
scripts/runqemu-gen-tapdevs&lt;br /&gt;
&lt;br /&gt;
=== Switching autotools C/C++ project from one toolchain/sysroot to another and build failing===&lt;br /&gt;
Sometimes you will have an existing project and want to switch to a different toolchain or sysroot or machine (x86-&amp;gt;x86-64 for instance).  If you find that you are getting errors like &amp;lt;code&amp;gt;install-sh not found&amp;lt;/code&amp;gt; it may mean that your autotools files have gotten out of sync.   Here&#039;s how you can force them back. All of these are found by Right clicking on the project and going to Invoke Autotools-&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Libtoolize  option = &amp;quot;--force&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Aclocal&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoheader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Automake  option = &amp;quot;--force-missing --add-missing&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoconf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then Right click on the project and select &amp;lt;code&amp;gt; Reconfigure Project &amp;lt;/code&amp;gt;.  You should now be able to build the project again.&lt;br /&gt;
&lt;br /&gt;
=== Dealing with java.lang.NullPointerException ===&lt;br /&gt;
Eclipse upstream has some issues with *some* of the GTK3 libraries shipped with some of the distributions(https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736). If you are seeing a NullPointer Exception try adding the following to your eclipse.ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an in place snippet of a happy ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 -showsplash&lt;br /&gt;
 org.eclipse.platform&lt;br /&gt;
 --launcher.XXMaxPermSize&lt;br /&gt;
 256m&lt;br /&gt;
 --launcher.defaultAction&lt;br /&gt;
 openFile&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 --launcher.appendVmargs&lt;br /&gt;
 -vmargs&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Alternatively, you can set &lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $export SWT_GTK3=0&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
But this might affect other programs as well.&lt;br /&gt;
&lt;br /&gt;
=== XWayland workaround with &amp;lt;code&amp;gt;gtk3&amp;lt;/code&amp;gt; (Fedora-25) ===&lt;br /&gt;
&lt;br /&gt;
If you see bizarre screen layout of controls in Eclipse Neon, it is probably because the Neon (4.6.x) release of Eclipse is not fully compatible with straight Wayland.&lt;br /&gt;
&lt;br /&gt;
Fedora-25 now has Wayland by default. To enable the XWayland backend:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export GDK_BACKEND=x11&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will still use gtk3, but will use the XWayland bridge rather than straight Wayland. This is expected to be fixed in the Oxygen (4.7) release of Eclipse to support straight Wayland.(https://bugs.eclipse.org/bugs/show_bug.cgi?id=496923)&lt;br /&gt;
&lt;br /&gt;
Thanks to Roland Grunber (Red Hat Linux Tools team) for pointing me in the right direction on #fedora-linux (freenode IRC).&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2016/10/06/make-applications-eclipse-use-x11-backend-on-wayland-fedora-25/#more-502&lt;br /&gt;
&lt;br /&gt;
==== How to know what version of &amp;lt;code&amp;gt;gtk&amp;lt;/code&amp;gt; is being used in your session? ====&lt;br /&gt;
&amp;lt;code&amp;gt;Help -&amp;gt; About -&amp;gt; Installation Details -&amp;gt; Configuration Tab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;org.eclipse.swt.internal.gtk.version=3.22.6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2014/10/27/how-to-tell-if-you-are-running-eclipse-on-gtk2-or-on-gtk3/&lt;br /&gt;
&lt;br /&gt;
==== How do you know you are running Wayland? ====&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt; which should show you a list of sessions, one of which will be &amp;lt;code&amp;gt;gdm&amp;lt;/code&amp;gt;, remember that session number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl show-session &amp;lt;session number from above&amp;gt; -p Type&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Type=wayland&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] http://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31630</id>
		<title>TipsAndTricks/RunningEclipseAgainstBuiltImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31630"/>
		<updated>2017-09-14T20:21:42Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Cookbook guide to Making an Eclipse Debug Capable Image =&lt;br /&gt;
Suppose you are building images and would like to be able to use Eclipse and the Yocto Eclipse plugin to develop/debug a C/C++ application on either a remote hardware target or on qemu.  This cookbook will explain the small number of steps needed to accomplish this.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So that the commands are  specific and can be cut and pasted to try, we will assume the following:&lt;br /&gt;
* Target Image-&amp;gt; core-image-sato-sdk&lt;br /&gt;
** see section[[#Why SDK Image]] for why you have to build the sdk image and how to work around it if you really don&#039;t want to.&lt;br /&gt;
*  Target Machine -&amp;gt; qemux86&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== Making a Suitable Qemux86 Image===&lt;br /&gt;
* We need to build a core-image-sato-sdk that has the pieces needed by Eclipse, so we add/change the following in our conf/local.conf:&lt;br /&gt;
** We add the following to EXTRA_IMAGE_FEATURES in conf/local.conf&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; eclipse-debug  &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds gdbserver,tcf-agent (for Target Communication Framework), and openssh-sftp-server)&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; tools-sdk &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds the build requirements on the target rootfs.  This is needed since the Yocto Eclipse plugin is assuming that the qemu rootfs and the sysroot are synonymous.&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This defaults to the openssl ssh server rather than dropbear. You can use either so this line can be omitted since the sftp server works with either.&lt;br /&gt;
** Execute: &amp;lt;code&amp;gt; $bitbake core-image-sato&amp;lt;/code&amp;gt;&lt;br /&gt;
*** This makes a rootfs in tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2&lt;br /&gt;
* We need to build the toolchain eclipse will use&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake core-image-sato -c populate_sdk &amp;lt;/code&amp;gt;&lt;br /&gt;
***  This makes sdk stuff  such as the toolchains eclipse will use to build, &lt;br /&gt;
* We need to build a version of qemu that can run natively on our workstation as well as a userspace nfs daemon.&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake meta-ide-support &amp;lt;/code&amp;gt;&lt;br /&gt;
* We need an extracted rootfs that can be used by the userspace nfs daemon to boot qemu.  &lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $mkdir MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Execute &amp;lt;code&amp;gt; $runqemu-extract-sdk tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 MY_QEMU_ROOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This will result in a fully extracted rootfs in MY_QEMU_ROOTFS and a set of permissions maintained by pseudo (a yocto tool similar to but more functional than fakeroot) for the rootfs in MY_QEMU_ROOTFS.pseudo_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Built Qemux86 Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration For the Built Image ====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Build System Derived Toolchain&lt;br /&gt;
** enter Toolchain Root Location: &amp;lt;build dir&amp;gt;&lt;br /&gt;
*** this is  where you have been running bitbake core-image-sato, bitbake etc.&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: &amp;lt;path&amp;gt;/tmp/deploy/images/qemux86/bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel we built&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
=== Alternatively, Downloading what we need for Qemux86===&lt;br /&gt;
Sometimes, you may not want to build everything yourself but just want to download what you need.  These instructions will target the Yocto 2.1 release, but you should be able to translate it into other releases pretty easily.&lt;br /&gt;
* Download the image http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/core-image-sato-sdk-qemux86.tar.bz2  Note, the image MUST be an SDK image.  Images without sdk in the name will NOT work.&lt;br /&gt;
* Download the toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh  Note, the toolchain must NOT be one with -ext in the name. The ext toolchains are for the extensible SDK which is useful for CLI and recipe development but which is not currently compatible with Eclipse.&lt;br /&gt;
* unpack the toolchain to a dir by running the shell script file you downloaded:&lt;br /&gt;
 &amp;lt;code&amp;gt;$chmod a+x poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;$sh poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
This will put the toolchain in /opt/poky/2.1 by default.&lt;br /&gt;
* source the toolchain environment file &lt;br /&gt;
 &amp;lt;code&amp;gt; $source environment-setup-i586-poky-linux &amp;lt;/code&amp;gt;&lt;br /&gt;
* extract the image you downloaded so that Qemu can use it&lt;br /&gt;
 &amp;lt;code&amp;gt; $runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2  MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
* Downloads a kernel Qemu can use to boot: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/bzImage-qemux86.bin&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Downloaded Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration  For the Downloaded Image====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Standalone pre built toolchain&lt;br /&gt;
** enter Toolchain Root Location: /opt/poky/2.1&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel you downloaded&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run Qemu ===&lt;br /&gt;
* goto &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; and select qemu_i586-poky-linux (in our example; in general it will be architecture-distro-os)&lt;br /&gt;
** click Run - this will bring up a Qemu instance.&lt;br /&gt;
==== Put the binary on the Qemu instance and debug it ====&lt;br /&gt;
* goto &amp;lt;code&amp;gt;Run-&amp;gt;Debug Configurations...&amp;lt;/code&amp;gt; and select your project (looks like hello_gdb_i586-poky-linux in our case if you named the project hello)&lt;br /&gt;
* make a new connection - I prefer SSH so I&#039;ll show that here. TCF should also work.&lt;br /&gt;
** Click New... on Connection line&lt;br /&gt;
** put 192.168.7.2 (probably, look at the end of the qemu xterm that launched and find ip=192.168.7.XX::192.168.7.XX-1 ) in the Host name&lt;br /&gt;
** name it&lt;br /&gt;
** click finish&lt;br /&gt;
===== Eclipse Oxygen and TCF =====&lt;br /&gt;
* In Mars, TCF would appear as a connection type alongside ssh. &lt;br /&gt;
* In Oxygen, this is no longer true. If you want to use tcf as the connection type you need to do the following:&lt;br /&gt;
** At the bottom of the DEbug Configuration page, by default, you will be in &amp;quot;Using GDB (DSF) Automatic Remote Debugging Launcher&amp;quot; - Select other...&lt;br /&gt;
** Click on &amp;quot;Select other...&amp;quot; and you can choose GDB (DSF) Automatic REmove Debugging via TCF/TE Launcher. This is the oxygen equivalent of a TCF connection.&lt;br /&gt;
*** at this point, your connection will be of type tcf&lt;br /&gt;
===== Back to Using the Connection whether it be ssh or tcf =====&lt;br /&gt;
* Browse to where the prog will go. I tend to use /home/root.&lt;br /&gt;
** Remote Absolute File Path for C/C++ Application -&amp;gt; click Browse...&lt;br /&gt;
** Goto Root-&amp;gt;/-&amp;gt;home-&amp;gt;root  remember the user is root and the password is empty by default.&lt;br /&gt;
** double click root&lt;br /&gt;
** click ok&lt;br /&gt;
** If the browse to Remote Absolute File Path for C/C++ Application hangs or errors out Check&lt;br /&gt;
*** qemu is running&lt;br /&gt;
*** you can ssh root@&amp;lt;address&amp;gt; from a terminal window&lt;br /&gt;
*** make sure that the proxies eclipse knows about in Window-&amp;gt;Preferences-&amp;gt;Network Connections is not &amp;quot;eating&amp;quot; the ssh connection traffic.  On Oxygen, for instance, I need to switch the network connection to manual and add 192.168.7.2 as a Proxy bypass host.&lt;br /&gt;
* click Apply&lt;br /&gt;
* click Debug and open the Debug Perspective.&lt;br /&gt;
&lt;br /&gt;
== Other Useful Info ==&lt;br /&gt;
=== Why SDK Image ===&lt;br /&gt;
The current poky-eclipse plugin mashes together 2 concepts that should have been disjoint: namely, the target sysroot and the rootfs image qemu will boot.  Under &amp;lt;code&amp;gt; Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt;, you choose a sysroot location.  Up above I told you to point this to the MY_QEMU_ROOTFS you extracted with runqemu-extract-sdk.  This will work, but only if you have built the sdk image.  If you built the core-image-sato instead, then the MY_QEMU_ROOTFS will be missing a lot of important development files like stdio.h... &lt;br /&gt;
====  How to Work around this ====&lt;br /&gt;
Let&#039;s say you build core-image-sato (this is a standin for your particular image that can&#039;t have the sdk parts tossed in for some reason).  You can still use eclipse and qemu. You need to do the same things as above with the following changes:&lt;br /&gt;
*  &amp;lt;code&amp;gt;Sysroot in  Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt; points to &amp;lt;builddir&amp;gt;/tmp/sysroots/qemux86-64.  This will give the build system access to the development files it needs.&lt;br /&gt;
* In the dialog for &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; you will need to read the long Argument string in the big box.   It will have something like &amp;lt;code&amp;gt; -e &amp;quot;source env-setup-&amp;lt;sdkarch&amp;gt;;  runqemu &amp;lt;kernel path&amp;gt; &amp;lt;rootfs path&amp;gt; &amp;lt;/code&amp;gt; Because the current plugin munges the sysroot and qemu image concepts, the &amp;lt;rootfs path&amp;gt; will incorrectly be pointing to your sysroot. Just delete the &amp;lt;rootfs path&amp;gt; and put in the ABSOLUTE path to the MY_QEMU_ROOTFS you extracted with the runqemu-extract-sdk tool. This way, you can build &amp;amp; debug the image even if it&#039;s not an sdk image.&lt;br /&gt;
&lt;br /&gt;
=== Adding static tap devices ===&lt;br /&gt;
It is often easier to preconfigure several tap devices so that qemu can run and use them without needing to be root or use sudo.  To do this, run &amp;lt;code&amp;gt; runqemu-gen-tapdevs `id -u &amp;lt;username&amp;gt;` `id -g &amp;lt;username&amp;gt;` 4 `find ./tmp/sysroots -iname tunctl`&amp;lt;/code&amp;gt; as root. This will make the inet devices tap0,tap1,tap2,tap3.  You can see them with &amp;lt;code&amp;gt; ifconfig -a | grep tap &amp;lt;/code&amp;gt;.  Typically, tap0 is 192.168.7.1 and so when the first qemu is run it&#039;s address will be 192.168.7.2 and 192.168.7.1 will be that qemu instance&#039;s gateway. The runqemu-gen-tapdevs  is located in bitbake/scripts.&lt;br /&gt;
&lt;br /&gt;
scripts/runqemu-gen-tapdevs&lt;br /&gt;
&lt;br /&gt;
=== Switching autotools C/C++ project from one toolchain/sysroot to another and build failing===&lt;br /&gt;
Sometimes you will have an existing project and want to switch to a different toolchain or sysroot or machine (x86-&amp;gt;x86-64 for instance).  If you find that you are getting errors like &amp;lt;code&amp;gt;install-sh not found&amp;lt;/code&amp;gt; it may mean that your autotools files have gotten out of sync.   Here&#039;s how you can force them back. All of these are found by Right clicking on the project and going to Invoke Autotools-&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Libtoolize  option = &amp;quot;--force&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Aclocal&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoheader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Automake  option = &amp;quot;--force-missing --add-missing&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoconf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then Right click on the project and select &amp;lt;code&amp;gt; Reconfigure Project &amp;lt;/code&amp;gt;.  You should now be able to build the project again.&lt;br /&gt;
&lt;br /&gt;
=== Dealing with java.lang.NullPointerException ===&lt;br /&gt;
Eclipse upstream has some issues with *some* of the GTK3 libraries shipped with some of the distributions(https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736). If you are seeing a NullPointer Exception try adding the following to your eclipse.ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an in place snippet of a happy ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 -showsplash&lt;br /&gt;
 org.eclipse.platform&lt;br /&gt;
 --launcher.XXMaxPermSize&lt;br /&gt;
 256m&lt;br /&gt;
 --launcher.defaultAction&lt;br /&gt;
 openFile&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 --launcher.appendVmargs&lt;br /&gt;
 -vmargs&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Alternatively, you can set &lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $export SWT_GTK3=0&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
But this might affect other programs as well.&lt;br /&gt;
&lt;br /&gt;
=== XWayland workaround with &amp;lt;code&amp;gt;gtk3&amp;lt;/code&amp;gt; (Fedora-25) ===&lt;br /&gt;
&lt;br /&gt;
If you see bizarre screen layout of controls in Eclipse Neon, it is probably because the Neon (4.6.x) release of Eclipse is not fully compatible with straight Wayland.&lt;br /&gt;
&lt;br /&gt;
Fedora-25 now has Wayland by default. To enable the XWayland backend:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export GDK_BACKEND=x11&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will still use gtk3, but will use the XWayland bridge rather than straight Wayland. This is expected to be fixed in the Oxygen (4.7) release of Eclipse to support straight Wayland.(https://bugs.eclipse.org/bugs/show_bug.cgi?id=496923)&lt;br /&gt;
&lt;br /&gt;
Thanks to Roland Grunber (Red Hat Linux Tools team) for pointing me in the right direction on #fedora-linux (freenode IRC).&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2016/10/06/make-applications-eclipse-use-x11-backend-on-wayland-fedora-25/#more-502&lt;br /&gt;
&lt;br /&gt;
==== How to know what version of &amp;lt;code&amp;gt;gtk&amp;lt;/code&amp;gt; is being used in your session? ====&lt;br /&gt;
&amp;lt;code&amp;gt;Help -&amp;gt; About -&amp;gt; Installation Details -&amp;gt; Configuration Tab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;org.eclipse.swt.internal.gtk.version=3.22.6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2014/10/27/how-to-tell-if-you-are-running-eclipse-on-gtk2-or-on-gtk3/&lt;br /&gt;
&lt;br /&gt;
==== How do you know you are running Wayland? ====&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt; which should show you a list of sessions, one of which will be &amp;lt;code&amp;gt;gdm&amp;lt;/code&amp;gt;, remember that session number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl show-session &amp;lt;session number from above&amp;gt; -p Type&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Type=wayland&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] http://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31629</id>
		<title>TipsAndTricks/RunningEclipseAgainstBuiltImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31629"/>
		<updated>2017-09-14T20:21:04Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Put the binary on the Qemu instance and debug it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Cookbook guide to Making an Eclipse Debug Capable Image =&lt;br /&gt;
Suppose you are building images and would like to be able to use Eclipse and the Yocto Eclipse plugin to develop/debug a C/C++ application on either a remote hardware target or on qemu.  This cookbook will explain the small number of steps needed to accomplish this.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So that the commands are  specific and can be cut and pasted to try, we will assume the following:&lt;br /&gt;
* Target Image-&amp;gt; core-image-sato-sdk&lt;br /&gt;
** see section[[#Why SDK Image]] for why you have to build the sdk image and how to work around it if you really don&#039;t want to.&lt;br /&gt;
*  Target Machine -&amp;gt; qemux86&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== Making a Suitable Qemux86 Image===&lt;br /&gt;
* We need to build a core-image-sato-sdk that has the pieces needed by Eclipse, so we add/change the following in our conf/local.conf:&lt;br /&gt;
** We add the following to EXTRA_IMAGE_FEATURES in conf/local.conf&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; eclipse-debug  &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds gdbserver,tcf-agent (for Target Communication Framework), and openssh-sftp-server)&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; tools-sdk &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds the build requirements on the target rootfs.  This is needed since the Yocto Eclipse plugin is assuming that the qemu rootfs and the sysroot are synonymous.&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This defaults to the openssl ssh server rather than dropbear. You can use either so this line can be omitted since the sftp server works with either.&lt;br /&gt;
** Execute: &amp;lt;code&amp;gt; $bitbake core-image-sato&amp;lt;/code&amp;gt;&lt;br /&gt;
*** This makes a rootfs in tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2&lt;br /&gt;
* We need to build the toolchain eclipse will use&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake core-image-sato -c populate_sdk &amp;lt;/code&amp;gt;&lt;br /&gt;
***  This makes sdk stuff  such as the toolchains eclipse will use to build, &lt;br /&gt;
* We need to build a version of qemu that can run natively on our workstation as well as a userspace nfs daemon.&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake meta-ide-support &amp;lt;/code&amp;gt;&lt;br /&gt;
* We need an extracted rootfs that can be used by the userspace nfs daemon to boot qemu.  &lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $mkdir MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Execute &amp;lt;code&amp;gt; $runqemu-extract-sdk tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 MY_QEMU_ROOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This will result in a fully extracted rootfs in MY_QEMU_ROOTFS and a set of permissions maintained by pseudo (a yocto tool similar to but more functional than fakeroot) for the rootfs in MY_QEMU_ROOTFS.pseudo_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Built Qemux86 Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration For the Built Image ====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Build System Derived Toolchain&lt;br /&gt;
** enter Toolchain Root Location: &amp;lt;build dir&amp;gt;&lt;br /&gt;
*** this is  where you have been running bitbake core-image-sato, bitbake etc.&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: &amp;lt;path&amp;gt;/tmp/deploy/images/qemux86/bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel we built&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
=== Alternatively, Downloading what we need for Qemux86===&lt;br /&gt;
Sometimes, you may not want to build everything yourself but just want to download what you need.  These instructions will target the Yocto 2.1 release, but you should be able to translate it into other releases pretty easily.&lt;br /&gt;
* Download the image http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/core-image-sato-sdk-qemux86.tar.bz2  Note, the image MUST be an SDK image.  Images without sdk in the name will NOT work.&lt;br /&gt;
* Download the toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh  Note, the toolchain must NOT be one with -ext in the name. The ext toolchains are for the extensible SDK which is useful for CLI and recipe development but which is not currently compatible with Eclipse.&lt;br /&gt;
* unpack the toolchain to a dir by running the shell script file you downloaded:&lt;br /&gt;
 &amp;lt;code&amp;gt;$chmod a+x poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;$sh poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
This will put the toolchain in /opt/poky/2.1 by default.&lt;br /&gt;
* source the toolchain environment file &lt;br /&gt;
 &amp;lt;code&amp;gt; $source environment-setup-i586-poky-linux &amp;lt;/code&amp;gt;&lt;br /&gt;
* extract the image you downloaded so that Qemu can use it&lt;br /&gt;
 &amp;lt;code&amp;gt; $runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2  MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
* Downloads a kernel Qemu can use to boot: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/bzImage-qemux86.bin&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Downloaded Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration  For the Downloaded Image====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Standalone pre built toolchain&lt;br /&gt;
** enter Toolchain Root Location: /opt/poky/2.1&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel you downloaded&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run Qemu ===&lt;br /&gt;
* goto &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; and select qemu_i586-poky-linux (in our example; in general it will be architecture-distro-os)&lt;br /&gt;
** click Run - this will bring up a Qemu instance.&lt;br /&gt;
==== Put the binary on the Qemu instance and debug it ====&lt;br /&gt;
* goto &amp;lt;code&amp;gt;Run-&amp;gt;Debug Configurations...&amp;lt;/code&amp;gt; and select your project (looks like hello_gdb_i586-poky-linux in our case if you named the project hello)&lt;br /&gt;
* make a new connection - I prefer SSH so I&#039;ll show that here. TCF should also work.&lt;br /&gt;
** Click New... on Connection line&lt;br /&gt;
** put 192.168.7.2 (probably, look at the end of the qemu xterm that launched and find ip=192.168.7.XX::192.168.7.XX-1 ) in the Host name&lt;br /&gt;
** name it&lt;br /&gt;
** click finish&lt;br /&gt;
===== Eclipse Oxygen and TCF =====&lt;br /&gt;
* In Mars, TCF would appear as a connection type alongside ssh. &lt;br /&gt;
* In Oxygen, this is no longer true. If you want to use tcf as the connection type you need to do the following:&lt;br /&gt;
** At the bottom of the DEbug Configuration page, by default, you will be in &amp;quot;Using GDB (DSF) Automatic Remote Debugging Launcher&amp;quot; - Select other...&lt;br /&gt;
** Click on &amp;quot;Select other...&amp;quot; and you can choose GDB (DSF) Automatic REmove Debugging via TCF/TE Launcher. This is the oxygen equivalent of a TCF connection.&lt;br /&gt;
*** at this point, your connection will be of type tcf&lt;br /&gt;
* Browse to where the prog will go. I tend to use /home/root.&lt;br /&gt;
** Remote Absolute File Path for C/C++ Application -&amp;gt; click Browse...&lt;br /&gt;
** Goto Root-&amp;gt;/-&amp;gt;home-&amp;gt;root  remember the user is root and the password is empty by default.&lt;br /&gt;
** double click root&lt;br /&gt;
** click ok&lt;br /&gt;
** If the browse to Remote Absolute File Path for C/C++ Application hangs or errors out Check&lt;br /&gt;
*** qemu is running&lt;br /&gt;
*** you can ssh root@&amp;lt;address&amp;gt; from a terminal window&lt;br /&gt;
*** make sure that the proxies eclipse knows about in Window-&amp;gt;Preferences-&amp;gt;Network Connections is not &amp;quot;eating&amp;quot; the ssh connection traffic.  On Oxygen, for instance, I need to switch the network connection to manual and add 192.168.7.2 as a Proxy bypass host.&lt;br /&gt;
* click Apply&lt;br /&gt;
* click Debug and open the Debug Perspective.&lt;br /&gt;
&lt;br /&gt;
== Other Useful Info ==&lt;br /&gt;
=== Why SDK Image ===&lt;br /&gt;
The current poky-eclipse plugin mashes together 2 concepts that should have been disjoint: namely, the target sysroot and the rootfs image qemu will boot.  Under &amp;lt;code&amp;gt; Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt;, you choose a sysroot location.  Up above I told you to point this to the MY_QEMU_ROOTFS you extracted with runqemu-extract-sdk.  This will work, but only if you have built the sdk image.  If you built the core-image-sato instead, then the MY_QEMU_ROOTFS will be missing a lot of important development files like stdio.h... &lt;br /&gt;
====  How to Work around this ====&lt;br /&gt;
Let&#039;s say you build core-image-sato (this is a standin for your particular image that can&#039;t have the sdk parts tossed in for some reason).  You can still use eclipse and qemu. You need to do the same things as above with the following changes:&lt;br /&gt;
*  &amp;lt;code&amp;gt;Sysroot in  Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt; points to &amp;lt;builddir&amp;gt;/tmp/sysroots/qemux86-64.  This will give the build system access to the development files it needs.&lt;br /&gt;
* In the dialog for &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; you will need to read the long Argument string in the big box.   It will have something like &amp;lt;code&amp;gt; -e &amp;quot;source env-setup-&amp;lt;sdkarch&amp;gt;;  runqemu &amp;lt;kernel path&amp;gt; &amp;lt;rootfs path&amp;gt; &amp;lt;/code&amp;gt; Because the current plugin munges the sysroot and qemu image concepts, the &amp;lt;rootfs path&amp;gt; will incorrectly be pointing to your sysroot. Just delete the &amp;lt;rootfs path&amp;gt; and put in the ABSOLUTE path to the MY_QEMU_ROOTFS you extracted with the runqemu-extract-sdk tool. This way, you can build &amp;amp; debug the image even if it&#039;s not an sdk image.&lt;br /&gt;
&lt;br /&gt;
=== Adding static tap devices ===&lt;br /&gt;
It is often easier to preconfigure several tap devices so that qemu can run and use them without needing to be root or use sudo.  To do this, run &amp;lt;code&amp;gt; runqemu-gen-tapdevs `id -u &amp;lt;username&amp;gt;` `id -g &amp;lt;username&amp;gt;` 4 `find ./tmp/sysroots -iname tunctl`&amp;lt;/code&amp;gt; as root. This will make the inet devices tap0,tap1,tap2,tap3.  You can see them with &amp;lt;code&amp;gt; ifconfig -a | grep tap &amp;lt;/code&amp;gt;.  Typically, tap0 is 192.168.7.1 and so when the first qemu is run it&#039;s address will be 192.168.7.2 and 192.168.7.1 will be that qemu instance&#039;s gateway. The runqemu-gen-tapdevs  is located in bitbake/scripts.&lt;br /&gt;
&lt;br /&gt;
scripts/runqemu-gen-tapdevs&lt;br /&gt;
&lt;br /&gt;
=== Switching autotools C/C++ project from one toolchain/sysroot to another and build failing===&lt;br /&gt;
Sometimes you will have an existing project and want to switch to a different toolchain or sysroot or machine (x86-&amp;gt;x86-64 for instance).  If you find that you are getting errors like &amp;lt;code&amp;gt;install-sh not found&amp;lt;/code&amp;gt; it may mean that your autotools files have gotten out of sync.   Here&#039;s how you can force them back. All of these are found by Right clicking on the project and going to Invoke Autotools-&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Libtoolize  option = &amp;quot;--force&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Aclocal&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoheader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Automake  option = &amp;quot;--force-missing --add-missing&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoconf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then Right click on the project and select &amp;lt;code&amp;gt; Reconfigure Project &amp;lt;/code&amp;gt;.  You should now be able to build the project again.&lt;br /&gt;
&lt;br /&gt;
=== Dealing with java.lang.NullPointerException ===&lt;br /&gt;
Eclipse upstream has some issues with *some* of the GTK3 libraries shipped with some of the distributions(https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736). If you are seeing a NullPointer Exception try adding the following to your eclipse.ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an in place snippet of a happy ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 -showsplash&lt;br /&gt;
 org.eclipse.platform&lt;br /&gt;
 --launcher.XXMaxPermSize&lt;br /&gt;
 256m&lt;br /&gt;
 --launcher.defaultAction&lt;br /&gt;
 openFile&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 --launcher.appendVmargs&lt;br /&gt;
 -vmargs&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Alternatively, you can set &lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $export SWT_GTK3=0&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
But this might affect other programs as well.&lt;br /&gt;
&lt;br /&gt;
=== XWayland workaround with &amp;lt;code&amp;gt;gtk3&amp;lt;/code&amp;gt; (Fedora-25) ===&lt;br /&gt;
&lt;br /&gt;
If you see bizarre screen layout of controls in Eclipse Neon, it is probably because the Neon (4.6.x) release of Eclipse is not fully compatible with straight Wayland.&lt;br /&gt;
&lt;br /&gt;
Fedora-25 now has Wayland by default. To enable the XWayland backend:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export GDK_BACKEND=x11&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will still use gtk3, but will use the XWayland bridge rather than straight Wayland. This is expected to be fixed in the Oxygen (4.7) release of Eclipse to support straight Wayland.(https://bugs.eclipse.org/bugs/show_bug.cgi?id=496923)&lt;br /&gt;
&lt;br /&gt;
Thanks to Roland Grunber (Red Hat Linux Tools team) for pointing me in the right direction on #fedora-linux (freenode IRC).&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2016/10/06/make-applications-eclipse-use-x11-backend-on-wayland-fedora-25/#more-502&lt;br /&gt;
&lt;br /&gt;
==== How to know what version of &amp;lt;code&amp;gt;gtk&amp;lt;/code&amp;gt; is being used in your session? ====&lt;br /&gt;
&amp;lt;code&amp;gt;Help -&amp;gt; About -&amp;gt; Installation Details -&amp;gt; Configuration Tab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;org.eclipse.swt.internal.gtk.version=3.22.6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2014/10/27/how-to-tell-if-you-are-running-eclipse-on-gtk2-or-on-gtk3/&lt;br /&gt;
&lt;br /&gt;
==== How do you know you are running Wayland? ====&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt; which should show you a list of sessions, one of which will be &amp;lt;code&amp;gt;gdm&amp;lt;/code&amp;gt;, remember that session number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl show-session &amp;lt;session number from above&amp;gt; -p Type&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Type=wayland&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] http://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31612</id>
		<title>TipsAndTricks/RunningEclipseAgainstBuiltImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/RunningEclipseAgainstBuiltImage&amp;diff=31612"/>
		<updated>2017-09-13T23:19:52Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Cookbook guide to Making an Eclipse Debug Capable Image =&lt;br /&gt;
Suppose you are building images and would like to be able to use Eclipse and the Yocto Eclipse plugin to develop/debug a C/C++ application on either a remote hardware target or on qemu.  This cookbook will explain the small number of steps needed to accomplish this.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So that the commands are  specific and can be cut and pasted to try, we will assume the following:&lt;br /&gt;
* Target Image-&amp;gt; core-image-sato-sdk&lt;br /&gt;
** see section[[#Why SDK Image]] for why you have to build the sdk image and how to work around it if you really don&#039;t want to.&lt;br /&gt;
*  Target Machine -&amp;gt; qemux86&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== Making a Suitable Qemux86 Image===&lt;br /&gt;
* We need to build a core-image-sato-sdk that has the pieces needed by Eclipse, so we add/change the following in our conf/local.conf:&lt;br /&gt;
** We add the following to EXTRA_IMAGE_FEATURES in conf/local.conf&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; eclipse-debug  &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds gdbserver,tcf-agent (for Target Communication Framework), and openssh-sftp-server)&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; tools-sdk &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This adds the build requirements on the target rootfs.  This is needed since the Yocto Eclipse plugin is assuming that the qemu rootfs and the sysroot are synonymous.&lt;br /&gt;
***  &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This defaults to the openssl ssh server rather than dropbear. You can use either so this line can be omitted since the sftp server works with either.&lt;br /&gt;
** Execute: &amp;lt;code&amp;gt; $bitbake core-image-sato&amp;lt;/code&amp;gt;&lt;br /&gt;
*** This makes a rootfs in tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2&lt;br /&gt;
* We need to build the toolchain eclipse will use&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake core-image-sato -c populate_sdk &amp;lt;/code&amp;gt;&lt;br /&gt;
***  This makes sdk stuff  such as the toolchains eclipse will use to build, &lt;br /&gt;
* We need to build a version of qemu that can run natively on our workstation as well as a userspace nfs daemon.&lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $bitbake meta-ide-support &amp;lt;/code&amp;gt;&lt;br /&gt;
* We need an extracted rootfs that can be used by the userspace nfs daemon to boot qemu.  &lt;br /&gt;
** Execute &amp;lt;code&amp;gt; $mkdir MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
*** Execute &amp;lt;code&amp;gt; $runqemu-extract-sdk tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 MY_QEMU_ROOTFS&amp;lt;/code&amp;gt;&lt;br /&gt;
**** This will result in a fully extracted rootfs in MY_QEMU_ROOTFS and a set of permissions maintained by pseudo (a yocto tool similar to but more functional than fakeroot) for the rootfs in MY_QEMU_ROOTFS.pseudo_state&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Built Qemux86 Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration For the Built Image ====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Build System Derived Toolchain&lt;br /&gt;
** enter Toolchain Root Location: &amp;lt;build dir&amp;gt;&lt;br /&gt;
*** this is  where you have been running bitbake core-image-sato, bitbake etc.&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: &amp;lt;path&amp;gt;/tmp/deploy/images/qemux86/bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel we built&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
=== Alternatively, Downloading what we need for Qemux86===&lt;br /&gt;
Sometimes, you may not want to build everything yourself but just want to download what you need.  These instructions will target the Yocto 2.1 release, but you should be able to translate it into other releases pretty easily.&lt;br /&gt;
* Download the image http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/core-image-sato-sdk-qemux86.tar.bz2  Note, the image MUST be an SDK image.  Images without sdk in the name will NOT work.&lt;br /&gt;
* Download the toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh  Note, the toolchain must NOT be one with -ext in the name. The ext toolchains are for the extensible SDK which is useful for CLI and recipe development but which is not currently compatible with Eclipse.&lt;br /&gt;
* unpack the toolchain to a dir by running the shell script file you downloaded:&lt;br /&gt;
 &amp;lt;code&amp;gt;$chmod a+x poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;$sh poky-glibc-x86_64-core-image-sato-i586-toolchain-2.1.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
This will put the toolchain in /opt/poky/2.1 by default.&lt;br /&gt;
* source the toolchain environment file &lt;br /&gt;
 &amp;lt;code&amp;gt; $source environment-setup-i586-poky-linux &amp;lt;/code&amp;gt;&lt;br /&gt;
* extract the image you downloaded so that Qemu can use it&lt;br /&gt;
 &amp;lt;code&amp;gt; $runqemu-extract-sdk core-image-sato-sdk-qemux86.tar.bz2  MY_QEMU_ROOTFS &amp;lt;/code&amp;gt;&lt;br /&gt;
* Downloads a kernel Qemu can use to boot: http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/machines/qemu/qemux86/bzImage-qemux86.bin&lt;br /&gt;
&lt;br /&gt;
=== Running Eclipse Against the Downloaded Image ===&lt;br /&gt;
This Cookbook assumes you have already installed the Eclipse Poky plugin following the directions in http://www.yoctoproject.org/docs/latest/sdk-manual/sdk-manual.html.  Assuming that is true, you can&lt;br /&gt;
==== Set up the Configuration  For the Downloaded Image====&lt;br /&gt;
* Goto Windows-&amp;gt;Preferences-&amp;gt;Yocto Project SDK&lt;br /&gt;
** Select Standalone pre built toolchain&lt;br /&gt;
** enter Toolchain Root Location: /opt/poky/2.1&lt;br /&gt;
** enter Sysroot Location: &amp;lt;path&amp;gt;/MY_QEMU_ROOTFS &lt;br /&gt;
*** this is where you extracted the core-image-sato-qemux86.tar.bz2 to by running runqemu-extract-sdk &lt;br /&gt;
** enter Qemu/Kernel: bzImage-qemux86.bin&lt;br /&gt;
*** this is the kernel you downloaded&lt;br /&gt;
** You should now see i586-poky-linux in the Target Architecture dropdown list.&lt;br /&gt;
** hit apply and ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run Qemu ===&lt;br /&gt;
* goto &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; and select qemu_i586-poky-linux (in our example; in general it will be architecture-distro-os)&lt;br /&gt;
** click Run - this will bring up a Qemu instance.&lt;br /&gt;
==== Put the binary on the Qemu instance and debug it ====&lt;br /&gt;
* goto &amp;lt;code&amp;gt;Run-&amp;gt;Debug Configurations...&amp;lt;/code&amp;gt; and select your project (looks like hello_gdb_i586-poky-linux in our case if you named the project hello)&lt;br /&gt;
* make a new connection - I prefer SSH so I&#039;ll show that here. TCF should also work.&lt;br /&gt;
** Click New... on Connection line&lt;br /&gt;
** put 192.168.7.2 (probably, look at the end of the qemu xterm that launched and find ip=192.168.7.XX::192.168.7.XX-1 ) in the Host name&lt;br /&gt;
** name it&lt;br /&gt;
** click finish&lt;br /&gt;
* Browse to where the prog will go. I tend to use /home/root.&lt;br /&gt;
** Remote Absolute File Path for C/C++ Application -&amp;gt; click Browse...&lt;br /&gt;
** Goto Root-&amp;gt;/-&amp;gt;home-&amp;gt;root  remember the user is root and the password is empty by default.&lt;br /&gt;
** double click root&lt;br /&gt;
** click ok&lt;br /&gt;
** If the browse to Remote Absolute File Path for C/C++ Application hangs or errors out Check&lt;br /&gt;
*** qemu is running&lt;br /&gt;
*** you can ssh root@&amp;lt;address&amp;gt; from a terminal window&lt;br /&gt;
*** make sure that the proxies eclipse knows about in Window-&amp;gt;Preferences-&amp;gt;Network Connections is not &amp;quot;eating&amp;quot; the ssh connection traffic.  On Oxygen, for instance, I need to switch the network connection to manual and add 192.168.7.2 as a Proxy bypass host.&lt;br /&gt;
* click Apply&lt;br /&gt;
* click Debug and open the Debug Perspective. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Useful Info ==&lt;br /&gt;
=== Why SDK Image ===&lt;br /&gt;
The current poky-eclipse plugin mashes together 2 concepts that should have been disjoint: namely, the target sysroot and the rootfs image qemu will boot.  Under &amp;lt;code&amp;gt; Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt;, you choose a sysroot location.  Up above I told you to point this to the MY_QEMU_ROOTFS you extracted with runqemu-extract-sdk.  This will work, but only if you have built the sdk image.  If you built the core-image-sato instead, then the MY_QEMU_ROOTFS will be missing a lot of important development files like stdio.h... &lt;br /&gt;
====  How to Work around this ====&lt;br /&gt;
Let&#039;s say you build core-image-sato (this is a standin for your particular image that can&#039;t have the sdk parts tossed in for some reason).  You can still use eclipse and qemu. You need to do the same things as above with the following changes:&lt;br /&gt;
*  &amp;lt;code&amp;gt;Sysroot in  Window-&amp;gt;Preferences-&amp;gt;Yocto Project SDK &amp;lt;/code&amp;gt; points to &amp;lt;builddir&amp;gt;/tmp/sysroots/qemux86-64.  This will give the build system access to the development files it needs.&lt;br /&gt;
* In the dialog for &amp;lt;code&amp;gt; Run-&amp;gt;External Tools-&amp;gt; External Tools Configurations... &amp;lt;/code&amp;gt; you will need to read the long Argument string in the big box.   It will have something like &amp;lt;code&amp;gt; -e &amp;quot;source env-setup-&amp;lt;sdkarch&amp;gt;;  runqemu &amp;lt;kernel path&amp;gt; &amp;lt;rootfs path&amp;gt; &amp;lt;/code&amp;gt; Because the current plugin munges the sysroot and qemu image concepts, the &amp;lt;rootfs path&amp;gt; will incorrectly be pointing to your sysroot. Just delete the &amp;lt;rootfs path&amp;gt; and put in the ABSOLUTE path to the MY_QEMU_ROOTFS you extracted with the runqemu-extract-sdk tool. This way, you can build &amp;amp; debug the image even if it&#039;s not an sdk image.&lt;br /&gt;
&lt;br /&gt;
=== Adding static tap devices ===&lt;br /&gt;
It is often easier to preconfigure several tap devices so that qemu can run and use them without needing to be root or use sudo.  To do this, run &amp;lt;code&amp;gt; runqemu-gen-tapdevs `id -u &amp;lt;username&amp;gt;` `id -g &amp;lt;username&amp;gt;` 4 `find ./tmp/sysroots -iname tunctl`&amp;lt;/code&amp;gt; as root. This will make the inet devices tap0,tap1,tap2,tap3.  You can see them with &amp;lt;code&amp;gt; ifconfig -a | grep tap &amp;lt;/code&amp;gt;.  Typically, tap0 is 192.168.7.1 and so when the first qemu is run it&#039;s address will be 192.168.7.2 and 192.168.7.1 will be that qemu instance&#039;s gateway. The runqemu-gen-tapdevs  is located in bitbake/scripts.&lt;br /&gt;
&lt;br /&gt;
scripts/runqemu-gen-tapdevs&lt;br /&gt;
&lt;br /&gt;
=== Switching autotools C/C++ project from one toolchain/sysroot to another and build failing===&lt;br /&gt;
Sometimes you will have an existing project and want to switch to a different toolchain or sysroot or machine (x86-&amp;gt;x86-64 for instance).  If you find that you are getting errors like &amp;lt;code&amp;gt;install-sh not found&amp;lt;/code&amp;gt; it may mean that your autotools files have gotten out of sync.   Here&#039;s how you can force them back. All of these are found by Right clicking on the project and going to Invoke Autotools-&amp;gt;:&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Libtoolize  option = &amp;quot;--force&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Aclocal&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoheader&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Automake  option = &amp;quot;--force-missing --add-missing&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; Invoke Autoconf&amp;lt;/code&amp;gt;&lt;br /&gt;
Then Right click on the project and select &amp;lt;code&amp;gt; Reconfigure Project &amp;lt;/code&amp;gt;.  You should now be able to build the project again.&lt;br /&gt;
&lt;br /&gt;
=== Dealing with java.lang.NullPointerException ===&lt;br /&gt;
Eclipse upstream has some issues with *some* of the GTK3 libraries shipped with some of the distributions(https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736). If you are seeing a NullPointer Exception try adding the following to your eclipse.ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an in place snippet of a happy ini file:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 -showsplash&lt;br /&gt;
 org.eclipse.platform&lt;br /&gt;
 --launcher.XXMaxPermSize&lt;br /&gt;
 256m&lt;br /&gt;
 --launcher.defaultAction&lt;br /&gt;
 openFile&lt;br /&gt;
 --launcher.GTK_version&lt;br /&gt;
 2&lt;br /&gt;
 --launcher.appendVmargs&lt;br /&gt;
 -vmargs&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Alternatively, you can set &lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $export SWT_GTK3=0&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
But this might affect other programs as well.&lt;br /&gt;
&lt;br /&gt;
=== XWayland workaround with &amp;lt;code&amp;gt;gtk3&amp;lt;/code&amp;gt; (Fedora-25) ===&lt;br /&gt;
&lt;br /&gt;
If you see bizarre screen layout of controls in Eclipse Neon, it is probably because the Neon (4.6.x) release of Eclipse is not fully compatible with straight Wayland.&lt;br /&gt;
&lt;br /&gt;
Fedora-25 now has Wayland by default. To enable the XWayland backend:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export GDK_BACKEND=x11&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will still use gtk3, but will use the XWayland bridge rather than straight Wayland. This is expected to be fixed in the Oxygen (4.7) release of Eclipse to support straight Wayland.(https://bugs.eclipse.org/bugs/show_bug.cgi?id=496923)&lt;br /&gt;
&lt;br /&gt;
Thanks to Roland Grunber (Red Hat Linux Tools team) for pointing me in the right direction on #fedora-linux (freenode IRC).&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2016/10/06/make-applications-eclipse-use-x11-backend-on-wayland-fedora-25/#more-502&lt;br /&gt;
&lt;br /&gt;
==== How to know what version of &amp;lt;code&amp;gt;gtk&amp;lt;/code&amp;gt; is being used in your session? ====&lt;br /&gt;
&amp;lt;code&amp;gt;Help -&amp;gt; About -&amp;gt; Installation Details -&amp;gt; Configuration Tab&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look for something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;org.eclipse.swt.internal.gtk.version=3.22.6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] https://coffeeorientedprogramming.com/2014/10/27/how-to-tell-if-you-are-running-eclipse-on-gtk2-or-on-gtk3/&lt;br /&gt;
&lt;br /&gt;
==== How do you know you are running Wayland? ====&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl&amp;lt;/code&amp;gt; which should show you a list of sessions, one of which will be &amp;lt;code&amp;gt;gdm&amp;lt;/code&amp;gt;, remember that session number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;loginctl show-session &amp;lt;session number from above&amp;gt; -p Type&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Type=wayland&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Source] http://unix.stackexchange.com/questions/202891/how-to-know-whether-wayland-or-x11-is-being-used&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31084</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31084"/>
		<updated>2017-08-29T22:25:12Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container. This wiki assumes you have followed the basic documentation on the CROPS github Readme&#039;s (like https://github.com/crops/poky-container) and are looking for more tips.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk. It works equally well with an old fashioned sdk (e.g. one without devtool but with a sysroot and a toolchain).&lt;br /&gt;
&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Instructions and explanations for Mac and Windows can be found here:&lt;br /&gt;
https://github.com/crops/docker-win-mac-docs/wiki&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;br /&gt;
== Workflow == &lt;br /&gt;
I tend to run this under tmux. I keep one tmux panel inside the container for commands and another outside the container to do host side editing/git operations.&lt;br /&gt;
==  Git issues ==&lt;br /&gt;
Sometimes i try to do something in the container like git stash save &amp;quot;my stash&amp;quot; and it fails telling me that pokyuser does not have a default git user or email setup.  There are 2 ways to work around this.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31082</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31082"/>
		<updated>2017-08-29T21:01:47Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container. This wiki assumes you have followed the basic documentation on the CROPS github Readme&#039;s (like https://github.com/crops/poky-container) and are looking for more tips.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk. It works equally well with an old fashioned sdk (e.g. one without devtool but with a sysroot and a toolchain).&lt;br /&gt;
&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Instructions and explanations for Mac and Windows can be found here:&lt;br /&gt;
https://github.com/crops/docker-win-mac-docs/wiki&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31080</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31080"/>
		<updated>2017-08-29T21:00:27Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* eSDK */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container. This wiki assumes you have followed the basic documentation on the CROPS github Readme&#039;s (like https://github.com/crops/poky-container) and are looking for more tips.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk. It works equally well with an old fashioned sdk (e.g. one without devtool but with a sysroot and a toolchain).&lt;br /&gt;
&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31079</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31079"/>
		<updated>2017-08-29T20:59:34Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container. This wiki assumes you have followed the basic documentation on the CROPS github Readme&#039;s (like https://github.com/crops/poky-container) and are looking for more tips.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk.&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31078</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31078"/>
		<updated>2017-08-29T20:58:51Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container. This wiki assumes you have followed the basic documentation on the CROPS github Readme&#039;s (like https://github.com/crops/poky-container) and are looking for more tips.&lt;br /&gt;
&lt;br /&gt;
== How to Get Started ==&lt;br /&gt;
The setup on Mac and Windows requires some extra steps before you get up and running. This is due to the fact that neither the Mac nor the Windows file systems support all the features we need to do a build.  To deal with this issue on these OS&#039;s we put the build into a persistent docker volume (https://docs.docker.com/engine/tutorials/dockervolumes/) and expose it to the host OS using a Samba container.  The detailed instructions for doing this are located at https://github.com/crops/docker-win-mac-docs/wiki &lt;br /&gt;
&lt;br /&gt;
If you plan to use these containers on Linux, you can skip the docker volume and the Samba container instructions as they are unnecessary.  The detailed instructions for running the various containers are located in the README.md for each container source on github.  Pointers to these instructions for the Poky,eSDK, and Toaster containers are located at the bottom of the above referenced wiki.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk.&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31077</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31077"/>
		<updated>2017-08-29T20:57:18Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Issues with File Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container.&lt;br /&gt;
&lt;br /&gt;
== How to Get Started ==&lt;br /&gt;
The setup on Mac and Windows requires some extra steps before you get up and running. This is due to the fact that neither the Mac nor the Windows file systems support all the features we need to do a build.  To deal with this issue on these OS&#039;s we put the build into a persistent docker volume (https://docs.docker.com/engine/tutorials/dockervolumes/) and expose it to the host OS using a Samba container.  The detailed instructions for doing this are located at https://github.com/crops/docker-win-mac-docs/wiki &lt;br /&gt;
&lt;br /&gt;
If you plan to use these containers on Linux, you can skip the docker volume and the Samba container instructions as they are unnecessary.  The detailed instructions for running the various containers are located in the README.md for each container source on github.  Pointers to these instructions for the Poky,eSDK, and Toaster containers are located at the bottom of the above referenced wiki.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk.&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busybox&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31065</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31065"/>
		<updated>2017-08-29T17:28:21Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container.&lt;br /&gt;
&lt;br /&gt;
== How to Get Started ==&lt;br /&gt;
The setup on Mac and Windows requires some extra steps before you get up and running. This is due to the fact that neither the Mac nor the Windows file systems support all the features we need to do a build.  To deal with this issue on these OS&#039;s we put the build into a persistent docker volume (https://docs.docker.com/engine/tutorials/dockervolumes/) and expose it to the host OS using a Samba container.  The detailed instructions for doing this are located at https://github.com/crops/docker-win-mac-docs/wiki &lt;br /&gt;
&lt;br /&gt;
If you plan to use these containers on Linux, you can skip the docker volume and the Samba container instructions as they are unnecessary.  The detailed instructions for running the various containers are located in the README.md for each container source on github.  Pointers to these instructions for the Poky,eSDK, and Toaster containers are located at the bottom of the above referenced wiki.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk.&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;br /&gt;
&lt;br /&gt;
== Issues with File Paths ==&lt;br /&gt;
While the default way to run the containers (using crops/poky as an example but this applies equally well to the others).&lt;br /&gt;
  docker run --rm -it -v /home/myuser/mystuff:/workdir crops/poky --workdir=/workdir&lt;br /&gt;
highlights the fact that the directory path inside the container is &amp;lt;strong&amp;gt;independent&amp;lt;/strong&amp;gt; of the directory path on the host, this can sometimes be confusing. So, it is also quite reasonable to run the container like so:&lt;br /&gt;
 cd /home/myuser/mystuff&lt;br /&gt;
 docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)&lt;br /&gt;
This way, inside the container you have the same directory path as you do outside of the container.  For things like &lt;br /&gt;
 devtool modify busyboxl&lt;br /&gt;
 devtool find-recipe busybox&lt;br /&gt;
this can make cutting and pasting easier from the &amp;quot;in container terminal&amp;quot; which lacks an editor into the editor or terminal with an editor on the host system.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31064</id>
		<title>TipsAndTricks/CropsCLIContainers</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/CropsCLIContainers&amp;diff=31064"/>
		<updated>2017-08-29T17:14:34Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Poky */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CROPS or How to Run  bitbake/devtool/eSDK/Toaster on Your MacWinux Host=&lt;br /&gt;
== Introduction ==&lt;br /&gt;
CROPS provides CLI containers that allow you to run the set of tools listed in the title on Mac OSX, Windows or Linux.&lt;br /&gt;
The containers themselves are available on Dockerhub at https://hub.docker.com/u/crops/dashboard/&lt;br /&gt;
&lt;br /&gt;
You may wonder why you would use these containers on Linux. The main reason is it gives you a guaranteed clean environment from which to build. Also it means you don&#039;t need to install the dependent packages required by the build tools. Measurements show &#039;&#039;&#039;no&#039;&#039;&#039; speed degradation when running in the container.&lt;br /&gt;
&lt;br /&gt;
== How to Get Started ==&lt;br /&gt;
The setup on Mac and Windows requires some extra steps before you get up and running. This is due to the fact that neither the Mac nor the Windows file systems support all the features we need to do a build.  To deal with this issue on these OS&#039;s we put the build into a persistent docker volume (https://docs.docker.com/engine/tutorials/dockervolumes/) and expose it to the host OS using a Samba container.  The detailed instructions for doing this are located at https://github.com/crops/docker-win-mac-docs/wiki &lt;br /&gt;
&lt;br /&gt;
If you plan to use these containers on Linux, you can skip the docker volume and the Samba container instructions as they are unnecessary.  The detailed instructions for running the various containers are located in the README.md for each container source on github.  Pointers to these instructions for the Poky,eSDK, and Toaster containers are located at the bottom of the above referenced wiki.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt; NOTE: ALL the CROPS containers take a --help argument in case you forget the options! For example:&amp;lt;/strong&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt; docker run -it --rm crops/poky --help&lt;br /&gt;
&lt;br /&gt;
 usage: poky-entry.py [-h] [--workdir WORKDIR] [--id ID]&lt;br /&gt;
 optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  --workdir WORKDIR  The active directory once the container is running. In&lt;br /&gt;
                     the abscence of the &amp;quot;id&amp;quot; argument, the uid and gid of the&lt;br /&gt;
                     workdir will also be used for the user in the container.&lt;br /&gt;
  --id ID            uid and gid to use for the user inside the container. It&lt;br /&gt;
                     should be in the form uid:gid&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variations  Explained ==&lt;br /&gt;
=== Poky ===&lt;br /&gt;
The default Poky container is quite generic and will work with most recent releases of YP.  Despite the name, it simply contains all the dependent packages required by Poky but not the meta-data. It will work equally well for an OE Core setup.  The default container is based on the latest Ubuntu LTS that YP supports. We are in the process of creating ones based on the rest of the standard supported Linux Distro&#039;s.  For the common usage; however, which Distro is inside is  irrelevant since everything is already set up for the user.&lt;br /&gt;
&lt;br /&gt;
=== eSDK ===&lt;br /&gt;
The eSDK container is also generic in that it takes an extensible sdk install script as an argument so it can be used with a fairly arbitrary ext-sdk.&lt;br /&gt;
=== Toaster ===&lt;br /&gt;
Toaster is more complicated.  To facilitate quick startup, the Toaster containers include a database prepopulated from the layer index https://layers.openembedded.org.  Because of this, the toaster containers come in a couple of varieties.&lt;br /&gt;
* Toaster - https://hub.docker.com/r/crops/toaster/ - This is the last official release YP has available.  At the time of writing this T&amp;amp;T, for instance, this is  krogoth and will soon be morty.&lt;br /&gt;
* Toaster-krogoth - https://hub.docker.com/r/crops/toaster-krogoth  - The krogoth release.&lt;br /&gt;
* Toaster -morty - https://hub.docker.com/r/crops/toaster-morty/ - The RC release. We created this once the morty branch was named/made.&lt;br /&gt;
* Toaster-master - https://hub.docker.com/r/crops/toaster-master/ - This is the ever changing master version.  A new image is built for every commit to http://git.yoctoproject.org/cgit/cgit.cgi/poky/ on the master branch. We keep ~ 2 weeks back. A &amp;lt;code&amp;gt;docker pull toaster-master&amp;lt;/code&amp;gt; will give you the latest commit. If you want a particular commit, look at the tags page: https://hub.docker.com/r/crops/toaster-master/tags/ and you see a number of options.&lt;br /&gt;
** latest - the last successful (passed the Travis test viewable at https://travis-ci.org/crops/toaster-container ) &lt;br /&gt;
** latest-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - the latest tag points to the last of these. We also keep old ones around for ~ 2 weeks.&lt;br /&gt;
** toaster-next-&amp;lt;date&amp;gt;-&amp;lt;commitish&amp;gt; - This is built using the toaster-next branch of poky-contrib http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/?h=toaster-next. This is intended for people actively developing toaster source code itself.&lt;br /&gt;
&lt;br /&gt;
==Operating System Oddities==&lt;br /&gt;
While the purpose of the CROPS cli containers is to insulate the user from the vagaries of the host os, sometimes the oddness creeps in. Here&#039;s some of the host specific issues we&#039;ve run into so far in case they affect you too.&lt;br /&gt;
=== Mac OSX ===&lt;br /&gt;
==== Samba/Files ====&lt;br /&gt;
Sometimes you may find yourself unable to delete files from you docker volume from the host os.  If you see something like:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ rm  /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 override rwxrwxrwx  bavery/staff arch,uchg for/Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack? y&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
it means that a flag has been set that is preventing you from deleting the file. To see what flags are set on the file do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $ls -lO /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 -rwxrwxrwx  1 bavery  staff  arch,uchg 34188262 Oct 31 16:07 /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
In the above example , the uchg (user immutable) and arch (arvhived) flags are set. These need to be cleared using the command [https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html chflags]&lt;br /&gt;
To clear them do:&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 $chflags  noarch,nouchg   /Volumes/workdir/.git/objects/pack/pack-67ce6b1222786a14656905bd779637f00fb7225e.pack&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
Then you can rm the file.  Alternatively, you could do the rm from with in a container and the linux side is less persnickety.&lt;br /&gt;
=== Windows ===&lt;br /&gt;
The biggest issue for Windows so far is that Windows 10 Pro, Enterprise, and Education  can use [https://docs.docker.com/docker-for-windows/ Docker for Windows ] while earlier versions of Windows need to use [https://docs.docker.com/toolbox/overview/ Docker Toolbox].  Docker for Windows matches what is used on the Mac and is very similar to the experience on Linux. Docker Toolbox insets a VM (by default Virtualbox) in between the host and the cotainers.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=28909</id>
		<title>TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds&amp;diff=28909"/>
		<updated>2017-07-18T02:08:00Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Leveraging Pkg Feeds or How I got Tired of Burning Images =&lt;br /&gt;
I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I tend to do this first, if I want to make a recipe from scratch for software that I am not too familiar with.  This way, I can follow the instructions for building w/o reinterpretation, verify that I have or can build the necessary dependencies, and check that the sw works properly; all before diving into recipes.  I have found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.&lt;br /&gt;
&amp;lt;strong&amp;gt; Note: This works as well with kernel modules as it does with libraries/binaries&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this example, we will be building znc 1.6.5, an irc bouncer.  This is just a good complex example.   In order to use this guide, you should set up your bitbake environment and your target as outlined in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]&lt;br /&gt;
== Steps ==&lt;br /&gt;
* It&#039;s typically easies to make an image that has *most* of what you think you&#039;ll need. In this example, I added the following to my local.conf:&lt;br /&gt;
  EXTRA_IMAGE_FEATURES += &amp;quot; ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile &amp;quot;&lt;br /&gt;
* Now I&#039;ll grab the src code we will try to build &amp;lt;strong&amp;gt;Note: this is an ON TARGET build&amp;lt;/strong&amp;gt; the build host side is just for the dependencies...&lt;br /&gt;
 git clone https://github.com/znc/znc.git&lt;br /&gt;
 cd znc&lt;br /&gt;
 git checkout -b 1.6.5 znc-1.6.5&lt;br /&gt;
 * follow the build instructions&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure&lt;br /&gt;
This worked, but we decide we want to have cyrus support as well.&lt;br /&gt;
* First we try &lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
but we get&lt;br /&gt;
 configure: error: could not find libsasl2. Try --disable-cyrus.&lt;br /&gt;
&lt;br /&gt;
* So we need the cyrus-sals-dev pkg.  If we aren&#039;t sure where that is, we can use [https://layers.openembedded.org/layerindex/branch/master/layers/ openembedded layer index] and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.&lt;br /&gt;
  bitbake cyrus-sasl&lt;br /&gt;
and remake the package index&lt;br /&gt;
 bitbake package-index&lt;br /&gt;
* target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.&lt;br /&gt;
 $dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)&lt;br /&gt;
If this fails, make sure you followed the instructions in [https://wiki.yoctoproject.org/wiki/TipsAndTricks/EnablingAPackageFeed#Easiest_Way PkgFeeds the EasiestWay]. You should have set up the on target repo in  /etc/yum.repos.d/myrepo.repo and have a web server of some type pointed to tmp/deploy/rpm (like twistd -n web --path tmp/deploy/rpm -p 5678) on your build host.&lt;br /&gt;
* now we rerun configure and get:&lt;br /&gt;
 ./configure --enable-cyrus&lt;br /&gt;
&lt;br /&gt;
  ZNC 1.6.5 configured&lt;br /&gt;
 prefix:       /usr/local&lt;br /&gt;
 debug:        no&lt;br /&gt;
 ipv6:         yes&lt;br /&gt;
 openssl:      yes&lt;br /&gt;
 dns:          threads&lt;br /&gt;
 perl:         no&lt;br /&gt;
 python:       no&lt;br /&gt;
 swig:         not needed&lt;br /&gt;
 cyrus:        yes&lt;br /&gt;
 tcl:          no&lt;br /&gt;
 charset:      yes&lt;br /&gt;
 zlib:         yes&lt;br /&gt;
 run from src: no&lt;br /&gt;
&lt;br /&gt;
Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects. &lt;br /&gt;
* Let&#039;s build it&lt;br /&gt;
 ~/znc# make&lt;br /&gt;
 Packing man page znc.1.gz...&lt;br /&gt;
 Packing man page znc-buildmod.1.gz...&lt;br /&gt;
 It looks like git submodules are not initialized. Run: git submodule update --init --recursive&lt;br /&gt;
 make: *** [Makefile:168: third_party/Csocket/Csocket.h] Error 1&lt;br /&gt;
 ~/znc# git submodule update --init --recursive&lt;br /&gt;
 git: &#039;submodule&#039; is not a git command. See &#039;git --help&#039;.&lt;br /&gt;
Whoops, we need git submodule...  This one is harder to find. After verifying that we already have git-dev installed, I ended up searching the poky tree for git-submodule&lt;br /&gt;
 $ git grep git-submodule&lt;br /&gt;
 bitbake/lib/bb/tests/fetch.py:            fetcher = bb.fetch.Fetch([&amp;quot;gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165&lt;br /&gt;
 meta/recipes-devtools/git/git.inc:    ${libexecdir}/git-core/git-submodule \&lt;br /&gt;
If we look in meta/recipes-devtools/git/git.inc we can see that the git-submodule is included in git-perltools:&lt;br /&gt;
 PACKAGES =+ &amp;quot;${PN}-perltools&amp;quot;.&lt;br /&gt;
So we can pull in the git-perltools as well on the target:&lt;br /&gt;
 # dnf install git-perltools&lt;br /&gt;
and rerun the git submodule init&lt;br /&gt;
 # git submodule update --init --recursive&lt;br /&gt;
 Submodule &#039;Csocket&#039; (https://github.com/jimloco/Csocket.git) registered for path &#039;third_party/Csocket&#039;&lt;br /&gt;
 Cloning into &#039;/home/root/znc/third_party/Csocket&#039;...&lt;br /&gt;
 Submodule path &#039;third_party/Csocket&#039;: checked out &#039;448e18a29ed383451db3cb648a72da4fcbb3f8e5&#039;&lt;br /&gt;
&lt;br /&gt;
It worked :), and now we can successfully type make.  Having to reflash the image for each of these steps would have been much slower!&lt;br /&gt;
 # make&lt;br /&gt;
 Building module autocycle...&lt;br /&gt;
 Linking  module autocycle...&lt;br /&gt;
 ...&lt;br /&gt;
 Building core object SSLVerifyHost...&lt;br /&gt;
 Linking znc...&lt;br /&gt;
&lt;br /&gt;
 ZNC was successfully compiled.&lt;br /&gt;
 Use &#039;make install&#039; to install ZNC to &#039;/usr/local&#039;.&lt;br /&gt;
&lt;br /&gt;
* I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:&lt;br /&gt;
 $ bitbake zile&lt;br /&gt;
 $ bitbake package-index&lt;br /&gt;
Target -&amp;gt;&lt;br /&gt;
 # dnf install zile&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/DockerOnImage&amp;diff=28863</id>
		<title>TipsAndTricks/DockerOnImage</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/DockerOnImage&amp;diff=28863"/>
		<updated>2017-07-14T19:54:25Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Current Hacks Needed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This assumes you&#039;d like to build an image that supports docker on a YP image.  This is pretty straightforward due to the great work done  on the meta-virtualization layer, mostly by people at Wind River.  This document will show how to get docker running on a Nuc. I have run  the same image on a  Minnowboard (Turbot) successfully as well.  Note, these layers change, so this is accurate as of July 2017.&lt;br /&gt;
== What Layers Do You Need? ==&lt;br /&gt;
The main layer is meta-virtualization. This can be found using the layers.openembedded search app, Here&#039;s the [[https://layers.openembedded.org/layerindex/branch/master/layer/meta-virtualization/ meta-virtualiation]]  entry. As you can see from the dependency list, this layer requires oe-core,meta-oe, meta-networking, and meta-filesystems. Some of these (like meta-networking) have additional dependencies. Here&#039;s the complete list of additional layers you need:&lt;br /&gt;
* [[https://git.yoctoproject.org/git/meta-virtualization meta-virtualization]]&lt;br /&gt;
* [[git://git.openembedded.org/meta-openembedded meta-openembedded]]&lt;br /&gt;
** The meta-openembedded repo contains the rest of the needed layers:&lt;br /&gt;
*** meta-python&lt;br /&gt;
*** meta-networking&lt;br /&gt;
*** meta-filesystems&lt;br /&gt;
*** meta-oe&lt;br /&gt;
You need to add these (with absolute paths) to your build/conf/bblayers.conf file. BBLAYERS should look something like this:&lt;br /&gt;
 BBLAYERS ?= &amp;quot; \                                                                                                                                          &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/poky/meta \                                                                                                                                  &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/poky/meta-poky \                                                                                                                             &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/poky/meta-yocto-bsp \                                                                                                                        &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/meta-openembedded/meta-oe \                                                                                                                  &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/meta-openembedded/meta-python \                                                                                                              &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/meta-openembedded/meta-networking \                                                                                                          &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/meta-openembedded/meta-filesystems \                                                                                                         &lt;br /&gt;
  &amp;lt;AbsPath&amp;gt;/meta-virtualization \                        &lt;br /&gt;
&lt;br /&gt;
== What Configuration Changes Do you Need? ==&lt;br /&gt;
There are a number of configuration settings you need in your build/conf/local.conf in order to make this work. I&#039;ll list them below and try to explain why you need them:&lt;br /&gt;
 # this gives us the linux-yocto kernel for an x86-64 machine like minnowboard                                                                            &lt;br /&gt;
 MACHINE = &amp;quot;genericx86-64&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # Docker presumes systemd                                                                                                                                 &lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; systemd&amp;quot;&lt;br /&gt;
 VIRTUAL-RUNTIME_init_manager = &amp;quot;systemd&amp;quot;&lt;br /&gt;
 DISTRO_FEATURES_BACKFILL_CONSIDERED = &amp;quot;sysvinit&amp;quot;&lt;br /&gt;
 VIRTUAL-RUNTIME_initscripts = &amp;quot;systemd-compat-units&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # we need space for images                                                                                                                               &lt;br /&gt;
 IMAGE_ROOTFS_EXTRA_SPACE = &amp;quot;10000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # The extra space takes us above 4gb, so                                                                                                                 &lt;br /&gt;
 # turn off hdd and iso images so they do                                                                                                                 &lt;br /&gt;
 # not break                                                                                                                                              &lt;br /&gt;
 NOHDD=&amp;quot;1&amp;quot;&lt;br /&gt;
 NOISO=&amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # pick a kernel I know works:                                                                                                                            &lt;br /&gt;
 PREFERRED_PROVIDER_virtual/kernel=&amp;quot;linux-yocto&amp;quot;&lt;br /&gt;
 PREFERRED_VERSION_linux-yocto=&amp;quot;4.9%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 # add docker to the image                                                                                                                                &lt;br /&gt;
 # connman to manage the networking                                                                                                                       &lt;br /&gt;
 IMAGE_INSTALL_append = &amp;quot;  docker docker-contrib connman connman-client \                                                                                 &lt;br /&gt;
 &amp;quot;&lt;br /&gt;
== Current Hacks Needed ==&lt;br /&gt;
Some of this is not upstreamed yet, so here&#039;s some patches you may need to apply. Check and see of they have been accepted upstream or not, first...&lt;br /&gt;
=== Proxy problems ===&lt;br /&gt;
Once on the target board, you need to tell docker about your proxy (if you have one). This is a little hard to do by hand, so here are a couple of files you can insert into meta-virtualization to help you along.&lt;br /&gt;
&lt;br /&gt;
 meta-virtualization$ cat recipes-containers/docker/docker_git.bbappend&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 SRC_URI += &amp;quot;file://http-proxy.conf&amp;quot;&lt;br /&gt;
 do_install_append() {&lt;br /&gt;
    if [ -n &amp;quot;${http_proxy}&amp;quot; ]; then&lt;br /&gt;
        docker_config_dir=${sysconfdir}/systemd/system/docker.service.d&lt;br /&gt;
        install -d ${D}/$docker_config_dir&lt;br /&gt;
        sed -e s_{URL}_${http_proxy}_ ${WORKDIR}/http-proxy.conf &amp;gt; ${D}/$docker_config_dir/http-proxy.conf&lt;br /&gt;
    fi&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 meta-virtualization$ cat recipes-containers/docker/files/http-proxy.conf&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 Environment=&amp;quot;HTTP_PROXY={URL}/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== What To Build ==&lt;br /&gt;
Once these are all in place, you are ready to make your image. I&#039;d suggest building core-image-base. &amp;lt;strong&amp;gt; Note: core-image-mininal will NOT work since it does not include the kernel module packages by default.&amp;lt;/strong&amp;gt;&lt;br /&gt;
 $bitbake core-image-base&lt;br /&gt;
== How to get the image onto your usb key  ==&lt;br /&gt;
You need to check (lsusb or dmesg) to see that /dev/sdX  your usb key showed up as.&lt;br /&gt;
* sudo umount /dev/sdX1;sudo umount /dev/sdX2; &amp;lt;unmount any others as well&amp;gt; &lt;br /&gt;
** slow way &lt;br /&gt;
*** sudo dd if=tmp/deploy/images/genericx86-64/core-image-base-genericx86-64.wic of=/dev/sdX&lt;br /&gt;
** fast way&lt;br /&gt;
*** bitbake bmap-tools-native -caddto_recipe_sysroot&lt;br /&gt;
*** sudo chmod 666 /dev/sdX&lt;br /&gt;
*** oe-run-native bmap-tools-native bmaptool copy ./tmp/deploy/images/genericx86-64/core-image-base-genericx86-64.wic  /dev/sdX&lt;br /&gt;
== How to Test ==&lt;br /&gt;
You can now log onto your target Minnowboard, and you can test out docker, which should be running.&lt;br /&gt;
 $root@genericx86-64:~# docker info&lt;br /&gt;
 Containers: 0&lt;br /&gt;
  Running: 0&lt;br /&gt;
  Paused: 0&lt;br /&gt;
 Stopped: 0&lt;br /&gt;
 Images: 0&lt;br /&gt;
 Server Version: 1.13.0&lt;br /&gt;
 Storage Driver: vfs&lt;br /&gt;
 Logging Driver: json-file&lt;br /&gt;
 Cgroup Driver: cgroupfs&lt;br /&gt;
  Plugins: &lt;br /&gt;
  Volume: local&lt;br /&gt;
  Network: bridge host macvlan null overlay&lt;br /&gt;
 Swarm: inactive&lt;br /&gt;
 Runtimes: runc&lt;br /&gt;
 Default Runtime: runc&lt;br /&gt;
 Init Binary: docker-init&lt;br /&gt;
 containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e&lt;br /&gt;
 runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e&lt;br /&gt;
 init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)&lt;br /&gt;
 Kernel Version: 4.9.31-yocto-standard&lt;br /&gt;
  Operating System: Poky (Yocto Project Reference Distro) 2.3 (pyro)&lt;br /&gt;
  OSType: linux&lt;br /&gt;
  Architecture: x86_64&lt;br /&gt;
  CPUs: 4&lt;br /&gt;
 Total Memory: 7.618 GiB&lt;br /&gt;
 Name: genericx86-64&lt;br /&gt;
 ID: JIJP:ZUBZ:BC3J:JNVQ:3EOV:SVUP:RDO3:XGFN:WB5X:XIUH:34PX:EHBM&lt;br /&gt;
 Docker Root Dir: /var/lib/docker&lt;br /&gt;
 Debug Mode (client): false&lt;br /&gt;
 Debug Mode (server): false&lt;br /&gt;
 Http Proxy: http://foo.com:123/&lt;br /&gt;
 Registry: https://index.docker.io/v1/&lt;br /&gt;
 WARNING: No cpu cfs quota support&lt;br /&gt;
 WARNING: No cpu cfs period support&lt;br /&gt;
 Experimental: false&lt;br /&gt;
 Insecure Registries:&lt;br /&gt;
  127.0.0.0/8&lt;br /&gt;
 Live Restore Enabled: false&lt;br /&gt;
&lt;br /&gt;
 $ docker pull busybox&lt;br /&gt;
 Using default tag: latest&lt;br /&gt;
 latest: Pulling from library/busybox&lt;br /&gt;
 27144aa8f1b9: Pull complete &lt;br /&gt;
 Digest: sha256:be3c11fdba7cfe299214e46edc642e09514dbb9bbefcd0d3836c05a1e0cd0642&lt;br /&gt;
 Status: Downloaded newer image for busybox:latest&lt;br /&gt;
 &lt;br /&gt;
 $ docker run -it --rm busybox sh&lt;br /&gt;
 / #&lt;br /&gt;
If there are issues try &amp;lt;code&amp;gt; systemctl status docker &amp;lt;/code&amp;gt; to see what went wrong.&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28837</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28837"/>
		<updated>2017-07-13T22:01:13Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Additional Dependencies to Bitbake */&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;--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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28635</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28635"/>
		<updated>2017-07-08T18:06:57Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Debugging */&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.&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;--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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28634</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28634"/>
		<updated>2017-07-08T18:06:09Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;--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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28633</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28633"/>
		<updated>2017-07-08T18:05:03Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;--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;
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>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28632</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28632"/>
		<updated>2017-07-08T17:22:13Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;--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 It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28631</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28631"/>
		<updated>2017-07-08T17:17:46Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;--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.&lt;br /&gt;
&lt;br /&gt;
==== How to Debug - Simple Version ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28630</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28630"/>
		<updated>2017-07-08T17:15:01Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;--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;
 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;
&lt;br /&gt;
==== How to Debug - Simple Version ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28629</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28629"/>
		<updated>2017-07-08T17:04:17Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Getting the Source Code */&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.&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;
 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;
==== Building It ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to Debug - Simple Version ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28628</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28628"/>
		<updated>2017-07-08T17:03:43Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;
  ../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;
==== Building It ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to Debug - Simple Version ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28627</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28627"/>
		<updated>2017-07-08T16:57:27Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28625</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28625"/>
		<updated>2017-07-08T16:46:46Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Getting the Artifacts */&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.&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;
If you examine the /usr/share/defaults/cc-oci-runtime/vm.json  you will see where these are used/referenced. e.g.&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;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28624</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28624"/>
		<updated>2017-07-08T16:44:49Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Getting the Artifacts */&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.&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 Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28623</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28623"/>
		<updated>2017-07-08T16:42:18Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* Getting the Artifacts */&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.&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;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28622</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28622"/>
		<updated>2017-07-08T16:32:45Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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) comes from  [[https://download.clearlinux.org/image/ Clear Linux images.]] I again picked the [[https://download.clearlinux.org/image/clear-16050-containers.img.xz 16050 release image ]] &lt;br /&gt;
&lt;br /&gt;
rpm2cpio linux-container-4.9.33-74.x86_64.rpm | cpio -idmv&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28621</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28621"/>
		<updated>2017-07-08T16:22:50Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&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;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28620</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28620"/>
		<updated>2017-07-08T16:21:06Z</updated>

		<summary type="html">&lt;p&gt;Bavery: &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.&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go wget&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&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;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28619</id>
		<title>TipsAndTricks/BuildingAndRunningClearContainersonTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=TipsAndTricks/BuildingAndRunningClearContainersonTarget&amp;diff=28619"/>
		<updated>2017-07-08T16:14:32Z</updated>

		<summary type="html">&lt;p&gt;Bavery: /* 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.&lt;br /&gt;
 bitbake libcheck mdadm psmisc json-glib libmnl ossp-uuid autoconf-archive python-setuptools libcap-ng tunctl go&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&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;
&lt;br /&gt;
==== Configuring It ====&lt;br /&gt;
=== The Hypervisor ===&lt;br /&gt;
&lt;br /&gt;
=== The Hypervisor&#039;s Binaries ===&lt;br /&gt;
&lt;br /&gt;
== Running It ==&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
=== Programs ===&lt;br /&gt;
=== Example ===&lt;br /&gt;
=== Debugging ===&lt;/div&gt;</summary>
		<author><name>Bavery</name></author>
	</entry>
</feed>