<?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=PaulEggleton</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=PaulEggleton"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/PaulEggleton"/>
	<updated>2026-11-24T14:47:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Distribution_Support&amp;diff=86877</id>
		<title>Distribution Support</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Distribution_Support&amp;diff=86877"/>
		<updated>2026-09-14T19:17:59Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Fix supported distros link to documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Distribution Support ==&lt;br /&gt;
===Distribution Support ===&lt;br /&gt;
&lt;br /&gt;
The poky.conf file tracks all the distros supported by the Yocto Project. (http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-poky/conf/distro/poky.conf) The supported, and subsequently sanity tested, distros are listed in the &amp;quot;SANITY_TEST_DISTROS&amp;quot; section in poky.conf. Each supported distro is deployed and used as a Yocto Autobuilder build worker.  For more information on supported distros, please refer to the &amp;quot;[https://docs.yoctoproject.org/ref-manual/system-requirements.html#supported-linux-distributions Supported Linux Distributions]&amp;quot; section in the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Example of distro list in poky.conf:&lt;br /&gt;
&lt;br /&gt;
SANITY_TESTED_DISTROS ?= &amp;quot; \&lt;br /&gt;
            poky-2.4 \n \&lt;br /&gt;
            poky-2.5 \n \&lt;br /&gt;
            ubuntu-15.04 \n \&lt;br /&gt;
            ubuntu-16.04 \n \&lt;br /&gt;
            ubuntu-16.10 \n \&lt;br /&gt;
            ubuntu-17.04 \n \&lt;br /&gt;
            fedora-26 \n \&lt;br /&gt;
            centos-7 \n \&lt;br /&gt;
            debian-8 \n \&lt;br /&gt;
            debian-9 \n \&lt;br /&gt;
            opensuse-42.1 \n \&lt;br /&gt;
            opensuse-42.2 \n \&lt;br /&gt;
            &amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Again, the previous listing is just an example and is not meant to be a definitive reference.  &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How to add a new entry or additional distro information ===&lt;br /&gt;
&lt;br /&gt;
The criteria for adding a supported distro is quite rigid. Obviously, any candidate distro must be of production quality. In other words, the distro is capable of being used in a production environment on a Yocto Project Autobuilder build worker. A compelling reason must also exist for the Yocto Project to actually use the distro on a build worker. Obscure, poorly supported, or highly customized distros are not likely to be good candidates for submission. Major stable distros (e.g. Debian, Fedora, Ubunto, Centos, and so forth.) are generally already supported.  If they are not supported, they are likely on the list to become supported once sufficient criteria are met. Please be sure to check the latest supported distros beforehand to make sure the distro in question is not already supported.&lt;br /&gt;
&lt;br /&gt;
If you have a compelling reason to suggest a distro for support, please submit your request to the Yocto Project mailing list for discussion. You will likely be asked to provide the reasoning behind your request.  Along with your request, relevant bug reports, failed test cases, and so forth are helpful.  Have them ready in advance.   &lt;br /&gt;
&lt;br /&gt;
If you are not already a member of the Yocto Project mailing list, you can find more information and subscription requirements here: [https://lists.yoctoproject.org/listinfo/yocto https://lists.yoctoproject.org/listinfo/yocto].&lt;br /&gt;
&lt;br /&gt;
The Yocto Project mailing list is also the right place for more general questions or issues surrounding distro support.&lt;br /&gt;
&lt;br /&gt;
== Distro Testing ==&lt;br /&gt;
=== Distro test coverage ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Distro Testing is intended to reveal bugs that are distribution-specific using the yocto-autobuilder. The tests all run on identical hardware and use each updated OS.&lt;br /&gt;
&lt;br /&gt;
For detailed information on Distro testing, please see [[Distro_Testing_Plan]].&lt;br /&gt;
&lt;br /&gt;
For more information on the overall QA testing plan, please see [[QA_Master_Test_Plan]]. (Comprehensive)&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Releases&amp;diff=84661</id>
		<title>Releases</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Releases&amp;diff=84661"/>
		<updated>2021-05-04T22:54:26Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Fix 3.3 release notes link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- keywords: release names codenames versions version names numbers branches branchx --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Release Activity==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot;&lt;br /&gt;
!Codename&lt;br /&gt;
!Yocto Project Version&lt;br /&gt;
!Release Date&lt;br /&gt;
!Current Version&lt;br /&gt;
!Support Level&lt;br /&gt;
!Poky Version&lt;br /&gt;
!BitBake branch&lt;br /&gt;
! Maintainer&lt;br /&gt;
|-&lt;br /&gt;
|Kirkstone&lt;br /&gt;
|3.5&lt;br /&gt;
| April 2022&lt;br /&gt;
|&lt;br /&gt;
|Future&lt;br /&gt;
|27.0&lt;br /&gt;
|&lt;br /&gt;
|Richard Purdie &amp;lt;richard.purdie@linuxfoundation.org&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Honister&lt;br /&gt;
|3.4&lt;br /&gt;
|October 2021&lt;br /&gt;
|&lt;br /&gt;
|Planning&lt;br /&gt;
|26.0&lt;br /&gt;
|&lt;br /&gt;
|Richard Purdie &amp;lt;richard.purdie@linuxfoundation.org&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Hardknott&lt;br /&gt;
|3.3&lt;br /&gt;
|April 2021&lt;br /&gt;
|3.3.0 (April 2021)&lt;br /&gt;
|Stable&lt;br /&gt;
|25.0&lt;br /&gt;
|1.50&lt;br /&gt;
|Anuj Mittal &amp;lt;anuj.mittal@intel.com&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gatesgarth&lt;br /&gt;
|3.2&lt;br /&gt;
|Oct 2020&lt;br /&gt;
|3.2.3 (April 2021)&lt;br /&gt;
|Stable&lt;br /&gt;
|24.0&lt;br /&gt;
|1.48&lt;br /&gt;
|Anuj Mittal &amp;lt;anuj.mittal@intel.com&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Dunfell&lt;br /&gt;
|3.1&lt;br /&gt;
|April 2020&lt;br /&gt;
|3.1.7 (April 2021)&lt;br /&gt;
|Long Term Support&lt;br /&gt;
|23.0&lt;br /&gt;
|1.46&lt;br /&gt;
|Steve Sakoman &amp;lt;steve@sakoman.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Zeus&lt;br /&gt;
|3.0&lt;br /&gt;
|October 2019&lt;br /&gt;
|3.0.4 (August 2020)&lt;br /&gt;
|EOL&lt;br /&gt;
|22.0.3&lt;br /&gt;
|1.44&lt;br /&gt;
| Anuj/Armin&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Warrior&lt;br /&gt;
|2.7&lt;br /&gt;
|April 2019&lt;br /&gt;
|2.7.4 (June 2020)&lt;br /&gt;
|EOL&lt;br /&gt;
|21.0&lt;br /&gt;
|1.42&lt;br /&gt;
|Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Thud&lt;br /&gt;
|2.6&lt;br /&gt;
|Nov 2018&lt;br /&gt;
|2.6.4 (October 2019)&lt;br /&gt;
|EOL&lt;br /&gt;
|20.0&lt;br /&gt;
|1.40&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Sumo&lt;br /&gt;
|2.5&lt;br /&gt;
|April 2018&lt;br /&gt;
|2.5.3 (April 2019)&lt;br /&gt;
|EOL&lt;br /&gt;
|19.0&lt;br /&gt;
|1.38&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Rocko&lt;br /&gt;
|2.4&lt;br /&gt;
|Oct 2017&lt;br /&gt;
|2.4.4 (November 2018)&lt;br /&gt;
|EOL&lt;br /&gt;
|18.0&lt;br /&gt;
|1.36&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Pyro&lt;br /&gt;
|2.3&lt;br /&gt;
|May 2017&lt;br /&gt;
|2.3.4 (July 2018)&lt;br /&gt;
|EOL&lt;br /&gt;
|17.0&lt;br /&gt;
|1.34&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Morty&lt;br /&gt;
|2.2&lt;br /&gt;
|Nov 2016&lt;br /&gt;
|2.2.4 (July 2018)&lt;br /&gt;
|EOL&lt;br /&gt;
|16.0&lt;br /&gt;
|1.32&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Krogoth&lt;br /&gt;
|2.1&lt;br /&gt;
|Apr 2016&lt;br /&gt;
|2.1.3 (July 2017)&lt;br /&gt;
|EOL&lt;br /&gt;
|15.0&lt;br /&gt;
|1.30&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Jethro&lt;br /&gt;
|2.0&lt;br /&gt;
|Nov 2015&lt;br /&gt;
|2.0.3 (January 2016)&lt;br /&gt;
|EOL&lt;br /&gt;
|14.0&lt;br /&gt;
|1.28&lt;br /&gt;
|Robert Yang &amp;lt;liezhi.yang@windriver.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Fido&lt;br /&gt;
|1.8&lt;br /&gt;
|Apr 2015&lt;br /&gt;
|1.8.2&lt;br /&gt;
|EOL&lt;br /&gt;
|13.0&lt;br /&gt;
|1.26&lt;br /&gt;
|Joshua Lock &amp;lt;joshua.g.lock@intel.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Dizzy&lt;br /&gt;
|1.7&lt;br /&gt;
|Oct 2014&lt;br /&gt;
|1.7.3&lt;br /&gt;
|EOL&lt;br /&gt;
|12.0&lt;br /&gt;
|1.24&lt;br /&gt;
| Armin Kuster &amp;lt;akuster808@gmail.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Daisy&lt;br /&gt;
|1.6&lt;br /&gt;
|Apr 2014&lt;br /&gt;
|1.6.3&lt;br /&gt;
|EOL&lt;br /&gt;
|11.0&lt;br /&gt;
|1.22&lt;br /&gt;
| Saul Wold &amp;lt;sgw@linux.intel.com&amp;gt;&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Dora&lt;br /&gt;
|1.5&lt;br /&gt;
|Oct 2013&lt;br /&gt;
|1.5.4&lt;br /&gt;
|EOL&lt;br /&gt;
|10.0&lt;br /&gt;
|1.20&lt;br /&gt;
| Robert Yang &amp;lt;liezhi.yang@windriver.com&amp;gt; &lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Dylan&lt;br /&gt;
|1.4&lt;br /&gt;
|Apr 2013&lt;br /&gt;
|1.4.3[https://lists.yoctoproject.org/pipermail/yocto/2014-July/020699.html *]&lt;br /&gt;
|EOL&lt;br /&gt;
|9.0&lt;br /&gt;
|1.18&lt;br /&gt;
| Paul Eggleton &amp;lt;paul.eggleton@linux.intel.com&amp;gt; &lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Danny&lt;br /&gt;
|1.3&lt;br /&gt;
|Oct 2012&lt;br /&gt;
|1.3.2&lt;br /&gt;
|EOL&lt;br /&gt;
|8.0&lt;br /&gt;
|1.16&lt;br /&gt;
|Ross Burton &amp;lt;ross.burton@intel.com&amp;gt; &lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Denzil&lt;br /&gt;
|1.2&lt;br /&gt;
|Apr 2012&lt;br /&gt;
|1.2.2&lt;br /&gt;
|EOL&lt;br /&gt;
|7.0&lt;br /&gt;
|1.15&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Edison&lt;br /&gt;
|1.1&lt;br /&gt;
|Oct 2011&lt;br /&gt;
|1.1.2&lt;br /&gt;
|EOL&lt;br /&gt;
|6.0&lt;br /&gt;
|1.13&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Bernard&lt;br /&gt;
|1.0&lt;br /&gt;
|Apr 2011&lt;br /&gt;
|1.0.2&lt;br /&gt;
|EOL&lt;br /&gt;
|5.0&lt;br /&gt;
|1.11&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Laverne&lt;br /&gt;
|0.9&lt;br /&gt;
|Oct 2010&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4.0&lt;br /&gt;
|1.11&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Green&lt;br /&gt;
|N/A&lt;br /&gt;
|11 June 2010&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|3.3&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Purple&lt;br /&gt;
|N/A&lt;br /&gt;
|15 Dec 2009&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|3.2&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Pinky&lt;br /&gt;
|N/A&lt;br /&gt;
|12 Nov 2009&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|3.1&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Blinky&lt;br /&gt;
|N/A&lt;br /&gt;
|1 Aug 2007&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|3.0&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Clyde&lt;br /&gt;
|N/A&lt;br /&gt;
|19 Jan 2007&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|2.0&lt;br /&gt;
|&lt;br /&gt;
|-style=&amp;quot;color: slategray;&amp;quot;&lt;br /&gt;
|Inky&lt;br /&gt;
|N/A&lt;br /&gt;
|10 Feb 2006&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1.0&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; see also [[Stable branch maintenance]], [[Linux Yocto]], [[Planning]] and [[Release Feature Table]] pages.&lt;br /&gt;
&lt;br /&gt;
== Releases Links==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Yocto Project Release&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Code Name&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Poky version&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Maintainer&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Features&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Schedule&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Status&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;QA Test Plan&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;QA Test Report&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Release notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 3.3&lt;br /&gt;
| Hardknott&lt;br /&gt;
| 25.0&lt;br /&gt;
| Anuj Mittal&lt;br /&gt;
| [[Yocto_3.3_Features]]&lt;br /&gt;
| [[Yocto_3.3_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v3.3_Status]]&lt;br /&gt;
| [[Yocto_Project_3.3_Release_Test_Plan | Yocto_3.3_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_3.3_Release_Test_Plan#Execution_History | 3.3 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/g/yocto-announce/message/215 3.3 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 3.2&lt;br /&gt;
| Gatesgarth&lt;br /&gt;
| 24.0&lt;br /&gt;
| Anuj Mittal&lt;br /&gt;
| [[Yocto_3.2_Features]]&lt;br /&gt;
| [[Yocto_3.2_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v3.2_Status]]&lt;br /&gt;
| [[Yocto_Project_3.2_Release_Test_Plan | Yocto_3.2_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_3.2_Release_Test_Plan#Execution_History | 3.2 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/g/yocto/message/51262 3.2 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 3.1&lt;br /&gt;
| Dunfell&lt;br /&gt;
| 23.0&lt;br /&gt;
| Steve Sakoman&lt;br /&gt;
| [[Yocto_3.1_Features]]&lt;br /&gt;
| [[Yocto_3.1_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v3.1_Status]]&lt;br /&gt;
| [[Yocto_Project_3.1_Release_Test_Plan | Yocto_3.1_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_3.1_Release_Test_Plan#Execution_History | 3.1 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/g/yocto/message/49201 3.1 release notes]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 3.0&lt;br /&gt;
| Zeus&lt;br /&gt;
| 22.0&lt;br /&gt;
| Armin Kuster/Anuj Mittal&lt;br /&gt;
| [[Yocto_2.8_Features]]&lt;br /&gt;
| [[Yocto_2.8_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.8_Status]]&lt;br /&gt;
| [[Yocto_Project_2.8_Release_Test_Plan | Yocto_2.8_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.8_Release_Test_Plan#Execution_History | 2.8 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto/2019-October/047111.html 3.0 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.7&lt;br /&gt;
| Warrior&lt;br /&gt;
| 21.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.7_Features]]&lt;br /&gt;
| [[Yocto_2.7_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.7_Status]]&lt;br /&gt;
| [[Yocto_Project_2.7_Release_Test_Plan | Yocto_2.7_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.7_Release_Test_Plan#Execution_History | 2.7 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto/2019-May/045028.html 2.7 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.6&lt;br /&gt;
| Thud&lt;br /&gt;
| 20.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.6_Features]]&lt;br /&gt;
| [[Yocto_2.6_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.6_Status]]&lt;br /&gt;
| [[Yocto_Project_2.6_Release_Test_Plan | Yocto_2.6_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.6_Release_Test_Plan#Execution_History | 2.6 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2018-November/000147.html 2.6 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.5&lt;br /&gt;
| Sumo&lt;br /&gt;
| 19.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.5_Features]]&lt;br /&gt;
| [[Yocto_2.5_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.5_Status]]&lt;br /&gt;
| [[Yocto_Project_2.5_Release_Test_Plan | Yocto_2.5_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.5_Release_Test_Plan#Execution_History | 2.5 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2018-May/000136.html 2.5 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.4&lt;br /&gt;
| Rocko&lt;br /&gt;
| 18.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.4_Features]]&lt;br /&gt;
| [[Yocto_2.4_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.4_Status]]&lt;br /&gt;
| [[Yocto_Project_2.4_Release_Test_Plan | Yocto_2.4_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.4_Release_Test_Plan#Execution_History | 2.4 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2017-October/000125.html 2.4 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.3&lt;br /&gt;
| Pyro&lt;br /&gt;
| 17.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.3_Features]]&lt;br /&gt;
| [[Yocto_2.3_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.3_Status]]&lt;br /&gt;
| [[Yocto_Project_2.3_Release_Test_Plan | Yocto_2.3_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.3_Release_Test_Plan#Execution_History | 2.3 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2017-May/000112.html 2.3 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.2&lt;br /&gt;
| Morty&lt;br /&gt;
| 16.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.2_Features]]&lt;br /&gt;
| [[Yocto_2.2_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.2_Status]]&lt;br /&gt;
| [[Yocto_2.2_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_Project_2.2_Release_Test_Plan#Execution_History | 2.2 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2016-November/000101.html 2.2 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.1&lt;br /&gt;
| Krogoth&lt;br /&gt;
| 15.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_2.1_Features]]&lt;br /&gt;
| [[Yocto_2.1_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v2.1_Status]]&lt;br /&gt;
| [[Yocto_2.1_Overall_Test_Plan]]&lt;br /&gt;
| [[2.1 qa run history]] &lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2016-May/000089.html 2.1 release notes]&lt;br /&gt;
|-&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 2.0&lt;br /&gt;
| Jethro&lt;br /&gt;
| 14.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.9_Features]]&lt;br /&gt;
| [[Yocto_1.9_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.9_Status]]&lt;br /&gt;
| &lt;br /&gt;
| [[1.9 qa run history]] &lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2015-November/000076.html 2.0 release notes]&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| Yocto Project 1.8&lt;br /&gt;
| Fido&lt;br /&gt;
| 13.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.8_Features]]&lt;br /&gt;
| [[Yocto_1.8_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.8_Status]]&lt;br /&gt;
| [[Yocto_1.8_Overall_Test_Plan]]&lt;br /&gt;
| [[1.8 qa run history]] &lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2015-April/000062.html 1.8 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.7&lt;br /&gt;
| Dizzy&lt;br /&gt;
| 12.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.7_Features]]&lt;br /&gt;
| [[Yocto_1.7_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.7_Status]]&lt;br /&gt;
| [[Yocto_1.7_Overall_Test_Plan]]&lt;br /&gt;
| [[1.7 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2014-October/000053.html 1.7 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.6&lt;br /&gt;
| Daisy&lt;br /&gt;
| 11.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.6_Features]]&lt;br /&gt;
| [[Yocto_1.6_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.6_Status]]&lt;br /&gt;
| [[Yocto_1.6_Overall_Test_Plan]]&lt;br /&gt;
| [[1.6 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2014-April/000045.html 1.6 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.5&lt;br /&gt;
| Dora&lt;br /&gt;
| 10.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.5_Features]]&lt;br /&gt;
| [[Yocto_1.5_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.5_Status]]&lt;br /&gt;
| [[Yocto_1.5_Overall_Test_Plan]]&lt;br /&gt;
| [[1.5 qa run history]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2013-October/000037.html 1.5 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.4&lt;br /&gt;
| Dylan&lt;br /&gt;
| 9.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.4_Features]]&lt;br /&gt;
| [[Yocto_1.4_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.4_Status]]&lt;br /&gt;
| [[Yocto_1.4_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_1.4_Milestone_Test_Report]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2013-April/000027.html 1.4 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.3&lt;br /&gt;
| Danny&lt;br /&gt;
| 8.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.3_Features]]&lt;br /&gt;
| [[Yocto_1.3_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.3_Status]]&lt;br /&gt;
| [[Yocto_1.3_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_1.3_Milestone_Test_Report]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2012-October/000020.html 1.3 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.2&lt;br /&gt;
| Denzil&lt;br /&gt;
| 7.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.2_Features]]&lt;br /&gt;
| [[Yocto_1.2_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.2_Status]]&lt;br /&gt;
| [[Yocto_1.2_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_1.2_Milestone_Test_Report]]&lt;br /&gt;
| [https://lists.yoctoproject.org/pipermail/yocto-announce/2012-April/000009.html 1.2 release notes]&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.1&lt;br /&gt;
| Edison&lt;br /&gt;
| 6.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_1.1_Features]]&lt;br /&gt;
| [[Yocto_1.1_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.1_Release_Criteria]]&lt;br /&gt;
| [[Yocto_1.1_Overall_Test_Plan]]&lt;br /&gt;
| [[Yocto_1.1_Milestone_Test_Report]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Yocto Project 1.0&lt;br /&gt;
| Bernard&lt;br /&gt;
| 5.0&lt;br /&gt;
| Community&lt;br /&gt;
| [[Yocto_Features]]&lt;br /&gt;
| [[Yocto_1.0_Schedule]]&lt;br /&gt;
| [[Yocto_Project_v1.0_Release_Criteria]]&lt;br /&gt;
| [[Yocto_1.0_Overall_Test_Plan]]&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=User:PaulEggleton&amp;diff=80779</id>
		<title>User:PaulEggleton</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=User:PaulEggleton&amp;diff=80779"/>
		<updated>2020-11-09T18:59:06Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Created page with &amp;quot;== About ==   Software developer based in Auckland, NZ  * Involved with OpenEmbedded &amp;amp; Yocto Project for some years, commit access to OE since late 2007. * Working for Microso...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About == &lt;br /&gt;
&lt;br /&gt;
Software developer based in Auckland, NZ&lt;br /&gt;
&lt;br /&gt;
* Involved with OpenEmbedded &amp;amp; Yocto Project for some years, commit access to OE since late 2007.&lt;br /&gt;
* Working for Microsoft&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
&lt;br /&gt;
* E-mail: bluelightning@bluelightning.org or paul.eggleton@microsoft.com&lt;br /&gt;
* IRC: bluelightning (in #oe and #yocto on freenode)&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Yocto_Build_Failure_Swat_Team&amp;diff=80778</id>
		<title>Yocto Build Failure Swat Team</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Yocto_Build_Failure_Swat_Team&amp;diff=80778"/>
		<updated>2020-11-09T18:55:23Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
The role of the SWAT team is to monitor the autobuilder and investigate all failures to ensure that they are logged and brought to the attention of the appropriate owner.&lt;br /&gt;
&lt;br /&gt;
All builds that are run on the [https://autobuilder.yoctoproject.org public autobuilder] are important for the Yocto Project, whether they be a post-merge validation run (for master or a release branch) or a pre-merge test build (for master-next, ross/mut, stable/* and others).  SWAT doesn&#039;t cover company-internal autobuilders.&lt;br /&gt;
&lt;br /&gt;
Every build should be monitored by the SWAT team unless the [[BuildLog]] entry for that build indicates otherwise.  SWAT is opt-out by whomever triggers a build on the autobuilder, not opt-in.&lt;br /&gt;
&lt;br /&gt;
SWAT isn&#039;t responsible for resolving any issues encountered on the autobuilder. Their focus is on performing minimal analysis of a failure in order to ensure that it is logged and brought to the attention of a appropriate owner, a process we&#039;ll refer to as pre-triage.&lt;br /&gt;
&lt;br /&gt;
== Roles ==&lt;br /&gt;
&lt;br /&gt;
Active member: the currently active member of the SWAT team is expected to monitor the autobuilder and pre-triage failures in a timely fashion. Team members are active for one week at a time and rotation is usually simple round robin through the members list.  If for some reason the next person isn&#039;t available then they can be defer a week until they are.&lt;br /&gt;
&lt;br /&gt;
SWAT Chair: the SWAT chair provides backup cover for the active member and is a first point of contact for SWAT. [[User:RossBurton | Ross Burton]], Armin Kuster and Richard Purdie are the SWAT Chair people.&lt;br /&gt;
&lt;br /&gt;
SWAT Facilitator: the SWAT facilitator is responsible for managing the rotation process. [[User:Stephen_K._Jolley | Stephen K. Jolley]] is the current SWAT Facilitator.&lt;br /&gt;
&lt;br /&gt;
== Process ==&lt;br /&gt;
&lt;br /&gt;
The [[BuildLog]] wiki page is automatically updated by the autobuilder when a new build is triggered. This often includes guidance for SWAT (the &amp;quot;Reason&amp;quot; field when triggering the build) such as to ignore it (if the build is expected to break and the owner is monitoring themselves) or a request to report failures straight to a specific person (if the build only contains changes from a single person, such as a GCC upgrade).  Unless when told otherwise, the usual process is as follows:&lt;br /&gt;
&lt;br /&gt;
For builds against master or a release branch, any issues observed should be [[#Filing_bugs | filed in Bugzilla]].&lt;br /&gt;
&lt;br /&gt;
For builds against other branches (master-next, ross/mut, -next branches for stable releases, etc.), attempt to identify what patch in the branch is likely responsible for the failure. For example, if &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; fails with &amp;lt;tt&amp;gt;libgnutls&amp;lt;/tt&amp;gt; errors and there is a GnuTLS upgrade in the branch, that is the likely candidate.  If a patch can be identified that isn&#039;t also in master or release branch, reply on the mailing list with the failure details.  If it isn&#039;t obvious which patch is responsible for the failure then [[#Filing_bugs | file a bug]] and ensure the branch owner is either the assignee or on the CC list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If in doubt, file a bug&#039;&#039;&#039;. All observed errors must be actioned unless a patch has already been sent for the issue, in which case please make note of this in the [[BuildLog]].&lt;br /&gt;
&lt;br /&gt;
If the issue is in the infrastructure or autobuilder itself then file a bug against , infrastructure bugs should be assigned to [[User:Halstead| Michael Halstead]] and autobuilder logic bugs to [[User:Rpurdie | Richard Purdie]].&lt;br /&gt;
&lt;br /&gt;
The results of pre-triage for an issue should be added to the corresponding entry in the [[BuildLog]], including a link to the resolution (patch name, bug link, etc) and a brief summary of the issue.  Every issue should be added to the build log so it acts as a build status report.&lt;br /&gt;
&lt;br /&gt;
Note that some builds, in particular the &amp;quot;perf&amp;quot; builds are not listed on [[BuildLog]] unless the build fails (to try and reduce noise on the log). Failures in performance test builds should be handled like any other build.&lt;br /&gt;
&lt;br /&gt;
The net result is all failures listed in [[BuildLog]] should have outcomes listed against them from the person on SWAT at the time.&lt;br /&gt;
&lt;br /&gt;
=== Filing bugs ===&lt;br /&gt;
&lt;br /&gt;
When filing the bug two things are required:&lt;br /&gt;
* A link to the build failure.  This can either be the build page (such as https://autobuilder.yoctoproject.org/typhoon/#/builders/34/builds/168) or the [http://errors.yoctoproject.org/Errors/ error reports] page (such as http://errors.yoctoproject.org/Errors/Details/199667/).&lt;br /&gt;
* The error itself. Trim the log down to just the error and any relevant context in the bug description, and also attach the complete log file.  Autobuilder logs are not persistent so the full log must be attached.&lt;br /&gt;
&lt;br /&gt;
=== Process summary ===&lt;br /&gt;
&lt;br /&gt;
* Monitor builds via one or more of:&lt;br /&gt;
** the autobuilder: [https://autobuilder.yoctoproject.org/typhoon/ main page], [https://autobuilder.yoctoproject.org/typhoon/#/console console view]. Orange builds have warnings, red builds failed with errors.&lt;br /&gt;
** the [http://errors.yoctoproject.org/Errors/ Error Reports] web page which has an entry for each recipe that fails. A link to the appropriate search is on the autobuilder&#039;s Console View.&lt;br /&gt;
** the [[BuildLog]] wiki page.  This has links to each build log that wasn&#039;t successful.&lt;br /&gt;
** the [https://lists.yoctoproject.org/listinfo/yocto-builds yocto-builds] mailing list. This gets a mail for every unsuccessful build.&lt;br /&gt;
* Pre-triage each failure:&lt;br /&gt;
** File a bug &#039;&#039;or&#039;&#039; respond to a patch &#039;&#039;or&#039;&#039; note known issues&lt;br /&gt;
** Update the [[BuildLog]] with the result of pre-triage, linking to the resolution where possible.&lt;br /&gt;
&lt;br /&gt;
== Questions / Contact ==&lt;br /&gt;
&lt;br /&gt;
If you have queries about the SWAT process you may reach out to the SWAT Facilitator [[User:Stephen_K._Jolley | Stephen K. Jolley]] or the SWAT Chair [[User:RossBurton | Ross Burton]].&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
[[User:Leonardo_Sandoval | Leo Sandoval]]&lt;br /&gt;
&lt;br /&gt;
[[User:SaulWold | Saul Wold]]&lt;br /&gt;
&lt;br /&gt;
[[User:PaulEggleton | Paul Eggleton]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76099</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76099"/>
		<updated>2020-07-09T21:01:45Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Add why not root question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel (or some other kconfig-using recipe). In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;https://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=https&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and of course http.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal that doesn&#039;t have X11 in it - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== Why can&#039;t I run bitbake as root? ===&lt;br /&gt;
&lt;br /&gt;
If you try to run bitbake as root you may have noticed you get a sanity check failure that prevents the build from continuing. The reason we have this check is that it is very risky to run builds as root; if any build script mistakenly tries to install files to the root path (/) instead of where it is supposed to, you want it to fail immediately and not (in the worst case) overwrite files critical to your Linux system&#039;s operation e.g. under /bin or /etc. Thus, we do not support running the build as root. The only time root access is needed is (completely outside of a build) where the runqemu script uses sudo to set up TAP devices for networking.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky (see above). There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p &amp;amp;lt;recipename&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76031</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76031"/>
		<updated>2020-07-01T01:30:56Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Consistency: use &amp;lt;recipename&amp;gt; instead of recipename&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel (or some other kconfig-using recipe). In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;https://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=https&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and of course http.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal that doesn&#039;t have X11 in it - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p &amp;amp;lt;recipename&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76030</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76030"/>
		<updated>2020-07-01T01:25:54Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I&amp;#039;m getting warnings that a recipe is tainted - what does this mean? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel (or some other kconfig-using recipe). In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;https://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=https&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and of course http.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal that doesn&#039;t have X11 in it - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76029</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76029"/>
		<updated>2020-07-01T01:24:56Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I&amp;#039;m fetching from a git repository over ssh / http / https but it&amp;#039;s not fetching properly, how do I fix this? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;https://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=https&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and of course http.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal that doesn&#039;t have X11 in it - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76028</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76028"/>
		<updated>2020-07-01T01:22:39Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* X11 and various other items are being built but I&amp;#039;m only building core-image-minimal - why? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal that doesn&#039;t have X11 in it - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76027</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76027"/>
		<updated>2020-07-01T01:16:40Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Can I disable shared state? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable due to hardcoded paths. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76026</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76026"/>
		<updated>2020-07-01T01:15:59Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Can I disable shared state? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state (sstate) is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; within &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the &amp;lt;code&amp;gt;create_wrapper&amp;lt;/code&amp;gt; utility function to create a wrapper script that will set the path appropriately. Run &amp;lt;code&amp;gt;git grep create_wrapper&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76025</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=76025"/>
		<updated>2020-07-01T01:11:19Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I allow a variable&amp;#039;s value through from the external environment? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=75895</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=75895"/>
		<updated>2020-06-04T22:34:30Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the Yocto Project Wiki! ==&lt;br /&gt;
The [http://yoctoproject.org Yocto Project] is an open-source project that delivers a set of tools that create operating system images for embedded Linux systems. The Yocto Project tools are based on the [http://www.openembedded.org/wiki/Main_Page OpenEmbedded] (OE) project, which uses the BitBake build tool, to construct complete Linux images. BitBake and OE are combined to form a reference build host known as Poky which includes the following [[Core Components|core components]]. This [https://www.youtube.com/watch?v=utZpKM7i5Z4 video] will help explain what it&#039;s all about.&lt;br /&gt;
&lt;br /&gt;
===Where to Start?===&lt;br /&gt;
If you&#039;re new to Yocto take a look at the &#039;&#039;&#039;[[Glossary]]&#039;&#039;&#039; so you&#039;re familiar with the terms used in this wiki and the project documentation. Then take a look at the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html &#039;&#039;&#039;Quick Start Guide&#039;&#039;&#039;]. You can follow the steps in this document to clone the poky repository, quickly configure your build environment, and then try a build. Corporate firewalls can be problematic so network proxy configurations are detailed on the &#039;&#039;&#039;[[Working Behind a Network Proxy]]&#039;&#039;&#039; page. We advise you go straight for the [[Working_Behind_a_Network_Proxy#Option_2:_Chameleonsocks| Chameleonsocks option]].&lt;br /&gt;
&lt;br /&gt;
===Where to Next?===&lt;br /&gt;
Thanks to the quick start guide, it&#039;s pretty easy to get your first Linux image and and running. Here are some places to look for help when improving your Yocto skills.&lt;br /&gt;
* The [https://linuxfoundation.org Linux Foundation] have some great [https://docs.google.com/presentation/d/1LmI3mHoD_Dzl8wplIYcUBrFF8BzDb_EadTvfbnpSK7Q/edit training slides]. There is also an [https://docs.google.com/presentation/d/1HoDtyN5SzlmuTN47ab4Y7w_i6c_VEW6EBUD944ntf38/edit#slide advanced slide deck] for more more experienced users. &lt;br /&gt;
* The first tool you&#039;ll need to get familiar with is &#039;&#039;&#039;bitbake&#039;&#039;&#039;, so reading through the [https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html user manual] is recommended. You don&#039;t need to understand it all right now, but bookmark this page for reference. Implementation of bitake is covered in the [[Bitbake Internals Primer]] &lt;br /&gt;
* Once you start adding packages and configuring your image to create your own distribution, things can go wrong and it can hard to track down the root cause. There is no shortage of Yocto documentation resource, but if you&#039;re not exactly sure what you&#039;re looking for this &#039;&#039;&#039;[[Documentation Decoder]]&#039;&#039;&#039; will help you out. Also take a look at the [https://wiki.yoctoproject.org/wiki/Cookbook &#039;&#039;&#039;Cookbook&#039;&#039;&#039;] and [https://wiki.yoctoproject.org/wiki/Technical_FAQ troubleshooting guide]. Also [https://www.yoctoproject.org/blogs/jefro/2016/yocto-project-books these books] are helpful. &lt;br /&gt;
* Some new tools such as [http://www.yoctoproject.org/docs/current/toaster-manual/toaster-manual.html Toaster], [[Extensible SDK]] and [https://github.com/crops CROPS] are making it easier to get the best out of Yocto on Windows and Mac OS X. Take a look at the new workflow in [[Developer Workflow Improvements]].&lt;br /&gt;
* There is also a [https://wiki.yoctoproject.org/wiki/TipsAndTricks &#039;&#039;&#039;Tips and Tricks&#039;&#039;&#039;] section where more experienced developers contribute to articles that will help those new to Yocto Project.&lt;br /&gt;
* You can also read and participate on the [https://lists.yoctoproject.org mailing lists] - start with the [https://lists.yoctoproject.org/g/yocto main list] first - and the [https://www.yoctoproject.org/tools-resources/community/irc IRC channels].&lt;br /&gt;
&lt;br /&gt;
== Project planning ==&lt;br /&gt;
&lt;br /&gt;
=== Features === &lt;br /&gt;
* [[Yocto Feature Summary]] (Current and Next)&lt;br /&gt;
&lt;br /&gt;
=== Project Planning for current release  ===&lt;br /&gt;
&lt;br /&gt;
* [[Planning]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status and Schedule ===&lt;br /&gt;
* [[Weekly_Status]]&lt;br /&gt;
* [[Yocto Project v2.8 Status]]&lt;br /&gt;
* [[Yocto 2.8 Schedule]]&lt;br /&gt;
* Testresults - https://git.yoctoproject.org/cgit/cgit.cgi/yocto-testresults-contrib/log/?h=intel-yocto-testresults&lt;br /&gt;
&lt;br /&gt;
== Release Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
* [[Yocto Release Engineering | Release Activity (with status, version info, QA links, etc)]]&lt;br /&gt;
&lt;br /&gt;
== QA &amp;amp; Automation ==&lt;br /&gt;
&lt;br /&gt;
* [[The_Yocto_Autobuilder| The Yocto Project Autobuilder]]&lt;br /&gt;
* [[QA| Yocto Project QA Main Page]]&lt;br /&gt;
* [[QA/Archive| Yocto Project QA Test Report Archive ]]&lt;br /&gt;
&lt;br /&gt;
== Quick guide for newcomers ==&lt;br /&gt;
&lt;br /&gt;
If you are new to the project and are willing to contribute, please refer to our [[Newcomers|guide for newcomers]].&lt;br /&gt;
&lt;br /&gt;
== TSC ==&lt;br /&gt;
* Yocto Project Technical Steering Committee [[TSC]] &lt;br /&gt;
&lt;br /&gt;
== Wiki reference sitemap ==&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Documentation Decoder]]&lt;br /&gt;
* [[Working Behind a Network Proxy]]&lt;br /&gt;
* [[FAQ]] and [[Technical FAQ]]. These need to be unified.&lt;br /&gt;
* [[Cookbook]] and [[TipsAndTricks | Tips and Tricks]]. Need clear messaging on how these should be differentiated.&lt;br /&gt;
* [[Developer Workflow Improvements]], including [[Nodejs Workflow Improvements]]&lt;br /&gt;
* [[Planning and Governance]]&lt;br /&gt;
* [[Community Guidelines]]&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
* [[License Infrastructure Interest Group | License Infrastructure]]&lt;br /&gt;
* [[Processes and Activities]]&lt;br /&gt;
* [[Technical Contributors]]&lt;br /&gt;
* [[Projects]]&lt;br /&gt;
* [[Security]] - find out what we do about CVEs and security&lt;br /&gt;
* [[Yocto Interest Groups]]&lt;br /&gt;
* [[Testopia]] - The Yocto Project&#039;s community-opened test case management platform&lt;br /&gt;
* [[Toaster]] - the web interface &lt;br /&gt;
* [[Archive]] - Graveyard for out of date articles.&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [http://yoctoproject.org Yocto Project Front Page]&lt;br /&gt;
* [http://git.yoctoproject.org/ Yocto Project Git Source Repos]&lt;br /&gt;
* [https://bugzilla.yoctoproject.org/ Yocto Project Bugzilla]&lt;br /&gt;
* [https://www.yoctoproject.org/tools-resources/community/mailing-lists Yocto Project Mailing Lists]&lt;br /&gt;
* [http://recipes.yoctoproject.org/rrs Yocto Project Recipe Reporting System]&lt;br /&gt;
* [https://autobuilder.yoctoproject.org/typhoon Yocto Project Autobuilder]&lt;br /&gt;
* [http://downloads.yoctoproject.org/releases/yocto/ Yocto Project Releases Downloads]&lt;br /&gt;
* [http://autobuilder.yoctoproject.org/pub/nightly/ Yocto Project Nightly Build Images]&lt;br /&gt;
* [http://downloads.yoctoproject.org/mirror/sources/ Upstream Sources Mirror]&lt;br /&gt;
* [http://www.openembedded.org/wiki/Main_Page OpenEmbedded Wiki]&lt;br /&gt;
* [http://cgit.openembedded.org/ OpenEmbedded Git Repos]&lt;br /&gt;
* [http://layers.openembedded.org/ OpenEmbedded Community Layers] &lt;br /&gt;
* [http://patchwork.openembedded.org/ OpenEmbedded Patch Tracking System]&lt;br /&gt;
* &#039;&#039;&#039;IRC&#039;&#039;&#039;: irc.freenode.net&lt;br /&gt;
:* #yocto - Public discussions on the Yocto Project.&lt;br /&gt;
:* #oe - Public discussions on OpenEmbedded Core.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=71513</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=71513"/>
		<updated>2020-03-27T04:14:45Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Add taskhash mismatch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== I am getting &amp;quot;taskhash mismatch&amp;quot; errors, what does this mean and how do I fix it? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake parses the metadata (recipes, classes and configuration) repeatedly during its operation, and this error means that the result of parsing changed between one parse and the next. Two situations that can cause this:&lt;br /&gt;
# One of the parsed files changed in between e.g. you edited a recipe or performed a git operation (e.g. git checkout) during the build. &#039;&#039;&#039;Do not make changes to the metadata while a build is running.&#039;&#039;&#039; If you run the build again the error should not recur.&lt;br /&gt;
# Alternatively, there is something in the metadata that results in a variable expanding to a different value each time it is parsed. This is often something time-related e.g. a timestamp which is calculated every time an expression is expanded. The solution is to ensure the value is calculated once per build and then the expression expands to the same value for the duration of the build.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Stable_Release_and_LTS&amp;diff=71278</id>
		<title>Stable Release and LTS</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Stable_Release_and_LTS&amp;diff=71278"/>
		<updated>2020-03-11T03:27:38Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Fix internal linking&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Yocto Project Stable Branch Maintenance and Long Term Support (LTS) =&lt;br /&gt;
&lt;br /&gt;
Background on how the project&#039;s LTS plans came about can be found [[LTS_Background | here]]. The document below details the current project release lifecycle and LTS plans. The aim is to have a stable series maintenance policy which allows for different stages of maintenance including standard &amp;quot;stable&amp;quot; series, LTS series and community support.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[Stable branch maintenance|Current Maintainers list]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Release Lifecycle ==&lt;br /&gt;
The project releases every six months in April and October (spring and fall). This is necessary to bring development together to a focus point and provide points of increased testing and focus on stability. There are two possible lifecycles a release may follow:&lt;br /&gt;
&lt;br /&gt;
Initial Release -&amp;gt; Stable -&amp;gt; Community -&amp;gt; EOL&lt;br /&gt;
:: or&lt;br /&gt;
Initial Release -&amp;gt; LTS -&amp;gt; Community -&amp;gt; EOL&lt;br /&gt;
&lt;br /&gt;
The change in status of a given release series should be announced in the weekly status report and reflected on the “Releases” wiki page.&lt;br /&gt;
&lt;br /&gt;
The stages have the following properties:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stable/LTS common properties:&#039;&#039;&#039;&lt;br /&gt;
* Has point release tarballs created&lt;br /&gt;
* Has release artefacts&lt;br /&gt;
* Patches merged to the main repository branch&lt;br /&gt;
* Requires autobuilder testing&lt;br /&gt;
* The project will appoint someone to act as the maintainer to coordinate and handle patch testing and merging&lt;br /&gt;
* Strict “backport only”, master first policy&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stable/LTS differences:&#039;&#039;&#039;&lt;br /&gt;
* Stable releases are maintained for seven months&lt;br /&gt;
* LTS releases are maintained initially for two years&lt;br /&gt;
* LTS releases are preannounced and known to be LTS in advance (usually every two years)&lt;br /&gt;
* LTS tested only on a subset of supported native build platforms (announced at time of LTS)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Community status properties:&#039;&#039;&#039;&lt;br /&gt;
* Branches only have community support status if there is an active community member willing to step into the maintainer role for that series&lt;br /&gt;
* Patches merge to the main repository but in a community/XXX namespace&lt;br /&gt;
* Automated testing is on a best effort basis, some autobuilder cycles may be available but not guaranteed.&lt;br /&gt;
* The maintainer is required to publish a testing plan to show what testing will be made for patches to merge to the community branch.&lt;br /&gt;
* No point releases version and no release artefacts&lt;br /&gt;
* Master first policy recommended&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;EOL (End of life):&#039;&#039;&#039;&lt;br /&gt;
* When there is no longer any active community maintainer, branches become EOL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LTS “Mixin” repositories ==&lt;br /&gt;
We realise that a given LTS may need other versions of some components within its lifetime as no “one size” fits everyone’s needs. Rather than adding potentially invasive changes to older releases (such as new gcc versions), the project proposes the use of “mixin” layers. These would be thin specific purpose layers which can be stacked with an LTS release to mix a specific feature into that build. These are to be created on an as needed basis and maintained by the people who need them. The structure would be to create them in the repository oecore-backport-mixin with the branch naming scheme &amp;lt;releaseseries&amp;gt;/&amp;lt;mixin name&amp;gt;. We expect this may be used for gcc and possibly for rapidly changing languages like go/nodejs/rust. Policies on testing these layers will depend on how widespread their usage is and determined on a case by case basis. There may be other &#039;mixin&#039; layers within the wider community too.&lt;br /&gt;
&lt;br /&gt;
The layers should have a single purpose and be Yocto Project Compatible (passing the test script) allowing them to be selected by users as needed. The maintainer should be listed in the README and note when the layer is no longer maintained.&lt;br /&gt;
&lt;br /&gt;
== Stable/LTS Patch Acceptance Policies ==&lt;br /&gt;
All changes must have already been accepted into the current master release and any other release still within its “stable” seven month support window.&lt;br /&gt;
&lt;br /&gt;
Patches must pass testing on the project’s automated test infrastructure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Acceptable:&#039;&#039;&#039;&lt;br /&gt;
* Security and CVE fixes&lt;br /&gt;
* Fixes for bugs&lt;br /&gt;
* Changes to follow an upstream stable series or LTS that aligns with the original release (based on compatibility)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Potentially Acceptable:&#039;&#039;&#039;&lt;br /&gt;
* Fixes so codebase works with newly released distros (only in the first six months after a given release series first releases)&lt;br /&gt;
* Bug fix only version upgrades for upstreams with a good stable process&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unacceptable:&#039;&#039;&#039;&lt;br /&gt;
* General version upgrades&lt;br /&gt;
* New features&lt;br /&gt;
* ABI/API breakage&lt;br /&gt;
&lt;br /&gt;
== Components (layers) to be covered ==&lt;br /&gt;
&lt;br /&gt;
The project LTS covers:&lt;br /&gt;
* Bitbake&lt;br /&gt;
* OE-Core&lt;br /&gt;
* Meta-yocto&lt;br /&gt;
* yocto-docs&lt;br /&gt;
&lt;br /&gt;
The project LTS does not cover:&lt;br /&gt;
* meta-mingw&lt;br /&gt;
* meta-gplv2&lt;br /&gt;
* vendor layers&lt;br /&gt;
&lt;br /&gt;
Other layers can and will have their own LTS processes.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
The project releases are only tested using the automated testing based on virtual environments. The build host OSes used to run these tests are determined at the initial release time. For LTS releases only some subset of native OSes maybe supported, particularly where the lifetime of the OS would be shorter than the LTS.&lt;br /&gt;
&lt;br /&gt;
Further testing of releases, e.g. on real hardware platforms is encouraged and there is a process to allow these results to be merged into the release test results but the process for making the release no longer depends upon this happening.&lt;br /&gt;
&lt;br /&gt;
== Process ( TOC)==&lt;br /&gt;
* Need to document the following processes:&lt;br /&gt;
** How maintainer is selected&lt;br /&gt;
** How are patches proposed - Done&lt;br /&gt;
** How are patches queued/tested/reviewed/merged - Done&lt;br /&gt;
** When are point releases made? - Done&lt;br /&gt;
** How to trigger and run a point release - Done&lt;br /&gt;
** Release process itself &lt;br /&gt;
** Transferring stable/LTS release to community/EOL status - YP TSC&lt;br /&gt;
** New maintainer training - TBD&lt;br /&gt;
&lt;br /&gt;
== Requesting a fix in a stable branch ==&lt;br /&gt;
&lt;br /&gt;
With reference to the above policies, if you would like to request a backport of a commit in a newer release, you can either (a) do the backport yourself and send the patch marked with &amp;lt;tt&amp;gt;[branchname]&amp;lt;/tt&amp;gt; to the appropriate mailing list; or alternatively (b) you can send a simple request giving commit hashes / URLs that you would like to be backported. In both cases it helps to CC the maintainer - refer to the [[Stable branch maintenance|stable release table]].&lt;br /&gt;
&lt;br /&gt;
For information on which mailing list you should send these to see the [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/README README file] in the Poky repository.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Maintainer Procedures&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
=== Normal process ===&lt;br /&gt;
&lt;br /&gt;
When there are enough changes (or a few critical ones), the stable/LTS maintainer should follow this procedure:&lt;br /&gt;
&lt;br /&gt;
# Look out for patches on the mailing list marked with the appropriate branch name in the subject&lt;br /&gt;
# Look through recently merged patches in master that are suitable for backporting&lt;br /&gt;
# Collect patches together on a branch&lt;br /&gt;
#* If a submitted patch is a backport from master, rather than taking the patch as submitted, it is preferable to backport the patch from master so that the original commit message is preserved.&lt;br /&gt;
#* If you do the backporting from poky you will get the original commit ID in the commit message which is useful for reference.&lt;br /&gt;
#* It is beneficial to change the original commit ID line to say &amp;quot;OE-Core master rev&amp;quot; instead of &amp;quot;OE-Core rev&amp;quot; to distinguish it from the OE-Core  branch revision that will be added when the commit is merged&lt;br /&gt;
# Run a local build or two to pick up any obvious problems&lt;br /&gt;
# Bitbake change should be in the bitbake-contrib repo&lt;br /&gt;
## https://git.openembedded.org/bitbake-contrib stable/{branch}-nut&lt;br /&gt;
# Openembedded-core changes should be be in the openembedded-core-contrib stable/{branch}-nut &lt;br /&gt;
## https://git.openembedded.org/openembedded-core-contrib&lt;br /&gt;
# Meta-yocto changes should be in poky-contrib meta-yocto/stable/{branch}-nut&lt;br /&gt;
## git://git.yoctoproject.org/poky-contrib&lt;br /&gt;
# yocto-docs changes should be in poky-contrib yocto-docs/stable/{branch}-nut&lt;br /&gt;
## git://git.yoctoproject.org/poky-contrib&lt;br /&gt;
#Now create your Poky distro for testing.&lt;br /&gt;
## The Autobuilder requires changes to reside in poky, bitbake and openembedded-core&lt;br /&gt;
## Combine bitabke, core, meta-yocto and yocto-docs changes into one repo.&lt;br /&gt;
## Push the changes to poky-contrib stable/{branch}-nut&lt;br /&gt;
## git://git.yoctoproject.org/poky-contrib&lt;br /&gt;
# Test the changes on the autobuilder (see [[How to start a build on the Autobuilder]])&lt;br /&gt;
#* Make sure you check directly for the results of the build as these won&#039;t be reported to the yocto-builds mailing list.&lt;br /&gt;
## For any build failure, Defects should be opened&lt;br /&gt;
## Address any build failures, update repo&#039;s accordingly and rebuild&lt;br /&gt;
&lt;br /&gt;
There will very likely be a number of these cycles during the lifetime of the stable branch.&lt;br /&gt;
&lt;br /&gt;
=== Patch review ===&lt;br /&gt;
# When collating patches for review, Make sure of the following:&lt;br /&gt;
## Subject indicates &amp;quot;Patch review&amp;quot;&lt;br /&gt;
## Provide a deadline for any comments included in the body of the email&lt;br /&gt;
## Standard to date is 2 days.&lt;br /&gt;
###Exception is if the changes are patches sent to the appropriate mailing list.&lt;br /&gt;
## Use the appropriate branch reference.&lt;br /&gt;
## Use create-pull-request -p &amp;quot;{branch}&amp;quot; ...{etc}&lt;br /&gt;
# Send any bitbake changes bitbake-devel mailing list &lt;br /&gt;
# Send any OE-Core changes openembedded-core mailing list.&lt;br /&gt;
# Send any meta-yocto changes to the poky@lists.yoctoproject.org mailing list.&lt;br /&gt;
# Send any yocto-docs changes the docs@lists.yoctoproject.org mailing list.&lt;br /&gt;
# Wait for any feedback&lt;br /&gt;
## If there are changes make any necessary adjustments&lt;br /&gt;
### rebuild if necessary&lt;br /&gt;
# Push any changes to the appropriate repos and branches.&lt;br /&gt;
&lt;br /&gt;
=== Merge request===&lt;br /&gt;
# Push affected repos and branches to stable/{branch}-next branch&lt;br /&gt;
# When preparing patches for merge, Make sure of the following:&lt;br /&gt;
## Subject indicates &amp;quot;Merge Request&amp;quot;&lt;br /&gt;
## Use the appropriate branch reference.&lt;br /&gt;
## Use create-pull-requests -p&amp;quot;{branch}&amp;quot;&lt;br /&gt;
# Send any bitbake changes bitbake-devel mailing list &lt;br /&gt;
# Send any OE-Core changes openembedded-core mailing list.&lt;br /&gt;
# Send any meta-yocto changes to the poky@lists.yoctoproject.org mailing list.&lt;br /&gt;
# Send any yocto-docs changes the docs@lists.yoctoproject.org mailing list.&lt;br /&gt;
# When the patches are merged, mark any bugs specific to the stable branch as resolved as appropriate&lt;br /&gt;
&lt;br /&gt;
=== Point release ===&lt;br /&gt;
&lt;br /&gt;
Normally point releases are scheduled in advance as appropriate - contact Stephen Jolley &amp;lt;sjolley.yp.pm@gmail.com&amp;gt; and CC: Ricard Purdie &amp;lt;richard.purdie@linuxfoundation.org&amp;gt; about scheduling point releases.&lt;br /&gt;
&lt;br /&gt;
# Update yocto-docs with release information.&lt;br /&gt;
## Send a patch to docs@lists.yoctoproject.org&lt;br /&gt;
# Once all dot release changes are merged, ask Richard to run the release candidate build&lt;br /&gt;
#* The stable branch or LTS maintainer should monitor the build and follow up on any failures&lt;br /&gt;
# When the release candidate build completes successfully, The stable branch or LTS maintainer should notify the QA team to start the release QA process.&lt;br /&gt;
# Gather together changes in the form needed for a release notes and send them Yocto Project TSC, Branch or LTS maintainer for review and approval.&lt;br /&gt;
## If acceptable the changes will be incorporated into the final release notes and to Stephen Jolley &amp;lt;sjolley.yp.pm@gmail.com&amp;gt; so he can have them in preparation for the release meeting.&lt;br /&gt;
# Send a patch to update the stable version in meta-yocto/conf/distro/poky.conf for the release&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
* It is useful to provide status updates on the Yocto Project technical call, particularly coming up to a stable release. If you&#039;re not able to be on the call, send the status update information to Stephen Jolley &amp;lt;sjolley.yp.pm@gmail.com&amp;gt; and he will present it.&lt;br /&gt;
&lt;br /&gt;
=== Releases ===&lt;br /&gt;
[[Releases|Yocto Project releases]]&lt;br /&gt;
&lt;br /&gt;
=== Kernel LTS ===&lt;br /&gt;
[[Linux Yocto#Release_Cadence|Kernel cadence]]&lt;br /&gt;
&lt;br /&gt;
=== New Releases process ===&lt;br /&gt;
[[Yocto Project Release Process|Standard release process]]&lt;br /&gt;
&lt;br /&gt;
== Decision Makers==&lt;br /&gt;
Decisions are expected to be handled by the maintainers. The TSC holds the ultimate decision making authority in case of disagreement. The TSC makes the final release go/nogo decisions.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Project_Users&amp;diff=67214</id>
		<title>Project Users</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Project_Users&amp;diff=67214"/>
		<updated>2020-01-17T01:07:44Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It&#039;s hard to know which companies or projects use the Yocto Project since there is no requirement to tell us. This list is here to informally collate the companies, projects and products that use the Yocto Project in some way.&lt;br /&gt;
&lt;br /&gt;
= Companies using the Yocto Project =&lt;br /&gt;
&lt;br /&gt;
Semiconductor Vendors:&lt;br /&gt;
* AMD (Silver Member)&lt;br /&gt;
* ARM (Platinum Member)&lt;br /&gt;
* Intel (Platinum Member)&lt;br /&gt;
* NXP (Silver Member)&lt;br /&gt;
* Qualcomm&lt;br /&gt;
* Renesas (Gold Member)&lt;br /&gt;
* STMicroelectronics (Silver Member)&lt;br /&gt;
* Texas Instruments (Platinum Member)&lt;br /&gt;
* Xilinx (Platinum Member)&lt;br /&gt;
&lt;br /&gt;
OSVs:&lt;br /&gt;
* ENEA (Silver Member)&lt;br /&gt;
* Linaro (Silver Member)&lt;br /&gt;
* Lineo (Silver Member)&lt;br /&gt;
* Mentor Graphics (Gold Member)&lt;br /&gt;
* Montavista (Silver Member)&lt;br /&gt;
* Wind River (Gold Member)&lt;br /&gt;
&lt;br /&gt;
Others:&lt;br /&gt;
* Cisco (Platinum Member)&lt;br /&gt;
* Comcast (Platinum Member)&lt;br /&gt;
* Dell (Silver Member)&lt;br /&gt;
* Facebook (Platinum Member)&lt;br /&gt;
* Juniper (Gold Member)&lt;br /&gt;
* LG (Silver Member)&lt;br /&gt;
* Microsoft&lt;br /&gt;
&lt;br /&gt;
= Products that use the Yocto Project =&lt;br /&gt;
&lt;br /&gt;
* Comcast set top boxes&lt;br /&gt;
* LG TVs&lt;br /&gt;
&lt;br /&gt;
= Projects that use the Yocto Project =&lt;br /&gt;
&lt;br /&gt;
* Automotive Grade Linux (AGL)&lt;br /&gt;
* Comcast RDK&lt;br /&gt;
* OpenBMC&lt;br /&gt;
* Windows Subsystem Linux (v1+v2)&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60989</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60989"/>
		<updated>2019-10-01T04:00:40Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I control what&amp;#039;s in the final image? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Each image is defined by its own recipe, and that recipe specifies a list of packages that the image should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60988</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60988"/>
		<updated>2019-10-01T03:56:53Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I find out which package contains a particular file (or python module)? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
As a specific example of where this can be useful, our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However, that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60987</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60987"/>
		<updated>2019-10-01T03:55:32Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I remove a value from a list variable? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot &amp;quot;undo&amp;quot; it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60986</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60986"/>
		<updated>2019-10-01T03:55:18Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I remove a value from a list variable? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it with other operations elsewhere, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60985</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60985"/>
		<updated>2019-10-01T03:54:36Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* X11 and various other items are being built but I&amp;#039;m only building core-image-minimal - why? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;&amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt;&amp;quot; in &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt;, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60984</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60984"/>
		<updated>2019-10-01T03:54:08Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* X11 and various other items are being built but I&amp;#039;m only building core-image-minimal - why? */ touch up a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included as long as there are no hard dependencies and there aren&#039;t any X11 packages explicitly requested. &lt;br /&gt;
&lt;br /&gt;
If you never intend to use X11, you can set your own &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; value that excludes &amp;lt;code&amp;gt;x11&amp;lt;/code&amp;gt; (note lower case, as with all feature names) and then X11 support will be disabled at build time and these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60983</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60983"/>
		<updated>2019-10-01T03:51:06Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I avoid the kernel itself being pulled into my image when installing kernel modules? */ update for KERNEL_PACKAGE_NAME&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${KERNEL_PACKAGE_NAME}-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note: for older releases (pre-2.5) do this instead:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60981</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=60981"/>
		<updated>2019-10-01T03:44:25Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Mention devtool finish&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; (depending on the situation) to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=51889</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=51889"/>
		<updated>2019-05-10T01:21:14Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Add note about IMAGE_CLASSES and KERNEL_CLASSES&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question for details.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control. (If you want a class to be inherited for all images (i.e. all recipes inheriting the &amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt; class) you can inject additional classes by setting IMAGE_CLASSES; similarly for the kernel there is KERNEL_CLASSES).&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43755</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43755"/>
		<updated>2018-11-12T21:15:35Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Why does OE use pseudo? Why not use fakeroot / fakechroot instead? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of any operations persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43754</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43754"/>
		<updated>2018-11-12T21:10:25Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I add a patch to a recipe? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of the -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
As with any modification, if the patch you are applying is a customisation that you do not intend to send to be incorporated in the layer you are modifying, then instead of adding the patch to the recipe directly then you should consider applying it in a bbappend within your own custom layer. This makes things easier if you later want to update the layer in question and the recipe has been modified upstream - you avoid effectively forking the layer.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43753</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43753"/>
		<updated>2018-11-12T21:06:17Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I set a variable but it doesn&amp;#039;t seem to be having an effect, how do I fix this? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - within less you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43752</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43752"/>
		<updated>2018-11-12T21:04:40Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I&amp;#039;m getting warnings that a recipe is tainted - what does this mean? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug, you&#039;re doing something wrong, or perhaps you&#039;re using &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; when it&#039;s not really needed. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43751</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43751"/>
		<updated>2018-11-12T21:00:56Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I disabled runtime package management and yet it still seems to be building rpm/opkg, why? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
The build system always uses a package manager on the host to assemble images, because it is usually the best tool for this job. This is completely independent of whether the package manager is available in the target image - &amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it (and its associated package database) will be present in the target image.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43750</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43750"/>
		<updated>2018-11-12T20:57:43Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version in the console output during a build will be those that set &amp;lt;code&amp;gt;PV&amp;lt;/code&amp;gt; to include &amp;lt;code&amp;gt;&amp;quot;${SRCPV}&amp;quot;&amp;lt;/code&amp;gt; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly, there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during &amp;lt;code&amp;gt;do_package&amp;lt;/code&amp;gt; it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43749</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43749"/>
		<updated>2018-11-12T20:52:16Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I do an offline build with recipes that have SRCREV = &amp;quot;${AUTOREV}&amp;quot; set? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision. (The disadvantage of this method is that it is a little more difficult to preserve or share with others the fixed revisions.)&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43748</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=43748"/>
		<updated>2018-11-12T20:49:34Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Add a section on multiple _append&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;br /&gt;
&lt;br /&gt;
=== There&#039;s a bbappend in a layer I&#039;m using that defines a &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; and I want to append to that function also, how do I do this? ===&lt;br /&gt;
&lt;br /&gt;
Simply create a bbappend in your layer and define your own &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, and your commands will be executed &#039;&#039;as well as&#039;&#039; those of the other bbappend.&lt;br /&gt;
&lt;br /&gt;
You might assume that defining &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt; will overwrite any previously defined &amp;lt;code&amp;gt;do_something_append()&amp;lt;/code&amp;gt;, as would be the case with &amp;lt;code&amp;gt;do_something()&amp;lt;/code&amp;gt; in the same situation, but that is not the case - the key is that &amp;lt;code&amp;gt;_append&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;_prepend&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_remove&amp;lt;/code&amp;gt;, etc.) are &#039;&#039;operators&#039;&#039; and they will be applied in sequence, where that sequence is the order in which they are parsed (which for bbappends will be in ascending layer priority order).&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=42249</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=42249"/>
		<updated>2018-09-27T23:23:45Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* I&amp;#039;ve created a bbappend for a recipe but what I&amp;#039;m setting there isn&amp;#039;t having any effect, how do I fix this? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
# Finally, as with any other issue with setting variables, use &amp;lt;code&amp;gt;bitbake -e recipename | less&amp;lt;/code&amp;gt; and search with &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt; to see the history of how the variable has been set - you may find that the value you&#039;re trying set is being overridden.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41363</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41363"/>
		<updated>2018-08-14T17:10:04Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Why do you use pseudo? Why not use fakeroot / fakechroot instead? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why does OE use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41362</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41362"/>
		<updated>2018-08-14T17:09:35Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Misc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;br /&gt;
&lt;br /&gt;
=== Is it possible to append a bbclass file (like bbappends do for recipes)? ===&lt;br /&gt;
&lt;br /&gt;
No, see the next question.&lt;br /&gt;
&lt;br /&gt;
=== How do I override a bbclass file? ===&lt;br /&gt;
&lt;br /&gt;
This is tricky - bbclass files are found via BBPATH, which is added to by each layer.conf either by prepending or appending. Assuming you are putting your bbclass in a custom layer, you will probably want to have your layer&#039;s layer.conf prepend to BBPATH, but then you will also need to make sure that your layer does not appear before any other layer that is also prepending and overriding the same class.&lt;br /&gt;
&lt;br /&gt;
Another alternative is to have an additional class which makes the appropriate changes to the environment, and then you will need to inherit that class after (and in the same manner as) the original class. This is slightly cleaner but can be annoying to enable particularly if the class is inherited by a number of recipes, and won&#039;t work if you want to alter the behaviour of a class inherited by recipes you don&#039;t control.&lt;br /&gt;
&lt;br /&gt;
Ultimately, overriding bbclass files is not good practice long term - you are opening yourself up to maintenance issues when the original class changes, and the override is fragile as hinted above. The best solution is to try to get whatever changes you need into the original class; this does of course require additional work and time though.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41126</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41126"/>
		<updated>2018-08-10T09:09:27Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I add a patch to a recipe? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; in versions older than 2.2). Since &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt; gives you a git tree to work with, you can of course use something like &amp;lt;code&amp;gt;git am&amp;lt;/code&amp;gt; to apply existing patches this way. For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41125</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41125"/>
		<updated>2018-08-10T08:56:07Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I collect the source revisions fetched by each recipe? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
For more information see the [https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] section of the Yocto Project Development manual, which covers the buildhistory class in detail.&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41124</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=41124"/>
		<updated>2018-08-10T08:54:08Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Misc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
=== Working around Firejail ===&lt;br /&gt;
For users of Parrot OS and other secured Linux distros, you will find that your bitbake fetch commands refuse to work, yet you can manually run wget and retrieve the packages with no problem.  This is due to Poky creating links to all the tools it requires, in particular &#039;wget&#039;, &#039;ssh&#039; and &#039;strings&#039;, using the links to these tools in the /usr/local/bin/ directory which all redirect to firejail.  To fix the problem you can cd into &amp;lt;your Yocto install directory&amp;gt;/poky/build/tmp/hosttools directory and replace these links with ones redirecting to the actual executables under the /usr/bin directory.&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How do I collect the source revisions fetched by each recipe? ===&lt;br /&gt;
&lt;br /&gt;
If you have recipes where &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; then you won&#039;t necessarily know exactly which revisions were built after the fact - it will be whatever was current at the time. You also might alternatively just want to get all of the revisions. Either way, to do this, enable buildhistory by setting the following in your local.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
INHERIT += &amp;quot;buildhistory&amp;quot;&lt;br /&gt;
BUILDHISTORY_COMMIT = &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The last line is not required with version 2.5 and onwards as it is the default, but will do no harm.)&lt;br /&gt;
&lt;br /&gt;
Once you have enabled buildhistory, you then need to build your image again so that buildhistory has a chance to record history data for it. Following that you can run &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; if you want to see all revisions, not just the ones where AUTOREV was used) and it will output the revisions in a form you can use in a .inc file that you can &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt; from your configuration if you want to fix the build to those revisions.&lt;br /&gt;
&lt;br /&gt;
https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#maintaining-build-output-quality&lt;br /&gt;
&lt;br /&gt;
=== How do I do an offline build with recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt; set? ===&lt;br /&gt;
&lt;br /&gt;
If you set &amp;lt;code&amp;gt;BB_NO_NETWORK = &amp;quot;1&amp;quot;&amp;lt;/code&amp;gt; and you have recipes that have &amp;lt;code&amp;gt;SRCREV = &amp;quot;${AUTOREV}&amp;quot;&amp;lt;/code&amp;gt;, you will get an error because the build system will try to check the latest revision on startup and be immediately blocked by &amp;lt;code&amp;gt;BB_NO_NETWORK&amp;lt;/code&amp;gt;. There are two ways to handle this:&lt;br /&gt;
&lt;br /&gt;
A) See the previous question &amp;quot;How do I collect the source revisions fetched by each recipe?&amp;quot; and use the output generated by &amp;lt;code&amp;gt;buildhistory-collect-srcrevs&amp;lt;/code&amp;gt; as a .inc file in your configuration in order to fix the revisions at the ones which were most recently built.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
B) Set &amp;lt;code&amp;gt;BB_SRCREV_POLICY = &amp;quot;cache&amp;quot;&amp;lt;/code&amp;gt; in your configuration. This will use the last cached revision.&lt;br /&gt;
&lt;br /&gt;
Note that in either case if you later want to build the latest version again, you will of course need to undo the configuration changes.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=40269</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Main_Page&amp;diff=40269"/>
		<updated>2018-07-12T09:19:14Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Update for 2.6 development&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to the Yocto Project Wiki! ==&lt;br /&gt;
The [http://yoctoproject.org Yocto Project] is an open-source project that delivers a set of tools that create operating system images for embedded Linux systems. The Yocto Project tools are based on the [http://www.openembedded.org/wiki/Main_Page OpenEmbedded] (OE) project, which uses the BitBake build tool, to construct complete Linux images. BitBake and OE are combined to form a reference build host known as Poky which includes the following [[Core Components|core components]]. This [https://www.youtube.com/watch?v=utZpKM7i5Z4 video] will help explain what it&#039;s all about.&lt;br /&gt;
&lt;br /&gt;
===Where to Start?===&lt;br /&gt;
If you&#039;re new to Yocto take a look at the &#039;&#039;&#039;[[Glossary]]&#039;&#039;&#039; so you&#039;re familiar with the terms used in this wiki and the project documentation. Then take a look at the [http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html &#039;&#039;&#039;Quick Start Guide&#039;&#039;&#039;]. You can follow the steps in this document to clone the poky repository, quickly configure your build environment, and then try a build. Corporate firewalls can be problematic so network proxy configurations are detailed on the &#039;&#039;&#039;[[Working Behind a Network Proxy]]&#039;&#039;&#039; page. We advise you go straight for the [[Working_Behind_a_Network_Proxy#Option_2:_Chameleonsocks| Chameleonsocks option]].&lt;br /&gt;
&lt;br /&gt;
===Where to Next?===&lt;br /&gt;
Thanks to the quick start guide, it&#039;s pretty easy to get your first Linux image and and running. Here are some places to look for help when improving your Yocto skills.&lt;br /&gt;
* The [https://linuxfoundation.org Linux Foundation] have some great [https://docs.google.com/presentation/d/1LmI3mHoD_Dzl8wplIYcUBrFF8BzDb_EadTvfbnpSK7Q/edit training slides]. There is also an [https://docs.google.com/presentation/d/1HoDtyN5SzlmuTN47ab4Y7w_i6c_VEW6EBUD944ntf38/edit#slide advanced slide deck] for more more experienced users. &lt;br /&gt;
* The first tool you&#039;ll need to get familiar with is &#039;&#039;&#039;bitbake&#039;&#039;&#039;, so reading through the [https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html user manual] is recommended. You don&#039;t need to understand it all right now, but bookmark this page for reference. Implementation of bitake is covered in the [[Bitbake Internals Primer]] &lt;br /&gt;
* Once you start adding packages and configuring your image to create your own distribution, things can go wrong and it can hard to track down the root cause. There is no shortage of Yocto documentation resource, but if you&#039;re not exactly sure what you&#039;re looking for this &#039;&#039;&#039;[[Documentation Decoder]]&#039;&#039;&#039; will help you out. Also take a look at the [https://wiki.yoctoproject.org/wiki/Cookbook &#039;&#039;&#039;Cookbook&#039;&#039;&#039;] and [https://wiki.yoctoproject.org/wiki/Technical_FAQ troubleshooting guide]. Also [https://www.yoctoproject.org/blogs/jefro/2016/yocto-project-books these books] are helpful. &lt;br /&gt;
* Some new tools such as [http://www.yoctoproject.org/docs/current/toaster-manual/toaster-manual.html Toaster], [[Extensible SDK]] and [https://github.com/crops/crops CROPS] are making it easier to get the best out of Yocto on Windows and Mac OS X. Take a look at the new workflow in [[Developer Workflow Improvements]].&lt;br /&gt;
* There is also a [https://wiki.yoctoproject.org/wiki/TipsAndTricks &#039;&#039;&#039;Tips and Tricks&#039;&#039;&#039;] section where more experienced developers contribute to articles that will help those new to Yocto Project.&lt;br /&gt;
* You can also read and participate on the [https://lists.yoctoproject.org mailing lists] - start with the [https://lists.yoctoproject.org/listinfo/yocto main list] first - and the [https://www.yoctoproject.org/tools-resources/community/irc IRC channels].&lt;br /&gt;
&lt;br /&gt;
== Project planning ==&lt;br /&gt;
&lt;br /&gt;
=== Features === &lt;br /&gt;
* [[Yocto Feature Summary]] (Current and Next)&lt;br /&gt;
&lt;br /&gt;
=== Project Planning for v2.6 (Current) ===&lt;br /&gt;
&lt;br /&gt;
* [[Planning]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status and Schedule for v2.6 ===&lt;br /&gt;
* [[Yocto Project v2.6 Status]]&lt;br /&gt;
* [[Yocto 2.6 Schedule]]&lt;br /&gt;
* [[2.6 QA Status]]&lt;br /&gt;
&lt;br /&gt;
== Release Engineering ==&lt;br /&gt;
&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
* [[Yocto Release Engineering | Release Activity (with status, version info, QA links, etc)]]&lt;br /&gt;
&lt;br /&gt;
== QA &amp;amp; Automation ==&lt;br /&gt;
&lt;br /&gt;
* [[QA| Yocto Project QA Main Page]]&lt;br /&gt;
* [[QA/Archive| Yocto Project QA Test Report Archive ]]&lt;br /&gt;
&lt;br /&gt;
== Wiki reference sitemap ==&lt;br /&gt;
* [[Glossary]]&lt;br /&gt;
* [[Documentation Decoder]]&lt;br /&gt;
* [[Working Behind a Network Proxy]]&lt;br /&gt;
* [[FAQ]] and [[Technical FAQ]]. These need to be unified.&lt;br /&gt;
* [[Cookbook]] and [[TipsAndTricks | Tips and Tricks]]. Need clear messaging on how these should be differentiated.&lt;br /&gt;
* [[Developer Workflow Improvements]], including [[Nodejs Workflow Improvements]]&lt;br /&gt;
* [[Planning and Governance]]&lt;br /&gt;
* [[Community Guidelines]]&lt;br /&gt;
* [[Yocto Release Engineering | Yocto Project Release Engineering]]&lt;br /&gt;
* [[License Infrastructure Interest Group | License Infrastructure]]&lt;br /&gt;
* [[Processes and Activities]]&lt;br /&gt;
* [[Technical Contributors]]&lt;br /&gt;
* [[Projects]]&lt;br /&gt;
* [[Security]] - find out what we do about CVEs and security&lt;br /&gt;
* [[Yocto Interest Groups]]&lt;br /&gt;
* [[Testopia]] - The Yocto Project&#039;s community-opened test case management platform&lt;br /&gt;
* [[Toaster]] - the web interface &lt;br /&gt;
* [[Archive]] - Graveyard for out of date articles.&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
* [http://yoctoproject.org Yocto Project Front Page]&lt;br /&gt;
* [http://git.yoctoproject.org/ Yocto Project Git Source Repos]&lt;br /&gt;
* [https://bugzilla.yoctoproject.org/ Yocto Project Bugzilla]&lt;br /&gt;
* [https://www.yoctoproject.org/tools-resources/community/mailing-lists Yocto Project Mailing Lists]&lt;br /&gt;
* [http://recipes.yoctoproject.org/rrs Yocto Project Recipe Reporting System]&lt;br /&gt;
* [https://autobuilder.yoctoproject.org/main/ Yocto Project Autobuilder Waterfall Page]&lt;br /&gt;
* [https://autobuilder.yoctoproject.org/ Yocto Project Autobuilder Splash/Info Page]&lt;br /&gt;
* [http://downloads.yoctoproject.org/releases/yocto/ Yocto Project Releases Downloads]&lt;br /&gt;
* [http://autobuilder.yoctoproject.org/pub/nightly/ Yocto Project Nightly Build Images]&lt;br /&gt;
* [http://downloads.yoctoproject.org/mirror/sources/ Upstream Sources Mirror]&lt;br /&gt;
* [http://www.openembedded.org/wiki/Main_Page OpenEmbedded Wiki]&lt;br /&gt;
* [http://cgit.openembedded.org/ OpenEmbedded Git Repos]&lt;br /&gt;
* [http://layers.openembedded.org/ OpenEmbedded Community Layers] &lt;br /&gt;
* [http://patchwork.openembedded.org/ OpenEmbedded Patch Tracking System]&lt;br /&gt;
* &#039;&#039;&#039;IRC&#039;&#039;&#039;: irc.freenode.net&lt;br /&gt;
:* #yocto - Public discussions on the Yocto Project.&lt;br /&gt;
:* #oe - Public discussions on OpenEmbedded Core.&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38577</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38577"/>
		<updated>2018-05-11T04:42:30Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Can I disable shared state? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed under ${D} within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38560</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38560"/>
		<updated>2018-05-11T00:02:13Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* When I run bitbake -c devshell it looks like it&amp;#039;s running as root! How is that possible? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including your shell) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38559</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=38559"/>
		<updated>2018-05-11T00:01:24Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* How do I change how my recipe is built depending on what image I&amp;#039;m building? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions that do allow you to achieve the desired result:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including bash) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37598</id>
		<title>Ptest</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37598"/>
		<updated>2018-04-05T00:12:30Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Ptest (&#039;&#039;package test&#039;&#039;) is a concept for building, installing and running the test suites that are included in many upstream packages, and producing a consistent output format for the results.&lt;br /&gt;
&lt;br /&gt;
=Adding ptest to your build=&lt;br /&gt;
&lt;br /&gt;
To add package testing to your build, set the &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt; variables in your &amp;lt;code&amp;gt;conf/local.conf&amp;lt;/code&amp;gt; file, which is found in the Build Directory:&lt;br /&gt;
&lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; ptest&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest&amp;quot; to your DISTRO_FEATURES variable causes -ptest packages to be built.&lt;br /&gt;
&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot;ptest-pkgs&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest-pkgs&amp;quot; to IMAGE_FEATURES variable causes all -ptest packages corresponding with other packages installed in your image to be additionally installed.&lt;br /&gt;
&lt;br /&gt;
As an alternative to the &amp;lt;code&amp;gt;ptest-pkgs&amp;lt;/code&amp;gt; image feature, if you want to be more selective about which tests to include, you can install them individually e.g. to install the tests for e2fsprogs and zlib you would do something like this:&lt;br /&gt;
&lt;br /&gt;
 CORE_IMAGE_EXTRA_INSTALL += &amp;quot;e2fsprogs-ptest zlib-ptest&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is of course just one way to add packages to an image, see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customizing images] section of the Yocto Project development manual for more information.&lt;br /&gt;
&lt;br /&gt;
All ptest files are installed in &amp;lt;code&amp;gt;/usr/lib/&amp;lt;package&amp;gt;/ptest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Running ptest=&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;ptest-runner&amp;quot; package installs a &amp;quot;ptest-runner&amp;quot; which loops through all installed ptest test suites and runs them in sequence. You may therefore want to add &amp;quot;ptest-runner&amp;quot; to your image.&lt;br /&gt;
&lt;br /&gt;
==ptest-runner Usage==&lt;br /&gt;
&lt;br /&gt;
The usage for the ptest-runner is as follows:&lt;br /&gt;
&lt;br /&gt;
 Usage: ptest-runner [-d directory] [-l list] [-t timeout] [-h] [ptest1 ptest2 ...]&lt;br /&gt;
&lt;br /&gt;
==Executing ptest-runner==&lt;br /&gt;
&lt;br /&gt;
To execute a full ptest run you can do the following command line anywhere in the target:&lt;br /&gt;
&lt;br /&gt;
 $ ptest-runner&lt;br /&gt;
&lt;br /&gt;
Remember to redirect to a file if you want to have a log&lt;br /&gt;
&lt;br /&gt;
=Implementing ptest in a package recipe=&lt;br /&gt;
&lt;br /&gt;
==What constitutes a ptest?==&lt;br /&gt;
&lt;br /&gt;
A ptest must at minimum contain two things: &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; and the actual test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; is a minimal shell script that &#039;&#039;starts&#039;&#039; the test suite. Note: It must not &#039;&#039;contain&#039;&#039; the test suite, only start it!&lt;br /&gt;
&lt;br /&gt;
The test can be anything, from a simple shell script running a binary and checking its output to an elaborate system of test binaries and data files.&lt;br /&gt;
&lt;br /&gt;
One major point of ptest is to consolidate the output format of all tests into a single common format. The format selected is the automake &amp;quot;simple test&amp;quot; format:&lt;br /&gt;
&lt;br /&gt;
 result: testname&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;result&amp;quot; is one of PASS, FAIL or SKIP and &amp;quot;testname&amp;quot; can be any identifying string (the same format [http://www.gnu.org/software/automake/manual/automake.html#Simple-Tests used by Automake].)&lt;br /&gt;
&lt;br /&gt;
==General recipe preparations==&lt;br /&gt;
&lt;br /&gt;
First, add &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; line in the recipe.&lt;br /&gt;
&lt;br /&gt;
If a test adds build-time or run-time dependencies to the package which are not there normally (such as requiring &amp;quot;make&amp;quot; to run the test suite), add those with a -ptest suffix, like this:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${PN}-ptest += &amp;quot;make&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Building the test suite==&lt;br /&gt;
&lt;br /&gt;
Few packages support cross-compiling their test suites, so this is something we typically have to add.&lt;br /&gt;
&lt;br /&gt;
Many automake-based packages compile and run the test suite in a single command: &amp;quot;make check&amp;quot;. This doesn&#039;t work when cross-compiling, since we need to build on host and run on target. So we need to split that into two targets: One for building the test and one for running it. Our build of automake comes with a [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch patch] which does this automatically, so packages using the plain &amp;quot;make check&amp;quot; arrangement from automake get this automatically.&lt;br /&gt;
&lt;br /&gt;
Now add a do_compile_ptest function to build the test suite:&lt;br /&gt;
&lt;br /&gt;
 do_compile_ptest() {&lt;br /&gt;
     oe_runmake buildtest-TESTS&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If the package requires special configuration actions prior to compiling the test code, create a do_configure_ptest function to do that.&lt;br /&gt;
&lt;br /&gt;
Note that buildtest-TESTS requires [https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html  serial-tests], but usually parallel tests are enabled by default.&lt;br /&gt;
In this case, you may have to modify the configure.ac script by adding serial-tests to AM_INIT_AUTOMAKE:&lt;br /&gt;
&lt;br /&gt;
 AM_INIT_AUTOMAKE([serial-tests])&lt;br /&gt;
&lt;br /&gt;
Recursive targets may not work out of the box either, in that case also try adding the following into configure.ac:&lt;br /&gt;
&lt;br /&gt;
 AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])&lt;br /&gt;
&lt;br /&gt;
==Installing the test suite==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class will automatically copy the required &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; file and run &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt; if there is such a target in the top-level &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;. For packages where this is enough, you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
If you need to do something more than the automatic &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt;, create a &amp;lt;code&amp;gt;do_install_ptest&amp;lt;/code&amp;gt; function within the recipe and put the required actions there. This function will be called after &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt; has completed.&lt;br /&gt;
&lt;br /&gt;
==Recipes with ptest Enabled==&lt;br /&gt;
&lt;br /&gt;
You can use the layer index search function to find out which recipes have ptest enabled by searching for recipes that inherit the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest&lt;br /&gt;
&lt;br /&gt;
Specifically for OE-Core:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest+layer%3Aopenembedded-core&lt;br /&gt;
&lt;br /&gt;
Please consider when updating a recipe whether you can also incorporate a ptest package to it as well.&lt;br /&gt;
&lt;br /&gt;
= QA = &lt;br /&gt;
&lt;br /&gt;
For every Milestone of the release, QA team should execute pTest on real HW and compare the results with his previous corresponding execution (example 2.3 M2 should be compared with 2.3 M1 results) to track better all the releases ans execution an [[ Ptest/archive | archive ]] page was created to track all the executions and check what are the previous results available to compare.&lt;br /&gt;
&lt;br /&gt;
* To check the process used to execute Ptest during QA cycles go to [[BSP_Test_Plan#pTest|pTest process]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37597</id>
		<title>Ptest</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37597"/>
		<updated>2018-04-05T00:11:50Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Ptest (&#039;&#039;package test&#039;&#039;) is a concept for building, installing and running the test suites that are included in many upstream packages, and producing a consistent output format for the results.&lt;br /&gt;
&lt;br /&gt;
=Adding ptest to your build=&lt;br /&gt;
&lt;br /&gt;
To add package testing to your build, set the &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt; variables in your &amp;lt;code&amp;gt;conf/local.conf&amp;lt;/code&amp;gt; file, which is found in the Build Directory:&lt;br /&gt;
&lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; ptest&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest&amp;quot; to your DISTRO_FEATURES variable causes -ptest packages to be built.&lt;br /&gt;
&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot;ptest-pkgs&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest-pkgs&amp;quot; to IMAGE_FEATURES variable causes all -ptest packages corresponding with other packages installed in your image to be additionally installed.&lt;br /&gt;
&lt;br /&gt;
As an alternative to the &amp;lt;code&amp;gt;ptest-pkgs&amp;lt;/code&amp;gt; image feature, if you want to be more selective about which tests to include, you can install them individually e.g. to install the tests for e2fsprogs and zlib you would do something like this:&lt;br /&gt;
&lt;br /&gt;
 CORE_IMAGE_EXTRA_INSTALL += &amp;quot;e2fsprogs-ptest zlib-ptest&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is of course just one way to add packages to an image, see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customizing images] section of the Yocto Project development manual for more information.&lt;br /&gt;
&lt;br /&gt;
All ptest files are installed in &amp;lt;code&amp;gt;/usr/lib/&amp;lt;package&amp;gt;/ptest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Running ptest=&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;ptest-runner&amp;quot; package installs a &amp;quot;ptest-runner&amp;quot; which loops through all installed ptest test suites and runs them in sequence. You may therefore want to add &amp;quot;ptest-runner&amp;quot; to your image.&lt;br /&gt;
&lt;br /&gt;
==ptest-runner Usage==&lt;br /&gt;
&lt;br /&gt;
The usage for the ptest-runner is as follows:&lt;br /&gt;
&lt;br /&gt;
 Usage: ptest-runner [-d directory] [-l list] [-t timeout] [-h] [ptest1 ptest2 ...]&lt;br /&gt;
&lt;br /&gt;
==Executing ptest-runner==&lt;br /&gt;
&lt;br /&gt;
To execute a full ptest run you can do the following command line anywhere in the target:&lt;br /&gt;
&lt;br /&gt;
 $ ptest-runner&lt;br /&gt;
&lt;br /&gt;
Remember to redirect to a file if you want to have a log&lt;br /&gt;
&lt;br /&gt;
=Implementing ptest in a package recipe=&lt;br /&gt;
&lt;br /&gt;
==What constitutes a ptest?==&lt;br /&gt;
&lt;br /&gt;
A ptest must at minimum contain two things: &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; and the actual test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; is a minimal shell script that &#039;&#039;starts&#039;&#039; the test suite. Note: It must not &#039;&#039;contain&#039;&#039; the test suite, only start it!&lt;br /&gt;
&lt;br /&gt;
The test can be anything, from a simple shell script running a binary and checking its output to an elaborate system of test binaries and data files.&lt;br /&gt;
&lt;br /&gt;
One major point of ptest is to consolidate the output format of all tests into a single common format. The format selected is the automake &amp;quot;simple test&amp;quot; format:&lt;br /&gt;
&lt;br /&gt;
 result: testname&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;result&amp;quot; is one of PASS, FAIL or SKIP and &amp;quot;testname&amp;quot; can be any identifying string (the same format [http://www.gnu.org/software/automake/manual/automake.html#Simple-Tests used by Automake].)&lt;br /&gt;
&lt;br /&gt;
==General recipe preparations==&lt;br /&gt;
&lt;br /&gt;
First, add &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; line in the recipe.&lt;br /&gt;
&lt;br /&gt;
If a test adds build-time or run-time dependencies to the package which are not there normally (such as requiring &amp;quot;make&amp;quot; to run the test suite), add those with a -ptest suffix, like this:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${PN}-ptest += &amp;quot;make&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Building the test suite==&lt;br /&gt;
&lt;br /&gt;
Few packages support cross-compiling their test suites, so this is something we typically have to add.&lt;br /&gt;
&lt;br /&gt;
Many automake-based packages compile and run the test suite in a single command: &amp;quot;make check&amp;quot;. This doesn&#039;t work when cross-compiling, since we need to build on host and run on target. So we need to split that into two targets: One for building the test and one for running it. Our build of automake comes with a [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch patch] which does this automatically, so packages using the plain &amp;quot;make check&amp;quot; arrangement from automake get this automatically.&lt;br /&gt;
&lt;br /&gt;
Now add a do_compile_ptest function to build the test suite:&lt;br /&gt;
&lt;br /&gt;
 do_compile_ptest() {&lt;br /&gt;
     oe_runmake buildtest-TESTS&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If the package requires special configuration actions prior to compiling the test code, create a do_configure_ptest function to do that.&lt;br /&gt;
&lt;br /&gt;
Note that buildtest-TESTS requires [https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html  serial-tests], but usually parallel tests are enabled by default.&lt;br /&gt;
In this case, you may have to modify the configure.ac script by adding serial-tests to AM_INIT_AUTOMAKE:&lt;br /&gt;
&lt;br /&gt;
 AM_INIT_AUTOMAKE([serial-tests])&lt;br /&gt;
&lt;br /&gt;
Recursive targets may not work out of the box either, in that case also try adding the following into configure.ac:&lt;br /&gt;
&lt;br /&gt;
 AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])&lt;br /&gt;
&lt;br /&gt;
==Installing the test suite==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class will automatically copy the required &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; file and run &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt; if there is such a target in the top-level &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;. For packages where this is enough, you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
If you need to do something more than the automatic &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt;, create a &amp;lt;code&amp;gt;do_install_ptest&amp;lt;/code&amp;gt; function within the recipe and put the required actions there. This function will be called after &amp;lt;code&amp;gt;make install-ptest&amp;lt;code&amp;gt; has completed.&lt;br /&gt;
&lt;br /&gt;
==Recipes with ptest Enabled==&lt;br /&gt;
&lt;br /&gt;
You can use the layer index search function to find out which recipes have ptest enabled by searching for recipes that inherit the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest&lt;br /&gt;
&lt;br /&gt;
Specifically for OE-Core:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest+layer%3Aopenembedded-core&lt;br /&gt;
&lt;br /&gt;
Please consider when updating a recipe whether you can also incorporate a ptest package to it as well.&lt;br /&gt;
&lt;br /&gt;
= QA = &lt;br /&gt;
&lt;br /&gt;
For every Milestone of the release, QA team should execute pTest on real HW and compare the results with his previous corresponding execution (example 2.3 M2 should be compared with 2.3 M1 results) to track better all the releases ans execution an [[ Ptest/archive | archive ]] page was created to track all the executions and check what are the previous results available to compare.&lt;br /&gt;
&lt;br /&gt;
* To check the process used to execute Ptest during QA cycles go to [[BSP_Test_Plan#pTest|pTest process]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37596</id>
		<title>Ptest</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37596"/>
		<updated>2018-04-05T00:11:13Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Explain how to add an individual ptest package&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Ptest (&#039;&#039;package test&#039;&#039;) is a concept for building, installing and running the test suites that are included in many upstream packages, and producing a consistent output format for the results.&lt;br /&gt;
&lt;br /&gt;
=Adding ptest to your build=&lt;br /&gt;
&lt;br /&gt;
To add package testing to your build, set the &amp;lt;code&amp;gt;DISTRO_FEATURES&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt; variables in your &amp;lt;code&amp;gt;conf/local.conf&amp;lt;/code&amp;gt; file, which is found in the Build Directory:&lt;br /&gt;
&lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; ptest&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest&amp;quot; to your DISTRO_FEATURES variable causes -ptest packages to be built.&lt;br /&gt;
&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot;ptest-pkgs&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest-pkgs&amp;quot; to IMAGE_FEATURES variable causes all -ptest packages corresponding with other packages installed in your image to be additionally installed.&lt;br /&gt;
&lt;br /&gt;
As an alternative to the &amp;lt;code&amp;gt;ptest-pkgs&amp;lt;/code&amp;gt; image feature, if you want to be more selective about which tests to include, you can install them individually e.g. to install the tests for e2fsprogs and zlib you would do something like this:&lt;br /&gt;
&lt;br /&gt;
 CORE_IMAGE_EXTRA_INSTALL += &amp;quot;e2fsprogs-ptest zlib-ptest&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is of course just one way to add packages to an image, see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customizing images] section of the Yocto Project development manual for more information.&lt;br /&gt;
&lt;br /&gt;
All ptest files are installed in &amp;lt;code&amp;gt;/usr/lib/&amp;lt;package&amp;gt;/ptest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Running ptest=&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;ptest-runner&amp;quot; package installs a &amp;quot;ptest-runner&amp;quot; which loops through all installed ptest test suites and runs them in sequence. You may therefore want to add &amp;quot;ptest-runner&amp;quot; to your image.&lt;br /&gt;
&lt;br /&gt;
==Ptest-runner Usage==&lt;br /&gt;
&lt;br /&gt;
The usage for the ptest-runner is as follows:&lt;br /&gt;
&lt;br /&gt;
 Usage: ptest-runner [-d directory] [-l list] [-t timeout] [-h] [ptest1 ptest2 ...]&lt;br /&gt;
&lt;br /&gt;
==Executing Ptest-runner==&lt;br /&gt;
&lt;br /&gt;
To execute a full ptest run you can do the following command line anywhere in the target:&lt;br /&gt;
&lt;br /&gt;
 $ ptest-runner&lt;br /&gt;
&lt;br /&gt;
Remember to redirect to a file if you want to have a log&lt;br /&gt;
&lt;br /&gt;
=Implementing ptest in a package recipe=&lt;br /&gt;
&lt;br /&gt;
==What constitutes a ptest?==&lt;br /&gt;
&lt;br /&gt;
A ptest must at minimum contain two things: &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; and the actual test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; is a minimal shell script that &#039;&#039;starts&#039;&#039; the test suite. Note: It must not &#039;&#039;contain&#039;&#039; the test suite, only start it!&lt;br /&gt;
&lt;br /&gt;
The test can be anything, from a simple shell script running a binary and checking its output to an elaborate system of test binaries and data files.&lt;br /&gt;
&lt;br /&gt;
One major point of ptest is to consolidate the output format of all tests into a single common format. The format selected is the automake &amp;quot;simple test&amp;quot; format:&lt;br /&gt;
&lt;br /&gt;
 result: testname&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;result&amp;quot; is one of PASS, FAIL or SKIP and &amp;quot;testname&amp;quot; can be any identifying string (the same format [http://www.gnu.org/software/automake/manual/automake.html#Simple-Tests used by Automake].)&lt;br /&gt;
&lt;br /&gt;
==General recipe preparations==&lt;br /&gt;
&lt;br /&gt;
First, add &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; line in the recipe.&lt;br /&gt;
&lt;br /&gt;
If a test adds build-time or run-time dependencies to the package which are not there normally (such as requiring &amp;quot;make&amp;quot; to run the test suite), add those with a -ptest suffix, like this:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${PN}-ptest += &amp;quot;make&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Building the test suite==&lt;br /&gt;
&lt;br /&gt;
Few packages support cross-compiling their test suites, so this is something we typically have to add.&lt;br /&gt;
&lt;br /&gt;
Many automake-based packages compile and run the test suite in a single command: &amp;quot;make check&amp;quot;. This doesn&#039;t work when cross-compiling, since we need to build on host and run on target. So we need to split that into two targets: One for building the test and one for running it. Our build of automake comes with a [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch patch] which does this automatically, so packages using the plain &amp;quot;make check&amp;quot; arrangement from automake get this automatically.&lt;br /&gt;
&lt;br /&gt;
Now add a do_compile_ptest function to build the test suite:&lt;br /&gt;
&lt;br /&gt;
 do_compile_ptest() {&lt;br /&gt;
     oe_runmake buildtest-TESTS&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If the package requires special configuration actions prior to compiling the test code, create a do_configure_ptest function to do that.&lt;br /&gt;
&lt;br /&gt;
Note that buildtest-TESTS requires [https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html  serial-tests], but usually parallel tests are enabled by default.&lt;br /&gt;
In this case, you may have to modify the configure.ac script by adding serial-tests to AM_INIT_AUTOMAKE:&lt;br /&gt;
&lt;br /&gt;
 AM_INIT_AUTOMAKE([serial-tests])&lt;br /&gt;
&lt;br /&gt;
Recursive targets may not work out of the box either, in that case also try adding the following into configure.ac:&lt;br /&gt;
&lt;br /&gt;
 AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])&lt;br /&gt;
&lt;br /&gt;
==Installing the test suite==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class will automatically copy the required &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; file and run &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt; if there is such a target in the top-level &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;. For packages where this is enough, you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
If you need to do something more than the automatic &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt;, create a &amp;lt;code&amp;gt;do_install_ptest&amp;lt;/code&amp;gt; function within the recipe and put the required actions there. This function will be called after &amp;lt;code&amp;gt;make install-ptest&amp;lt;code&amp;gt; has completed.&lt;br /&gt;
&lt;br /&gt;
==Recipes with ptest Enabled==&lt;br /&gt;
&lt;br /&gt;
You can use the layer index search function to find out which recipes have ptest enabled by searching for recipes that inherit the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest&lt;br /&gt;
&lt;br /&gt;
Specifically for OE-Core:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest+layer%3Aopenembedded-core&lt;br /&gt;
&lt;br /&gt;
Please consider when updating a recipe whether you can also incorporate a ptest package to it as well.&lt;br /&gt;
&lt;br /&gt;
= QA = &lt;br /&gt;
&lt;br /&gt;
For every Milestone of the release, QA team should execute pTest on real HW and compare the results with his previous corresponding execution (example 2.3 M2 should be compared with 2.3 M1 results) to track better all the releases ans execution an [[ Ptest/archive | archive ]] page was created to track all the executions and check what are the previous results available to compare.&lt;br /&gt;
&lt;br /&gt;
* To check the process used to execute Ptest during QA cycles go to [[BSP_Test_Plan#pTest|pTest process]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37595</id>
		<title>Ptest</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37595"/>
		<updated>2018-04-05T00:03:58Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: More formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Ptest (&#039;&#039;package test&#039;&#039;) is a concept for building, installing and running the test suites that are included in many upstream packages, and producing a consistent output format for the results.&lt;br /&gt;
&lt;br /&gt;
=Adding ptest to your build=&lt;br /&gt;
&lt;br /&gt;
To add package testing to your build, add the DISTRO_FEATURES and EXTRA_IMAGE_FEATURES variables to your local.conf file, which is found in the Build Directory:&lt;br /&gt;
&lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; ptest&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest&amp;quot; to your DISTRO_FEATURES variable causes -ptest packages to be built.&lt;br /&gt;
&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot;ptest-pkgs&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest-pkgs&amp;quot; to IMAGE_FEATURES variable causes -ptest packages to be installed in your image.&lt;br /&gt;
&lt;br /&gt;
All ptest files are installed in /usr/lib/&amp;lt;package&amp;gt;/ptest.&lt;br /&gt;
&lt;br /&gt;
=Running ptest=&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;ptest-runner&amp;quot; package installs a &amp;quot;ptest-runner&amp;quot; which loops through all installed ptest test suites and runs them in sequence. You may therefore want to add &amp;quot;ptest-runner&amp;quot; to your image.&lt;br /&gt;
&lt;br /&gt;
==Ptest-runner Usage==&lt;br /&gt;
&lt;br /&gt;
The usage for the ptest-runner is as follows:&lt;br /&gt;
&lt;br /&gt;
 Usage: ptest-runner [-d directory] [-l list] [-t timeout] [-h] [ptest1 ptest2 ...]&lt;br /&gt;
&lt;br /&gt;
==Executing Ptest-runner==&lt;br /&gt;
&lt;br /&gt;
To execute a full ptest run you can do the following command line anywhere in the target:&lt;br /&gt;
&lt;br /&gt;
 $ ptest-runner&lt;br /&gt;
&lt;br /&gt;
Remember to redirect to a file if you want to have a log&lt;br /&gt;
&lt;br /&gt;
=Implementing ptest in a package recipe=&lt;br /&gt;
&lt;br /&gt;
==What constitutes a ptest?==&lt;br /&gt;
&lt;br /&gt;
A ptest must at minimum contain two things: &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; and the actual test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; is a minimal shell script that &#039;&#039;starts&#039;&#039; the test suite. Note: It must not &#039;&#039;contain&#039;&#039; the test suite, only start it!&lt;br /&gt;
&lt;br /&gt;
The test can be anything, from a simple shell script running a binary and checking its output to an elaborate system of test binaries and data files.&lt;br /&gt;
&lt;br /&gt;
One major point of ptest is to consolidate the output format of all tests into a single common format. The format selected is the automake &amp;quot;simple test&amp;quot; format:&lt;br /&gt;
&lt;br /&gt;
 result: testname&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;result&amp;quot; is one of PASS, FAIL or SKIP and &amp;quot;testname&amp;quot; can be any identifying string (the same format [http://www.gnu.org/software/automake/manual/automake.html#Simple-Tests used by Automake].)&lt;br /&gt;
&lt;br /&gt;
==General recipe preparations==&lt;br /&gt;
&lt;br /&gt;
First, add &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; line in the recipe.&lt;br /&gt;
&lt;br /&gt;
If a test adds build-time or run-time dependencies to the package which are not there normally (such as requiring &amp;quot;make&amp;quot; to run the test suite), add those with a -ptest suffix, like this:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${PN}-ptest += &amp;quot;make&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Building the test suite==&lt;br /&gt;
&lt;br /&gt;
Few packages support cross-compiling their test suites, so this is something we typically have to add.&lt;br /&gt;
&lt;br /&gt;
Many automake-based packages compile and run the test suite in a single command: &amp;quot;make check&amp;quot;. This doesn&#039;t work when cross-compiling, since we need to build on host and run on target. So we need to split that into two targets: One for building the test and one for running it. Our build of automake comes with a [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch patch] which does this automatically, so packages using the plain &amp;quot;make check&amp;quot; arrangement from automake get this automatically.&lt;br /&gt;
&lt;br /&gt;
Now add a do_compile_ptest function to build the test suite:&lt;br /&gt;
&lt;br /&gt;
 do_compile_ptest() {&lt;br /&gt;
     oe_runmake buildtest-TESTS&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If the package requires special configuration actions prior to compiling the test code, create a do_configure_ptest function to do that.&lt;br /&gt;
&lt;br /&gt;
Note that buildtest-TESTS requires [https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html  serial-tests], but usually parallel tests are enabled by default.&lt;br /&gt;
In this case, you may have to modify the configure.ac script by adding serial-tests to AM_INIT_AUTOMAKE:&lt;br /&gt;
&lt;br /&gt;
 AM_INIT_AUTOMAKE([serial-tests])&lt;br /&gt;
&lt;br /&gt;
Recursive targets may not work out of the box either, in that case also try adding the following into configure.ac:&lt;br /&gt;
&lt;br /&gt;
 AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])&lt;br /&gt;
&lt;br /&gt;
==Installing the test suite==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class will automatically copy the required &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; file and run &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt; if there is such a target in the top-level &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;. For packages where this is enough, you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
If you need to do something more than the automatic &amp;lt;code&amp;gt;make install-ptest&amp;lt;/code&amp;gt;, create a &amp;lt;code&amp;gt;do_install_ptest&amp;lt;/code&amp;gt; function within the recipe and put the required actions there. This function will be called after &amp;lt;code&amp;gt;make install-ptest&amp;lt;code&amp;gt; has completed.&lt;br /&gt;
&lt;br /&gt;
==Recipes with ptest Enabled==&lt;br /&gt;
&lt;br /&gt;
You can use the layer index search function to find out which recipes have ptest enabled by searching for recipes that inherit the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest&lt;br /&gt;
&lt;br /&gt;
Specifically for OE-Core:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest+layer%3Aopenembedded-core&lt;br /&gt;
&lt;br /&gt;
Please consider when updating a recipe whether you can also incorporate a ptest package to it as well.&lt;br /&gt;
&lt;br /&gt;
= QA = &lt;br /&gt;
&lt;br /&gt;
For every Milestone of the release, QA team should execute pTest on real HW and compare the results with his previous corresponding execution (example 2.3 M2 should be compared with 2.3 M1 results) to track better all the releases ans execution an [[ Ptest/archive | archive ]] page was created to track all the executions and check what are the previous results available to compare.&lt;br /&gt;
&lt;br /&gt;
* To check the process used to execute Ptest during QA cycles go to [[BSP_Test_Plan#pTest|pTest process]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37594</id>
		<title>Ptest</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Ptest&amp;diff=37594"/>
		<updated>2018-04-05T00:01:27Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Update and improve formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Ptest (&#039;&#039;package test&#039;&#039;) is a concept for building, installing and running the test suites that are included in many upstream packages, and producing a consistent output format for the results.&lt;br /&gt;
&lt;br /&gt;
=Adding ptest to your build=&lt;br /&gt;
&lt;br /&gt;
To add package testing to your build, add the DISTRO_FEATURES and EXTRA_IMAGE_FEATURES variables to your local.conf file, which is found in the Build Directory:&lt;br /&gt;
&lt;br /&gt;
 DISTRO_FEATURES_append = &amp;quot; ptest&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest&amp;quot; to your DISTRO_FEATURES variable causes -ptest packages to be built.&lt;br /&gt;
&lt;br /&gt;
 EXTRA_IMAGE_FEATURES += &amp;quot;ptest-pkgs&amp;quot;&lt;br /&gt;
 # Adding &amp;quot;ptest-pkgs&amp;quot; to IMAGE_FEATURES variable causes -ptest packages to be installed in your image.&lt;br /&gt;
&lt;br /&gt;
All ptest files are installed in /usr/lib/&amp;lt;package&amp;gt;/ptest.&lt;br /&gt;
&lt;br /&gt;
=Running ptest=&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;ptest-runner&amp;quot; package installs a &amp;quot;ptest-runner&amp;quot; which loops through all installed ptest test suites and runs them in sequence. You may therefore want to add &amp;quot;ptest-runner&amp;quot; to your image.&lt;br /&gt;
&lt;br /&gt;
==Ptest-runner Usage==&lt;br /&gt;
&lt;br /&gt;
The usage for the ptest-runner is as follows:&lt;br /&gt;
&lt;br /&gt;
 Usage: ptest-runner [-d directory] [-l list] [-t timeout] [-h] [ptest1 ptest2 ...]&lt;br /&gt;
&lt;br /&gt;
==Executing Ptest-runner==&lt;br /&gt;
&lt;br /&gt;
To execute a full ptest run you can do the following command line anywhere in the target:&lt;br /&gt;
&lt;br /&gt;
 $ ptest-runner&lt;br /&gt;
&lt;br /&gt;
Remember to redirect to a file if you want to have a log&lt;br /&gt;
&lt;br /&gt;
=Implementing ptest in a package recipe=&lt;br /&gt;
&lt;br /&gt;
==What constitutes a ptest?==&lt;br /&gt;
&lt;br /&gt;
A ptest must at minimum contain two things: &amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; and the actual test.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;run-ptest&amp;lt;/code&amp;gt; is a minimal shell script that &#039;&#039;starts&#039;&#039; the test suite. Note: It must not &#039;&#039;contain&#039;&#039; the test suite, only start it!&lt;br /&gt;
&lt;br /&gt;
The test can be anything, from a simple shell script running a binary and checking its output to an elaborate system of test binaries and data files.&lt;br /&gt;
&lt;br /&gt;
One major point of ptest is to consolidate the output format of all tests into a single common format. The format selected is the automake &amp;quot;simple test&amp;quot; format:&lt;br /&gt;
&lt;br /&gt;
 result: testname&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;result&amp;quot; is one of PASS, FAIL or SKIP and &amp;quot;testname&amp;quot; can be any identifying string (the same format [http://www.gnu.org/software/automake/manual/automake.html#Simple-Tests used by Automake].)&lt;br /&gt;
&lt;br /&gt;
==General recipe preparations==&lt;br /&gt;
&lt;br /&gt;
First, add &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; line in the recipe.&lt;br /&gt;
&lt;br /&gt;
If a test adds build-time or run-time dependencies to the package which are not there normally (such as requiring &amp;quot;make&amp;quot; to run the test suite), add those with a -ptest suffix, like this:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_${PN}-ptest += &amp;quot;make&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Building the test suite==&lt;br /&gt;
&lt;br /&gt;
Few packages support cross-compiling their test suites, so this is something we typically have to add.&lt;br /&gt;
&lt;br /&gt;
Many automake-based packages compile and run the test suite in a single command: &amp;quot;make check&amp;quot;. This doesn&#039;t work when cross-compiling, since we need to build on host and run on target. So we need to split that into two targets: One for building the test and one for running it. Our build of automake comes with a [http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/automake/automake/buildtest.patch patch] which does this automatically, so packages using the plain &amp;quot;make check&amp;quot; arrangement from automake get this automatically.&lt;br /&gt;
&lt;br /&gt;
Now add a do_compile_ptest function to build the test suite:&lt;br /&gt;
&lt;br /&gt;
 do_compile_ptest() {&lt;br /&gt;
     oe_runmake buildtest-TESTS&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If the package requires special configuration actions prior to compiling the test code, create a do_configure_ptest function to do that.&lt;br /&gt;
&lt;br /&gt;
Note that buildtest-TESTS requires [https://www.gnu.org/software/automake/manual/html_node/Serial-Test-Harness.html  serial-tests], but usually parallel tests are enabled by default.&lt;br /&gt;
In this case, you may have to modify the configure.ac script by adding serial-tests to AM_INIT_AUTOMAKE:&lt;br /&gt;
&lt;br /&gt;
 AM_INIT_AUTOMAKE([serial-tests])&lt;br /&gt;
&lt;br /&gt;
Recursive targets may not work out of the box either, in that case also try adding the following into configure.ac:&lt;br /&gt;
&lt;br /&gt;
 AM_EXTRA_RECURSIVE_TARGETS([buildtest-TESTS])&lt;br /&gt;
&lt;br /&gt;
==Installing the test suite==&lt;br /&gt;
&lt;br /&gt;
The ptest.bbclass will automatically copy the required &amp;quot;run-ptest&amp;quot; file and run &amp;quot;make install-ptest&amp;quot; if there is such a target in the top-level Makefile. For packages where this is enough, you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
If you need to do something more than the automatic &amp;quot;make install-ptest&amp;quot;, create a do_install_ptest function and put the required actions there. This function will be called after &amp;quot;make install-ptest&amp;quot; has completed.&lt;br /&gt;
&lt;br /&gt;
==Recipes with ptest Enabled==&lt;br /&gt;
&lt;br /&gt;
You can use the layer index search function to find out which recipes have ptest enabled by searching for recipes that inherit the &amp;lt;code&amp;gt;ptest&amp;lt;/code&amp;gt; class:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest&lt;br /&gt;
&lt;br /&gt;
Specifically for OE-Core:&lt;br /&gt;
&lt;br /&gt;
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=inherits%3Aptest+layer%3Aopenembedded-core&lt;br /&gt;
&lt;br /&gt;
Please consider when updating a recipe whether you can also incorporate a ptest package to it as well.&lt;br /&gt;
&lt;br /&gt;
= QA = &lt;br /&gt;
&lt;br /&gt;
For every Milestone of the release, QA team should execute pTest on real HW and compare the results with his previous corresponding execution (example 2.3 M2 should be compared with 2.3 M1 results) to track better all the releases ans execution an [[ Ptest/archive | archive ]] page was created to track all the executions and check what are the previous results available to compare.&lt;br /&gt;
&lt;br /&gt;
* To check the process used to execute Ptest during QA cycles go to [[BSP_Test_Plan#pTest|pTest process]]&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Yocto_2.5_Schedule&amp;diff=37207</id>
		<title>Yocto 2.5 Schedule</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Yocto_2.5_Schedule&amp;diff=37207"/>
		<updated>2018-03-20T23:29:29Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: Use 2.5 release date rather than the one copy/pasted from the 2.4 page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Yocto Project 2.5 release milestone structure = &lt;br /&gt;
[[File: YP1.3milestone.png]]&lt;br /&gt;
&lt;br /&gt;
=&lt;br /&gt;
&lt;br /&gt;
= Yocto Project 2.5 release schedule (release date: Apr. 27, 2018) =&lt;br /&gt;
----&lt;br /&gt;
The detailed milestone map for the 2.5 release of Yocto Project is as below. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
To view the Yocto schedule-at-a-glance, go to [[YoctoCalendar]]. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Please note that the estimation for each feature is done based on &#039;perfect day&#039;. The purpose of the estimation is to estimate the relative size of features, NOT to predict when a single feature could be done.&lt;br /&gt;
&lt;br /&gt;
== M1 (Oct. 23, 2017 to Dec. 15, 2017  ==&lt;br /&gt;
=== M1 Feature/Tasks Development / Cutoff is Dec. 4, 2017 ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M1&lt;br /&gt;
  |severity=enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== M1 Bugs ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M1&lt;br /&gt;
  |severity=!enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== M1 Stabilize schedule ===&lt;br /&gt;
&#039;&#039;&#039;Release Candidate and Milestone Release schedule&#039;&#039;&#039;&lt;br /&gt;
* RC1: 12/4/17&lt;br /&gt;
* M1 release: 12/15/17&lt;br /&gt;
&lt;br /&gt;
== M2 (Dec. 5, 2017 to Jan. 26, 2018 ==&lt;br /&gt;
=== M2 Feature/tasks Development / Cutoff is Jan. 15, 2018 ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M2&lt;br /&gt;
  |severity=enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== M2 Bugs ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M2&lt;br /&gt;
  |severity=!enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== M2 Stabilize schedule ===&lt;br /&gt;
&#039;&#039;&#039;Release Candidate and Milestone Release schedule (Full Pass QA  test follows every RC build)&#039;&#039;&#039;&lt;br /&gt;
* RC1: 1/15/18&lt;br /&gt;
* M2 release: 1/26/18&lt;br /&gt;
&lt;br /&gt;
== M3 (Jan. 16, 2018 to Mar. 2, 2018 ==&lt;br /&gt;
=== M3 Feature/tasks Development / Cutoff is Feb. 19, 2018 ===&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M3&lt;br /&gt;
  |severity=enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== M3 Bugs ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M3&lt;br /&gt;
  |severity=!enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== M3 Stabilize schedule ===&lt;br /&gt;
&#039;&#039;&#039;Release Candidate and Milestone Release schedule (Full Pass QA  test follows every RC build)&#039;&#039;&#039;&lt;br /&gt;
* RC1: 2/19/18&lt;br /&gt;
* M3 release: 3/2/18&lt;br /&gt;
&lt;br /&gt;
== M4 (Feb. 20, 2018 to Apr. 27, 2018 ==&lt;br /&gt;
=== M4 Bug/fix Cutoff is Apr. 2, 2018 ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M4&lt;br /&gt;
  |severity=enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== M4 Bugs ===&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,from,to,estimated,summary,severity,priority,whiteboard,status&lt;br /&gt;
  |total=estimated&lt;br /&gt;
  |milestone=2.5 M4&lt;br /&gt;
  |severity=!enhancement&lt;br /&gt;
  |sort=to,priority&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== M4 Stabilize schedule ===&lt;br /&gt;
&#039;&#039;&#039;Release Candidate and Milestone Release schedule (Full Pass QA  test follows every RC build)&#039;&#039;&#039;&lt;br /&gt;
* RC1: 4/2/18&lt;br /&gt;
* RC2: 4/9/18&lt;br /&gt;
* RC3: 4/16/18&lt;br /&gt;
* Final M4 release: 4/27/18&lt;br /&gt;
&lt;br /&gt;
== Yocto Project 2.5 release unscheduled features/tasks list==&lt;br /&gt;
These features/tasks are planned for 2.5, but have not been scheduled to any specific milestone. As we move forward, more of these will be scheduled into each milestone, especially during milestone planning for each milestone above.&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,to,estimated,summary,severity,priority,milestone,whiteboard,status,&lt;br /&gt;
  |milestone=2.5&lt;br /&gt;
  |sort=to&lt;br /&gt;
  |priority=high&lt;br /&gt;
  |status=!(resolved,verified,closed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,to,estimated,summary,severity,priority,milestone,whiteboard,status,&lt;br /&gt;
  |milestone=2.5&lt;br /&gt;
  |sort=to&lt;br /&gt;
  |priority=medium%2B&lt;br /&gt;
  |status=!(resolved,verified,closed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,to,estimated,summary,severity,priority,milestone,whiteboard,status,&lt;br /&gt;
  |milestone=2.5&lt;br /&gt;
  |sort=to&lt;br /&gt;
  |priority=medium&lt;br /&gt;
  |status=!(resolved,verified,closed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#bugzilla:&lt;br /&gt;
  |columns=id,to,estimated,summary,severity,priority,milestone,whiteboard,status,&lt;br /&gt;
  |milestone=2.5&lt;br /&gt;
  |sort=to&lt;br /&gt;
  |priority=low&lt;br /&gt;
  |status=!(resolved,verified,closed)&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=37206</id>
		<title>Technical FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=Technical_FAQ&amp;diff=37206"/>
		<updated>2018-03-20T19:48:59Z</updated>

		<summary type="html">&lt;p&gt;PaulEggleton: /* Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;color:black; background-color:#ffffcc&amp;quot; width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;NOTE:&#039;&#039;&#039; This is currently a draft. Not sure where this should end up but I&#039;ve been gathering these based on my interactions with people on IRC and email over the years. - [[User:PaulEggleton|PaulEggleton]] ([[User talk:PaulEggleton|talk]]) 21:13, 27 June 2016 (PDT)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
=== How do I figure out which version/codename/bitbake version matches up with which? ===&lt;br /&gt;
&lt;br /&gt;
There is a table in the [http://wiki.yoctoproject.org/wiki/Releases Releases page] on the Yocto Project wiki.&lt;br /&gt;
&lt;br /&gt;
=== How do I control what&#039;s in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Images specify a list of packages that they should contain. See [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#usingpoky-extend-customimage Customising Images] within the Yocto Project development manual for further details.&lt;br /&gt;
&lt;br /&gt;
Note: if you&#039;re doing anything more than basic experimentation / testing then you almost certainly should create your own image recipe rather than using one of the example images e.g. core-image-minimal - though you can certainly start by copying one of the example images. This way you have easier control over what goes into the image.&lt;br /&gt;
&lt;br /&gt;
=== Where do I find build logs? ===&lt;br /&gt;
&lt;br /&gt;
For the overall build, the output of bitbake gets logged to tmp/log/cooker/&amp;lt;machine&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each individual recipe, there is a &amp;quot;temp&amp;quot; directory under the work directory for the recipe that contains log.&amp;amp;lt;taskname&amp;amp;gt; and run.&amp;amp;lt;taskname&amp;amp;gt; files - the logs and the runfiles respectively. Within the build system this directory is pointed to by the T variable, so if you need to you can find it by using &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e &amp;amp;lt;recipename&amp;amp;gt; | grep ^T=&lt;br /&gt;
&lt;br /&gt;
=== How do I add a patch to a recipe? ===&lt;br /&gt;
&lt;br /&gt;
There are two concerns - how the recipe can fetch the patch and how it can be applied. For fetching, patch files are usually placed in a subdirectory next to the recipe; by default this directory should be named &amp;quot;files&amp;quot; or the the recipe name without any class prefix or suffix (for example for both &amp;quot;xyz&amp;quot; and &amp;quot;xyz-native&amp;quot; the subdirectory would be &amp;quot;xyz&amp;quot;). A pointer to it then needs to be added to &amp;lt;code&amp;gt;SRC_URI&amp;lt;/code&amp;gt; within the recipe, which usually takes the form &amp;lt;code&amp;gt;file://&amp;amp;lt;patchname&amp;amp;gt;.patch&amp;lt;/code&amp;gt; - i.e. just the filename, no path. If more than one subdirectory needs to be stripped off the paths in the patch (i.e. you need more than the equivalent of te -p1 option to the patch command) then you can add &amp;lt;code&amp;gt;;striplevel=&amp;amp;lt;number&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of the patch entry in SRC_URI (without any spaces).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;devtool&amp;lt;/code&amp;gt; utility can help you modify the sources for a recipe and create a patch - basically &amp;lt;code&amp;gt;devtool modify&amp;lt;/code&amp;gt;, edit the sources, commit the changes with &amp;lt;code&amp;gt;git commit&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;devtool update-recipe&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;devtool finish&amp;lt;/code&amp;gt; in 2.2). For more details see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#devtool-use-devtool-modify-to-enable-work-on-code-associated-with-an-existing-recipe Use devtool modify to Enable Work on Code Associated with an Existing Recipe] within the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;native&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;native&amp;quot; suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake).&lt;br /&gt;
&lt;br /&gt;
=== What does &amp;quot;nativesdk&amp;quot; mean? ===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;nativesdk&amp;quot; prefix identifies recipes (and variants of recipes) that produce files intended for the host portion of the standard SDK, or for things which are constructed like an SDK such as buildtools-tarball. These are built for SDKMACHINE which may or may not be the same architecture as the build host.&lt;br /&gt;
&lt;br /&gt;
=== I have two recipes and one needs to access files provided by another - how can that work? ===&lt;br /&gt;
&lt;br /&gt;
Instead of providing direct access from a recipe to another&#039;s build tree (which wouldn&#039;t be practical with OpenEmbedded since the build tree (or &amp;quot;workdir&amp;quot;) is temporary), we create a &amp;quot;sysroot&amp;quot; where files that are intended to be shared between recipes get copied. The sysroot is managed by the build system and you should not copy files in there directly - instead, you install files under ${D} as normal during do_install and then the build system will copy a subset of those to the sysroot. There is a seperate sysroot for each machine being built for. In a recipe you can get the path of the sysroot and various standard directories under it using the STAGING_* variables.&lt;br /&gt;
&lt;br /&gt;
Often, for commonly-used build systems such as autotools and cmake you don&#039;t need to worry about these details - those systems and the environment that OpenEmbedded sets up for them will ensure that files get installed and picked up in the correct locations. However if the software your recipe is building has custom build scripts / makefiles and it takes shortcuts that don&#039;t account for cross-compilation or the use of a sysroot, then you will need to make appropriate adjustments.&lt;br /&gt;
&lt;br /&gt;
=== How do I enable package management in the final image? ===&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;package-management&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;IMAGE_FEATURES&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;EXTRA_IMAGE_FEATURES&amp;lt;/code&amp;gt;). You should then be able to use dnf/rpm, opkg, or apt-get/dpkg from the running system depending on the packaging format you have selected through PACKAGE_CLASSES. For more information see [http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#using-runtime-package-management Using Runtime Package Management] in the Yocto Project Development manual.&lt;br /&gt;
&lt;br /&gt;
=== What do ?=, ??=, := etc. do within a recipe/config file? ===&lt;br /&gt;
&lt;br /&gt;
See the [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#basic-syntax Basic Syntax section of the BitBake manual] for details.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
See http://www.openembedded.org/Layers_FAQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a recipe but it&#039;s not showing up in my image, what&#039;s going on? ===&lt;br /&gt;
&lt;br /&gt;
Creating a recipe (or adding a layer to your configuration with a desired recipe in it) only makes it available to the build system, it doesn&#039;t change what goes into the image. For that, see [[#How do I control what&#039;s in the final image?|How do I control what&#039;s in the final image?]] above.&lt;br /&gt;
&lt;br /&gt;
=== I set a variable but it doesn&#039;t seem to be having an effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
First, double-check that you haven&#039;t misspelled the variable name.&lt;br /&gt;
&lt;br /&gt;
The main tool to help troubleshoot any variable-related issue is &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; - this lists all the variables and the complete history of how each one has been set (use &amp;lt;code&amp;gt;bitbake -e recipename&amp;lt;/code&amp;gt; if you&#039;re dealing with issues in a variable value within a recipe as opposed to the global level). Usually it&#039;s best to pipe this through &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; so you can easily see the history - you can press / to search for the variable name. Often you will be dealing with the behaviour of a variable within the context of a specific recipe, so specify that recipe on the &amp;lt;code&amp;gt;bitbake -e&amp;lt;/code&amp;gt; command line to get the variables as set within the context of the recipe rather than the global context.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re setting a variable in a bbappend, double-check that the bbappend is actually being applied - see the next question.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve created a bbappend for a recipe but what I&#039;m setting there isn&#039;t having any effect, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Here are some things to check:&lt;br /&gt;
&lt;br /&gt;
# Check if the layer the bbappend is in is listed in &amp;lt;code&amp;gt;bitbake-layers show-layers&amp;lt;/code&amp;gt;. If it isn&#039;t, you need to edit your bblayers.conf and ensure the path to the layer is included in the BBLAYERS value&lt;br /&gt;
# Check that the bbappend is being picked up by running &amp;lt;code&amp;gt;bitbake-layers show-appends&amp;lt;/code&amp;gt; - if your bbappend file isn&#039;t listed, it could be named incorrectly (such that it doesn&#039;t match the recipe name) or it may be that the BBFILES value in the conf/layer.conf for the layer containing the bbappend file doesn&#039;t include an expression that will match the bbappend files.&lt;br /&gt;
# If there are multiple versions of the recipe you have bbappended, it could be that the actual recipe being built is a different version than the one you have bbappended. &amp;lt;code&amp;gt;bitbake-layers show-recipes &amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; will list all the versions, with the first one listed being the one that will be built. If this is the case there are several different solutions to this - (a) Rename your bbappend to match the version being built, (b) use a % wildcard in your bbappend so it will apply to any version, (c) set &amp;lt;code&amp;gt;PREFERRED_VERSION_&amp;amp;lt;recipename&amp;amp;gt;&amp;lt;/code&amp;gt; in the configuration to select a the version you want to be built.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m getting warnings that a recipe is tainted - what does this mean? ===&lt;br /&gt;
&lt;br /&gt;
Usually this happens because you have used I used bitbake&#039;s &amp;lt;code&amp;gt;-f&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-C&amp;lt;/code&amp;gt; option to force a task to re-execute. The assumption is that if you forced a task, it is possible that a rebuild from scratch would not include whatever changes you made that necessitated forcing (e.g. if you modified the source in the work directory for the recipe and then ran &amp;lt;code&amp;gt;bitbake -c compile -f&amp;lt;/code&amp;gt;). Generally, forcing a task should be reserved for situations where the build system has failed to detect a change you made rather than for everyday usage - if you&#039;re finding yourself needing to do it regularly then either there&#039;s a bug or you&#039;re doing something wrong. Running &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the recipe will get rid of the taint flag.&lt;br /&gt;
&lt;br /&gt;
There is one other situation where we apply a taint, and that is &amp;lt;code&amp;gt;bitbake -c menuconfig&amp;lt;/code&amp;gt; on the kernel. In this case, the configuration has been saved into the work directory for the kernel, but that is temporary - any rebuild from scratch will use the default configuration, so it is a reminder that you need to take the configuration and apply it back to the metadata and then run &amp;lt;code&amp;gt;bitbake -c clean&amp;lt;/code&amp;gt; on the kernel recipe.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m fetching from a git repository over ssh / http / https but it&#039;s not fetching properly, how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
Bitbake expects the prefix of entries in SRC_URI to specify the fetcher to be used, not the actual protocol. Thus, instead of:&lt;br /&gt;
&lt;br /&gt;
 # This will NOT work&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;http://git.example.com/repository&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should specify:&lt;br /&gt;
&lt;br /&gt;
 # This is better&lt;br /&gt;
 SRC_URI = &amp;quot;&amp;lt;nowiki&amp;gt;git://git.example.com/repository;protocol=http&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same applies for ssh and https.&lt;br /&gt;
&lt;br /&gt;
=== I tried bitbake &amp;lt;some target package name&amp;gt; that I know exists and it told me that nothing PROVIDES this...? ===&lt;br /&gt;
&lt;br /&gt;
There are two namespaces that bitbake concerns itself with - recipe names (a.k.a. build time targets) and package names (a.k.a. runtime targets). You can specify a build time target on the bitbake command line, but not a runtime target; you need to find the recipe that provides the package you are trying to build and build that instead (or simply add that package to your image and build the image). In current versions bitbake will at least tell you which recipes have matching or similar-sounding runtime provides (RPROVIDES) so that you&#039;ll usually get a hint on which recipe you need to build.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;ve included a package in my image but files I expect to be there are missing, what&#039;s the issue? ===&lt;br /&gt;
&lt;br /&gt;
Check the simple stuff: verify that the package is really in the image - look at the manifest file next to the image to ensure the package is listed. Also if you&#039;re flashing the image, double-check that you did indeed flash the right image and if there are multiple partitions / storage devices on your board or device that you&#039;re booting the one that you think you are.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re sure of the above, it may be a matter of the package splitting - a lot of recipes split less commonly used components out to separate packages, so it&#039;s possible that the files you are looking for are in a different package. You can look at the recipe for this (look for PACKAGES and FILES statements) or assuming the recipe has been built, you can use &amp;lt;code&amp;gt;oe-pkgdata-util list-pkgs -p recipename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;oe-pkgdata-util list-pkg-files&amp;lt;/code&amp;gt; to inspect the packages provided by the recipe and the files they contain. Once you find the right package you can add it to your image.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m required to set LIC_FILES_CHKSUM but the software I&#039;m building doesn&#039;t have a license statement, what do I do? ===&lt;br /&gt;
&lt;br /&gt;
Ideally, all software should come with some kind of license statement so that the terms of distribution are clearly stated (especially if its source code is made publicly available); if not a text file describing the license then at the very least a line or two in the accompanying documentation, README file or source header comments. Assuming there is a license statement somewhere but not in a form you can point to with LIC_FILES_CHKSUM as part of the source tree, you can point LIC_FILES_CHKSUM to one of the generic license files in ${COMMON_LICENSE_DIR} (meta/files/common-licenses/), or alternatively you can include a file containing the license statement in a &amp;quot;files&amp;quot; subdirectory next to the recipe (or subdirectory named the same as the recipe - see how such files are handled in other recipes), point to it in SRC_URI using file://, then add it to LIC_FILES_CHKSUM. It is worth noting however that LIC_FILES_CHKSUM is intended to give you a warning if upstream changes its license terms when you do an upgrade of the recipe, and by pointing it to this common license file that is part of the metadata, that mechanism will not function. You may wish to consider encouraging the upstream provider of the software your recipe is building to follow best practices and include a proper license statement, so that you can point to it in a future version. At minimum if you do use such workarounds, you will need to take extra care when upgrading the recipe in future in case the upstream provider changes the license terms.&lt;br /&gt;
&lt;br /&gt;
If there really is no license stated at all anywhere for the software (and this is unfortunately not uncommon on github, for example) then you should really contact upstream - if there&#039;s no license, then technically you really shouldn&#039;t be distributing it until that&#039;s clarified with the original author(s).&lt;br /&gt;
&lt;br /&gt;
=== I am getting a package QA error / warning when building a recipe, how do I solve it? ===&lt;br /&gt;
&lt;br /&gt;
There are some general and specific recommendations in the [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#qa-errors-and-warnings QA Errors and Warnings] section of the Yocto Project Reference Manual.&lt;br /&gt;
&lt;br /&gt;
=== Building on a system with a GRSec kernel doesn&#039;t work well, is that supported? ===&lt;br /&gt;
&lt;br /&gt;
No, grsec isn&#039;t really supported. The list of distros that are supported (tested) is in the Yocto mega manual for each release.&lt;br /&gt;
You can refer to the work-around given in this defect: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10885&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is being built? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;bitbake -g &amp;amp;lt;recipe&amp;amp;gt;&amp;lt;/code&amp;gt; will produce some .dot files that allow you to see the dependency relationships - usually pn-depends.dot holds the answers although sometimes you may need to look at task-depends.dot if the dependency is only in the form of a task dependency. Note that these graphs are much too large for most graphviz visualisation tools to process, so you&#039;ll probably find it&#039;s easiest to view them with &amp;quot;less&amp;quot; or a text editor and search for the item you&#039;re looking for.&lt;br /&gt;
&lt;br /&gt;
=== How do I find out why something is in my image? ===&lt;br /&gt;
&lt;br /&gt;
Enable the buildhistory class and build the image again, and it will write out a depends.dot file containing the relationships between packages in the final image. If the package name isn&#039;t mentioned it is probably explicitly mentioned in IMAGE_INSTALL or being brought in via IMAGE_FEATURES.&lt;br /&gt;
&lt;br /&gt;
See [http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#maintaining-build-output-quality Maintaining Build Output Quality] in the Yocto Project Reference manual which covers how to enable buildhistory and the output it produces.&lt;br /&gt;
&lt;br /&gt;
=== How do I view the .dot files produced by bitbake -g or buildhistory? ===&lt;br /&gt;
&lt;br /&gt;
The size of some of these .dot graphs (particularly those produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt;) is a little large for most viewers / processing tools, and unfortunately this isn&#039;t something that can be fixed - it&#039;s just the nature of the dependency relationships between targets and tasks within OpenEmbedded. Usually if you&#039;re just after answering a simple dependency question you can figure it out by viewing it with &amp;lt;code&amp;gt;less&amp;lt;/code&amp;gt; and using its built-in search function (or alternatively your favourite text editor).&lt;br /&gt;
&lt;br /&gt;
You can try [http://github.com/jrfonseca/xdot.py xdot] which will work well for some of the graphs, but the task graph produced by &amp;lt;code&amp;gt;bitbake -g&amp;lt;/code&amp;gt; for something like an image in particular is likely to be too large to view within it.&lt;br /&gt;
&lt;br /&gt;
=== Why are all of these -native items being built when my host distro has some of these available? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s complicated. In some cases the software in question isn&#039;t widely packaged by common Linux distributions. In other cases we need to apply patches to the software, use a more up-to-date version than commonly packaged or build it with a particular configuration. In general it just helps us isolate ourselves from potential problems caused by differences in host Linux distributions. For the most part the time spent building the native tools that are definitely provided by the host distro are dwarfed by the time spent building things that definitely aren&#039;t provided, such as the C library for the target and the cross-compiling toolchain.&lt;br /&gt;
&lt;br /&gt;
=== I disabled runtime package management and yet it still seems to be building rpm/opkg, why? ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;package-management&amp;quot; being in IMAGE_FEATURES (possibly indirectly via EXTRA_IMAGE_FEATURES) controls whether the package manager is used at runtime i.e. whether it is present in the target image. However,  the build system always uses a package manager on the host to assemble images since it is usually the best tool for this job. This is completely independent of whether the package manager is in the target image though.&lt;br /&gt;
&lt;br /&gt;
=== Why is opkg-native / opkg-utils being built when I don&#039;t have ipk packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
opkg-utils provides update-alternatives which is the default tool used to manage the alternatives system (for selecting between multiple providers of the same file, e.g. busybox and bash both provide /bin/sh).&lt;br /&gt;
&lt;br /&gt;
=== Why is rpm-native being built when I don&#039;t have rpm packaging enabled? ===&lt;br /&gt;
&lt;br /&gt;
rpm-native is needed for two things in the generic packaging code implemented in the package class: &lt;br /&gt;
&lt;br /&gt;
# Debug symbol splitting - rpm-native provides the debugedit tool which this code uses&lt;br /&gt;
# Per-file dependencies - although this was originally just feeding into rpm when rpm was being used, it also now gets verified by QA checks regardless of which packaging backend is in use.&lt;br /&gt;
&lt;br /&gt;
=== I see a recipe built, but building an image containing the corresponding package fails at do_rootfs because it can&#039;t find the package. How does this happen? ===&lt;br /&gt;
&lt;br /&gt;
(For ipk, the error is &amp;quot;Couldn&#039;t find anything to satisfy &#039;&amp;lt;package&amp;gt;&#039;&amp;quot;; for rpm it is &amp;quot;&amp;lt;package&amp;gt; not found in the base feeds (&amp;lt;architecture list&amp;gt;)&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Usually this is because the recipe claimed to provide the specified package (via PACKAGES or PACKAGES_DYNAMIC) but it wasn&#039;t actually produced, possibly because it ended up empty (since by default empty packages aren&#039;t produced), but the image or some other package still has a dependency that pulls in the specified package. If this is a recipe you are writing yourself the probable cause is your recipe isn&#039;t installing any files and thus the main package for the recipe is empty. Fix do_install (or what do_install is already running, e.g. make install) such that files are installed into the correct location such that they can then subsequently be packaged, and then all should be well.&lt;br /&gt;
&lt;br /&gt;
In other situations the reference to the package in question is spurious and either it should be removed entirely or there&#039;s another package that should be used instead. For example, the avahi and dhcp recipes both have an empty main package since the client and server are split out into their own packages, and those are the ones you should be using instead (avahi-daemon, avahi-utils, dhcp-server, dhcp-client - there are other packages as well, please see [[#How_do_I_find_out_what_packages_are_produced_by_a_recipe.3F|How do I find out what packages are produced by a recipe?]].) You could argue that these recipes shouldn&#039;t claim to provide the main package, or they should have a main package that depends on all the other packages (as some other recipes do).&lt;br /&gt;
&lt;br /&gt;
=== X11 and various other items are being built but I&#039;m only building core-image-minimal - why? ===&lt;br /&gt;
&lt;br /&gt;
This is where it helps to understand the difference between build-time dependencies and runtime dependencies - often, a recipe will require things at build time (for example tools that help the build process, or to satisfy optional dependencies) that it doesn&#039;t necessarily need at runtime. The default configuration includes &amp;quot;x11&amp;quot; in DISTRO_FEATURES, and thus anything that can optionally support X11 will have its X11 support enabled; however when it comes to actually producing the image there won&#039;t be any X11 packages included. If you never intend to use X11 you can set your own DISTRO_FEATURES value that excludes x11 and then these items won&#039;t even be built.&lt;br /&gt;
&lt;br /&gt;
=== How do I avoid the kernel itself being pulled into my image when installing kernel modules? ===&lt;br /&gt;
&lt;br /&gt;
By default, the kernel class sets a dependency on the kernel-base package (which kernel modules always depend on) onto kernel-image, which contains the actual kernel binary. If you don&#039;t want this, set the following either in your kernel recipe or at the configuration level:&lt;br /&gt;
&lt;br /&gt;
 RDEPENDS_kernel-base = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== How do I remove a value from a list variable? ===&lt;br /&gt;
&lt;br /&gt;
For variables that are expected to contain a space-separated list of items, BitBake supports a _remove operator to remove items from it. See [http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#removing-override-style-syntax Removal (override style syntax)] in the BitBake user manual.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the _remove operation is final - you cannot undo it, thus you should really only make use of it in your distro / local configuration and not in layers that you expect others to re-use for different purposes (and therefore they may need to undo your changes). An alternative way to effectively remove an item is to set the list outright to include all the items minus the one you want to remove.&lt;br /&gt;
&lt;br /&gt;
=== How do I change how my recipe is built depending on what image I&#039;m building? ===&lt;br /&gt;
&lt;br /&gt;
The short answer is you cannot - the reason is that OpenEmbedded builds packages based on the overall configuration, and then the image only selects which of these packages should go into the final image. However, there are some solutions when you do want to do this:&lt;br /&gt;
&lt;br /&gt;
# Have separate packages for the two different versions. This could take the form of different recipes or you could do it within the same recipe. The two packages do have to have different names however; this may create problems if you have other packages that depend on the package.&lt;br /&gt;
# Use a postprocessing function within the image(s) - within the image recipe, define a shell or python function that makes the desired changes to the files in the image and add a call to it to ROOTFS_POSTPROCESS_COMMAND within the image recipe. Note that this may not be appropriate if you have runtime package management enabled since the postprocessing will only happen at image creation time and not if the package is installed later on at runtime - you may need to use a postinstall script instead in this case.&lt;br /&gt;
# Use a postinstall script (pkg_postinst_&amp;lt;package&amp;gt; function) within the recipe. In order to work, the postinstall script will need to be able to determine what to do when it&#039;s run - this may not be practical depending on what you&#039;re trying to achieve.&lt;br /&gt;
&lt;br /&gt;
=== Can I use a toolchain built by OE as the external toolchain? ===&lt;br /&gt;
&lt;br /&gt;
In general, this is not recommended and not something that is tested or directly supported out of the box. If you are wanting to do this solely as a means of speeding up the build, it is strongly suggested that you use shared state instead.&lt;br /&gt;
&lt;br /&gt;
There is a [http://layers.openembedded.org/layerindex/branch/master/layer/meta-sourcery/ meta-sourcery layer] available to enable support for the CodeSourcery toolchain, you may be able to use this as a template for bringing in an external toolchain however there are no guarantees.&lt;br /&gt;
&lt;br /&gt;
=== When I run bitbake -c devshell it looks like it&#039;s running as root! How is that possible? ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s not running as the actual root user, it&#039;s just pretending for the benefit of programs that run under it (including bash) that it is, via pseudo. This is important, because you normally want any owner/group/permission values that you set on files to be reflected in files that the recipe installs and packages and thus reflected in the final image - without this mechanism the actual build would have to run as root which would be very risky. There are no actual elevated privileges through this mechanism however, so you need not be worried.&lt;br /&gt;
&lt;br /&gt;
=== Why do you use pseudo? Why not use fakeroot / fakechroot instead? ===&lt;br /&gt;
&lt;br /&gt;
Splitting this up into two questions - we use pseudo (not to be confused with sudo!) because we want to be able to create images containing files have the correct permissions and ownership, e.g. files owned by root, without the user running the build system having to have that privilege. By using LD_PRELOAD to intercept function calls, pseudo creates an environment for programs running underneath it where it appears as if the running user has those privileges (and the results of them persist within the pseudo environment, i.e. you can write a file as root and it will appear to be owned by root while still running under pseudo). This allows us to run builds entirely as a normal user without needing extra privileges. Without pseudo we would require running the build system under sudo or as root - which would be ill-advised for things such as &amp;quot;make install&amp;quot; in case it happened to be broken and tried to write to / instead of somewhere under the work directory for the recipe; a broken recipe could easily end up destroying your system in that case.&lt;br /&gt;
&lt;br /&gt;
To answer the second part, why we use pseudo instead of fakeroot / fakechroot, see [https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot WhyNotFakeroot on the pseudo wiki].&lt;br /&gt;
&lt;br /&gt;
=== How do I find out what packages are produced by a recipe? ===&lt;br /&gt;
&lt;br /&gt;
The Toaster web UI provides easy ways to query this.&lt;br /&gt;
&lt;br /&gt;
In the 1.8 (fido) release and newer you can use the following command, assuming the recipe has already been built:&lt;br /&gt;
&lt;br /&gt;
 oe-pkgdata-util list-pkgs -p recipename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can look in the &amp;quot;packages-split&amp;quot; subdirectory under the work directory for the recipe - each package produced by the recipe will have a subdirectory under that. If you&#039;re not sure how to find the work directory you can run the following command:&lt;br /&gt;
&lt;br /&gt;
 bitbake -e recipename | grep ^WORKDIR=&lt;br /&gt;
&lt;br /&gt;
Before a recipe gets built it is a bit trickier, since the system often doesn&#039;t know exactly which packages will be produced until do_package time; this is particularly true for recipes that package plugins or modules (e.g. kernel modules). You can get a reasonable idea though by looking at the value of PACKAGES (and PACKAGES_DYNAMIC for recipes that produce plugins).&lt;br /&gt;
&lt;br /&gt;
=== How do I find out which package contains a particular file (or python module)? ===&lt;br /&gt;
&lt;br /&gt;
oe-pkgdata-util has a find-path subcommand that will tell you exactly this. For example:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path /etc/network/interfaces&lt;br /&gt;
 init-ifupdown: /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Wildcards are allowed anywhere in the path (but you should enclose such expressions in quotes to avoid the shell itself attempting to expand the wildcard):&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/fstrim&amp;quot;&lt;br /&gt;
 util-linux-bash-completion: /usr/share/bash-completion/completions/fstrim&lt;br /&gt;
 util-linux-ptest: /usr/lib/util-linux/ptest/fstrim&lt;br /&gt;
 util-linux-dbg: /sbin/.debug/fstrim&lt;br /&gt;
 util-linux-fstrim: /sbin/fstrim&lt;br /&gt;
&lt;br /&gt;
Our Python packaging is a bit more granular than most typical distributions, allowing you to tune the contents of your image to just what you need. However that does mean you may have trouble figuring out which package provides a particular module. oe-pkgdata-util find-path can also be used for this. For example, to find the package containing the &amp;quot;shutil&amp;quot; module, run this:&lt;br /&gt;
&lt;br /&gt;
 $ oe-pkgdata-util find-path &amp;quot;*/shutil.*&amp;quot;&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/shutil.py&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-2.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.opt-1.pyc&lt;br /&gt;
 python3-shell: /usr/lib/python3.5/__pycache__/shutil.cpython-35.pyc&lt;br /&gt;
&lt;br /&gt;
Thus the package you are looking for is python3-shell. (Note that you could use */shutil.py, but if the module you are looking for is written in C as some of them are, that won&#039;t match it.)&lt;br /&gt;
&lt;br /&gt;
=== I have a local source tree I want to build instead of the upstream source a recipe normally fetches, how do I do that? ===&lt;br /&gt;
&lt;br /&gt;
If it&#039;s for development purposes i.e. you have your own local source tree you want to work on and have built, then run:&lt;br /&gt;
&lt;br /&gt;
 devtool modify -n &amp;lt;recipename&amp;gt; path/to/sourcetree/&lt;br /&gt;
&lt;br /&gt;
Once you are done you can use &amp;lt;code&amp;gt;devtool reset&amp;lt;/code&amp;gt; to return to building the source specified in the recipe.&lt;br /&gt;
&lt;br /&gt;
Alternatively if it&#039;s more permanent, use the &amp;lt;code&amp;gt;externalsrc&amp;lt;/code&amp;gt; class - you can inherit this in the original recipe or a bbappend:&lt;br /&gt;
&lt;br /&gt;
 inherit externalsrc&lt;br /&gt;
 EXTERNALSRC = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re going to use it across a number of recipes you can inherit it globally at the configuration level (perhaps via an inc file that you include/require there):&lt;br /&gt;
&lt;br /&gt;
 INHERIT += &amp;quot;externalsrc&amp;quot;&lt;br /&gt;
 EXTERNALSRC_pn-&amp;lt;recipename&amp;gt; = &amp;quot;/path/to/sources&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I specify the default shell? (e.g. bash instead of busybox) ===&lt;br /&gt;
&lt;br /&gt;
It depends what you mean. As far as which provides /bin/sh, this is controlled through the alternatives system, and by default bash has a higher priority than busybox, so simply installing bash into your image will automatically have /bin/sh link to bash rather than busybox.&lt;br /&gt;
&lt;br /&gt;
If you mean you want a user&#039;s login shell to be a specific shell, you&#039;ll need to modify /etc/passwd. One fairly easy way to achieve this is to use the extrausers class in your image recipe:&lt;br /&gt;
&lt;br /&gt;
 inherit extrausers&lt;br /&gt;
 EXTRA_USERS_PARAMS = &amp;quot;usermod -s /bin/bash &amp;lt;username&amp;gt;; &amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== How do I get &amp;quot;full&amp;quot; versions of typical shell commands? ===&lt;br /&gt;
&lt;br /&gt;
Most of the shell commands in our images are provided by busybox by default, and are very much simplified compared to what you would have on a typical Linux system in order to save space. If you need the full versions, most of them are built and packaged by the coreutils recipe (for disk and other typical utilities) and procps (for ps, etc). You may also want to install bash for more typical shell built-in commands. There is also a core-image-full-cmdline image if you want a base image that is already set up to provide a more typical Linux command-line experience. (Note: these will of course use up more disk space and memory.)&lt;br /&gt;
&lt;br /&gt;
=== How do I allow a variable&#039;s value through from the external environment? ===&lt;br /&gt;
&lt;br /&gt;
Add the variable&#039;s name to the BB_ENV_EXTRAWHITE &#039;&#039;in the external environment&#039;&#039; before running bitbake. Note that the oe-init-build-env script sets a default for this which you will want to preserve, so add to the default value rather than overwriting it.&lt;br /&gt;
&lt;br /&gt;
Alternatively if you just want to get the external value of a variable from python code within the metadata, you can use the BB_ORIGENV variable which itself contains a datastore of the original environment. For example to get the value of the DISPLAY variable from the environment within a python function you would do this:&lt;br /&gt;
&lt;br /&gt;
 display = d.getVar(&amp;quot;BB_ORIGENV&amp;quot;, False).getVar(&amp;quot;DISPLAY&amp;quot;, True)&lt;br /&gt;
&lt;br /&gt;
Note that you must specify &amp;quot;false&amp;quot; for the expand parameter when getting the BB_ORIGENV variable, because it&#039;s not a string and therefore cannot be expanded in the normal manner.&lt;br /&gt;
&lt;br /&gt;
=== Why is bitbake showing &amp;quot;AUTOINC&amp;quot; in the version for some recipes? ===&lt;br /&gt;
&lt;br /&gt;
Recipes where you see AUTOINC within the version will be those that set PV to include &amp;quot;${SRCPV}&amp;quot; to get the SCM revision (e.g. the git hash) in the package version. In order to have the version increment properly there needs to be a number in front of the revision which automatically increments each time the revision changes (assuming you have a PR server enabled), which is where AUTOINC comes in. During the build, AUTOINC is a stand-in for this auto-incrementing number, and later during do_package it gets replaced with the real number so that the packages produced at the end have the full version number.&lt;br /&gt;
&lt;br /&gt;
=== Why are .so files in the -dev package instead of the main package for a recipe? ===&lt;br /&gt;
&lt;br /&gt;
In standard Unix library packaging, non-versioned .so symlinks (e.g. /usr/lib/libgd.so) are intended for development purposes only. At runtime, binaries should be linked to the major-versioned .so file/symlink e.g. /usr/lib/libgd.so.3. This (theoretically) allows multiple major versions of the same library as well as binaries that depend upon each of them to coexist on the same system. If the library is versioned but you have a binary that links to the unversioned .so file, it has almost certainly been linked incorrectly.&lt;br /&gt;
&lt;br /&gt;
Non-symlink .so files on the other hand are sometimes produced and are entirely legal - however these will be picked up in the -dev package in OpenEmbedded simply by virtue of their name, which is almost always not what you want. In this case you can do one of two things:&lt;br /&gt;
&lt;br /&gt;
# Fix the build of the library so it gets versioned. This may not always be appropriate, especially not for things like plugins.&lt;br /&gt;
# Set FILES_${PN}-dev within the recipe so that it does not include ${FILES_SOLIBSDEV}. If the software the recipe is building also produces symlink .so files you&#039;ll need to set FILES_${PN}-dev such that those do still get packaged in the -dev package though, or you&#039;ll get a package QA warning.&lt;br /&gt;
&lt;br /&gt;
=== Can I disable shared state? ===&lt;br /&gt;
&lt;br /&gt;
You cannot, no. Shared state is an intrinsic part of staging files into the sysroot. It is possible to construct a recipe that bypasses sstate for some tasks (the kernel does this), however this is quite difficult and if not done properly will lead to many other problems.&lt;br /&gt;
&lt;br /&gt;
Almost always when you are having a problem with shared state the issue is either (a) you&#039;re adding/changing files in the sysroot directly (i.e. outside sstate control), or (b) what is being placed into the sysroot isn&#039;t relocatable. The solution for (a) is do not do that - files should always be installed within do_install and then a subset of those are staged into the sysroot automatically. For (b) you need to fix or adapt the hardcoded path(s) - if the program reads (or can be made to read) each path from an environment variable, then you can use the create_wrapper utility function to create a wrapper script that will set the path appropriately. Run &amp;quot;git grep create_wrapper&amp;quot; in the meta subdirectory to see examples.&lt;br /&gt;
&lt;br /&gt;
=== Files I installed into /opt or some other path never make it into the sysroot but I need them - how do I fix this? ===&lt;br /&gt;
&lt;br /&gt;
OpenEmbedded only stages a subset of files that are installed into &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt; by &amp;lt;code&amp;gt;do_install&amp;lt;/code&amp;gt; so that the sysroot doesn&#039;t fill up with unneeded files. You have two choices in this situation:&lt;br /&gt;
# install the files into a more standard location which is part of the subset, or &lt;br /&gt;
# adjust the subset to include the paths you are installing to.&lt;br /&gt;
Usually option 1 is recommended. If you really do need to adjust the subset, you can append the path (more specifically, the part below &amp;lt;code&amp;gt;${D}&amp;lt;/code&amp;gt;) to &amp;lt;code&amp;gt;SYSROOT_DIRS&amp;lt;/code&amp;gt; within your recipe. For example:&lt;br /&gt;
&lt;br /&gt;
 SYSROOT_DIRS += &amp;quot;/opt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== I have some software which needs to build a binary that it then runs as part of its own build process, how do I make this work? ===&lt;br /&gt;
&lt;br /&gt;
Whilst it is possible to do this within a single recipe building for the target, it is tricky to do so because in that context everything is set up for cross-compiling for the target, and you would have to undo all of that to build host tools. The standard and much easier way of handling this is to create a native variant of the recipe using BBCLASSEXTEND and have your host tools built within that, and then have the target variant depend on the native variant. For example, assume your recipe were called xyz (xyz_1.1.bb), then you would include something like this in the recipe:&lt;br /&gt;
&lt;br /&gt;
 DEPENDS_append_class-target = &amp;quot; xyz-native&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 BBCLASSEXTEND += &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The host tools will then be built and installed into the sysroot in the native variant ready for when the target variant starts building. If the software you are building didn&#039;t intend for those tools to be installed outside of the build tree then you may need to patch the build process (e.g. the makefile) in order to install them and possibly also for the target side to find them in the sysroot. Additionally, for performance since you only need the tools in the native variant, you may also choose to disable building everything except those tools there - e.g. by using _native overrides for variables such as EXTRA_OECONF or functions such as do_configure.&lt;br /&gt;
&lt;br /&gt;
=== How do I fetch from two git repositories in the same recipe? ===&lt;br /&gt;
&lt;br /&gt;
By default, sources fetched from git within a recipe are unpacked into ${WORKDIR}/git, however that only works for a single repository. If you want to fetch from more than one, you need to change the path each repository is unpacked to. This is easy to do, just add &amp;lt;code&amp;gt;;destsuffix=&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; to the end of each URL in SRC_URI (replacing &amp;lt;code&amp;gt;&amp;amp;lt;subdir&amp;amp;gt;&amp;lt;/code&amp;gt; with the name of the subdirectory). You may then need to change S to match whichever of these you want to be considered the root of the source tree - or alternatively you can specify destsuffix such that repositories beyond the first go into a subdirectory under the default &amp;quot;git&amp;quot; subdirectory. For example, from the gst-libav recipe:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 SRC_URI = &amp;quot; \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/gst-libav;branch=1.8;name=base \&lt;br /&gt;
     git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;name=common \&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
 S = &amp;quot;${WORKDIR}/git&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
(Here we&#039;re using the default of &amp;quot;git&amp;quot; for the first repository, so we don&#039;t need to specify &amp;lt;code&amp;gt;destsuffix&amp;lt;/code&amp;gt; for the first URL.)&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m building a native recipe and I notice that the install path has the full path to the root directory repeated - why? ===&lt;br /&gt;
&lt;br /&gt;
It does look a little odd, but the reason for doing this is that native targets are meant to run on the system they&#039;re built on and run in the location they&#039;re installed to. This means they install to a destination of &amp;quot;/&amp;quot; and PREFIX is inside the native sysroot directory. We install them to a DESTDIR to allow us to manipulate them before they then get moved to a final DESTDIR of &amp;quot;/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Most Makefiles handle this correctly by doing:&lt;br /&gt;
&lt;br /&gt;
 DESTDIR ?= &amp;quot;&amp;quot;&lt;br /&gt;
 prefix ?= &amp;quot;/usr&amp;quot;&lt;br /&gt;
 bindir ?= &amp;quot;$(prefix)/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and then, importantly, install in the form:&lt;br /&gt;
&lt;br /&gt;
 install -d $(DESTDIR)$(bindir)&lt;br /&gt;
&lt;br /&gt;
so both prefix and DESTDIR are used. Whilst this is a convention, its a widely adopted and followed one. You can call into a custom makefile and set the variables manually if the makefile doesn&#039;t follow the convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How do I generate static libraries? ===&lt;br /&gt;
&lt;br /&gt;
Its possible you have conf/distro/include/no-static-libs.inc included in your build - poky does this by default. The include list at the top of the bitbake -e output will tell you for certain.&lt;br /&gt;
&lt;br /&gt;
If so, you can remove that or set:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
as it would currently be set to this if that include file is included:&lt;br /&gt;
&lt;br /&gt;
 DISABLE_STATIC = &amp;quot; --disable-static&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Poky disables building static libraries by default as for the most part they&#039;re a waste of space/time.&lt;br /&gt;
&lt;br /&gt;
=== Can I conditionally inherit a class in a recipe? ===&lt;br /&gt;
&lt;br /&gt;
Yes, you can. What makes this possible is that the &amp;lt;code&amp;gt;inherit&amp;lt;/code&amp;gt; keyword will not complain if what comes after it expands to being empty, so you can use in-line python to do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
inherit ${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will inherit the &amp;lt;code&amp;gt;perlnative&amp;lt;/code&amp;gt; class if &amp;quot;scripting&amp;quot; is in the value of the &amp;lt;code&amp;gt;PACKAGECONFIG&amp;lt;/code&amp;gt; variable, otherwise it will do nothing.&lt;br /&gt;
&lt;br /&gt;
You could of course put this into a variable if you prefer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SOMEVAR = &amp;quot;${@bb.utils.contains(&#039;PACKAGECONFIG&#039;, &#039;scripting&#039;, &#039;perlnative&#039;, &#039;&#039;, d)}&amp;quot;&lt;br /&gt;
inherit ${SOMEVAR}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>PaulEggleton</name></author>
	</entry>
</feed>