diff options
Diffstat (limited to 'documentation/ref-manual/faq.rst')
-rw-r--r-- | documentation/ref-manual/faq.rst | 612 |
1 files changed, 314 insertions, 298 deletions
diff --git a/documentation/ref-manual/faq.rst b/documentation/ref-manual/faq.rst index 84affddd1e..a570c40e7d 100644 --- a/documentation/ref-manual/faq.rst +++ b/documentation/ref-manual/faq.rst | |||
@@ -4,9 +4,15 @@ | |||
4 | FAQ | 4 | FAQ |
5 | *** | 5 | *** |
6 | 6 | ||
7 | **Q:** How does Poky differ from :oe_home:`OpenEmbedded <>`? | 7 | .. contents:: |
8 | 8 | ||
9 | **A:** The term ``Poky`` refers to the specific reference build | 9 | General questions |
10 | ================= | ||
11 | |||
12 | How does Poky differ from OpenEmbedded? | ||
13 | --------------------------------------- | ||
14 | |||
15 | The term ``Poky`` refers to the specific reference build | ||
10 | system that the Yocto Project provides. Poky is based on | 16 | system that the Yocto Project provides. Poky is based on |
11 | :term:`OpenEmbedded-Core (OE-Core)` and :term:`BitBake`. Thus, the | 17 | :term:`OpenEmbedded-Core (OE-Core)` and :term:`BitBake`. Thus, the |
12 | generic term used here for the build system is the "OpenEmbedded build | 18 | generic term used here for the build system is the "OpenEmbedded build |
@@ -15,19 +21,10 @@ OpenEmbedded, with changes always being merged to OE-Core or BitBake | |||
15 | first before being pulled back into Poky. This practice benefits both | 21 | first before being pulled back into Poky. This practice benefits both |
16 | projects immediately. | 22 | projects immediately. |
17 | 23 | ||
18 | **Q:** My development system does not meet the required Git, tar, and | 24 | How can you claim Poky / OpenEmbedded-Core is stable? |
19 | Python versions. In particular, I do not have Python &MIN_PYTHON_VERSION; or greater. | 25 | ----------------------------------------------------- |
20 | Can I still use the Yocto Project? | ||
21 | |||
22 | **A:** You can get the required tools on your host development system a | ||
23 | couple different ways (i.e. building a tarball or downloading a | ||
24 | tarball). See the | ||
25 | ":ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`" | ||
26 | section for steps on how to update your build tools. | ||
27 | |||
28 | **Q:** How can you claim Poky / OpenEmbedded-Core is stable? | ||
29 | 26 | ||
30 | **A:** There are three areas that help with stability; | 27 | There are three areas that help with stability; |
31 | 28 | ||
32 | - The Yocto Project team keeps :term:`OpenEmbedded-Core (OE-Core)` small and | 29 | - The Yocto Project team keeps :term:`OpenEmbedded-Core (OE-Core)` small and |
33 | focused, containing around 830 recipes as opposed to the thousands | 30 | focused, containing around 830 recipes as opposed to the thousands |
@@ -37,250 +34,33 @@ section for steps on how to update your build tools. | |||
37 | - The Yocto Project team runs manual and automated tests using a small, | 34 | - The Yocto Project team runs manual and automated tests using a small, |
38 | fixed set of reference hardware as well as emulated targets. | 35 | fixed set of reference hardware as well as emulated targets. |
39 | 36 | ||
40 | - The Yocto Project uses an autobuilder, which provides continuous | 37 | - The Yocto Project uses an :yocto_ab:`autobuilder <>`, which provides |
41 | build and integration tests. | 38 | continuous build and integration tests. |
42 | |||
43 | **Q:** How do I get support for my board added to the Yocto Project? | ||
44 | |||
45 | **A:** Support for an additional board is added by creating a Board | ||
46 | Support Package (BSP) layer for it. For more information on how to | ||
47 | create a BSP layer, see the | ||
48 | ":ref:`dev-manual/common-tasks:understanding and creating layers`" | ||
49 | section in the Yocto Project Development Tasks Manual and the | ||
50 | :doc:`/bsp-guide/index`. | ||
51 | |||
52 | Usually, if the board is not completely exotic, adding support in the | ||
53 | Yocto Project is fairly straightforward. | ||
54 | 39 | ||
55 | **Q:** Are there any products built using the OpenEmbedded build system? | 40 | Are there any products built using the OpenEmbedded build system? |
41 | ----------------------------------------------------------------- | ||
56 | 42 | ||
57 | **A:** See :yocto_wiki:`Products that use the Yocto Project | 43 | See :yocto_wiki:`Products that use the Yocto Project |
58 | </Project_Users#Products_that_use_the_Yocto_Project>` in the Yocto Project | 44 | </Project_Users#Products_that_use_the_Yocto_Project>` in the Yocto Project |
59 | Wiki. Don't hesitate to contribute to this page if you know other such | 45 | Wiki. Don't hesitate to contribute to this page if you know other such |
60 | products. | 46 | products. |
61 | 47 | ||
62 | **Q:** What does the OpenEmbedded build system produce as output? | 48 | Building environment |
63 | 49 | ==================== | |
64 | **A:** Because you can use the same set of recipes to create output of | ||
65 | various formats, the output of an OpenEmbedded build depends on how you | ||
66 | start it. Usually, the output is a flashable image ready for the target | ||
67 | device. | ||
68 | |||
69 | **Q:** How do I add my package to the Yocto Project? | ||
70 | |||
71 | **A:** To add a package, you need to create a BitBake recipe. For | ||
72 | information on how to create a BitBake recipe, see the | ||
73 | ":ref:`dev-manual/common-tasks:writing a new recipe`" | ||
74 | section in the Yocto Project Development Tasks Manual. | ||
75 | |||
76 | **Q:** Do I have to reflash my entire board with a new Yocto Project | ||
77 | image when recompiling a package? | ||
78 | |||
79 | **A:** The OpenEmbedded build system can build packages in various | ||
80 | formats such as IPK for OPKG, Debian package (``.deb``), or RPM. You can | ||
81 | then upgrade the packages using the package tools on the device, much | ||
82 | like on a desktop distribution such as Ubuntu or Fedora. However, | ||
83 | package management on the target is entirely optional. | ||
84 | |||
85 | **Q:** I see the error | ||
86 | '``chmod: XXXXX new permissions are r-xrwxrwx, not r-xr-xr-x``'. What is | ||
87 | wrong? | ||
88 | |||
89 | **A:** You are probably running the build on an NTFS filesystem. Use | ||
90 | ``ext2``, ``ext3``, or ``ext4`` instead. | ||
91 | |||
92 | **Q:** I see lots of 404 responses for files when the OpenEmbedded build | ||
93 | system is trying to download sources. Is something wrong? | ||
94 | |||
95 | **A:** Nothing is wrong. The OpenEmbedded build system checks any | ||
96 | configured source mirrors before downloading from the upstream sources. | ||
97 | The build system does this searching for both source archives and | ||
98 | pre-checked out versions of SCM-managed software. These checks help in | ||
99 | large installations because it can reduce load on the SCM servers | ||
100 | themselves. The address above is one of the default mirrors configured | ||
101 | into the build system. Consequently, if an upstream source disappears, | ||
102 | the team can place sources there so builds continue to work. | ||
103 | |||
104 | **Q:** I have machine-specific data in a package for one machine only | ||
105 | but the package is being marked as machine-specific in all cases, how do | ||
106 | I prevent this? | ||
107 | |||
108 | **A:** Set :term:`SRC_URI_OVERRIDES_PACKAGE_ARCH` = "0" in the ``.bb`` file | ||
109 | but make sure the package is manually marked as machine-specific for the | ||
110 | case that needs it. The code that handles | ||
111 | :term:`SRC_URI_OVERRIDES_PACKAGE_ARCH` is in the | ||
112 | ``meta/classes-global/base.bbclass`` file. | ||
113 | |||
114 | **Q:** I'm behind a firewall and need to use a proxy server. How do I do | ||
115 | that? | ||
116 | |||
117 | **A:** Most source fetching by the OpenEmbedded build system is done by | ||
118 | ``wget`` and you therefore need to specify the proxy settings in a | ||
119 | ``.wgetrc`` file, which can be in your home directory if you are a | ||
120 | single user or can be in ``/usr/local/etc/wgetrc`` as a global user | ||
121 | file. | ||
122 | |||
123 | Following is the applicable code for setting various proxy types in the | ||
124 | ``.wgetrc`` file. By default, these settings are disabled with comments. | ||
125 | To use them, remove the comments:: | ||
126 | |||
127 | # You can set the default proxies for Wget to use for http, https, and ftp. | ||
128 | # They will override the value in the environment. | ||
129 | #https_proxy = http://proxy.yoyodyne.com:18023/ | ||
130 | #http_proxy = http://proxy.yoyodyne.com:18023/ | ||
131 | #ftp_proxy = http://proxy.yoyodyne.com:18023/ | ||
132 | |||
133 | # If you do not want to use proxy at all, set this to off. | ||
134 | #use_proxy = on | ||
135 | |||
136 | The Yocto Project also includes a | ||
137 | ``meta-poky/conf/templates/default/site.conf.sample`` file that shows | ||
138 | how to configure CVS and Git proxy servers if needed. For more | ||
139 | information on setting up various proxy types and configuring proxy | ||
140 | servers, see the | ||
141 | ":yocto_wiki:`Working Behind a Network Proxy </Working_Behind_a_Network_Proxy>`" | ||
142 | Wiki page. | ||
143 | |||
144 | **Q:** What's the difference between ``target`` and ``target-native``? | ||
145 | |||
146 | **A:** The ``*-native`` targets are designed to run on the system being | ||
147 | used for the build. These are usually tools that are needed to assist | ||
148 | the build in some way such as ``quilt-native``, which is used to apply | ||
149 | patches. The non-native version is the one that runs on the target | ||
150 | device. | ||
151 | |||
152 | **Q:** I'm seeing random build failures. Help?! | ||
153 | |||
154 | **A:** If the same build is failing in totally different and random | ||
155 | ways, the most likely explanation is: | ||
156 | |||
157 | - The hardware you are running the build on has some problem. | ||
158 | |||
159 | - You are running the build under virtualization, in which case the | ||
160 | virtualization probably has bugs. | ||
161 | |||
162 | The OpenEmbedded build system processes a massive amount of data that | ||
163 | causes lots of network, disk and CPU activity and is sensitive to even | ||
164 | single-bit failures in any of these areas. True random failures have | ||
165 | always been traced back to hardware or virtualization issues. | ||
166 | |||
167 | **Q:** When I try to build a native recipe, the build fails with | ||
168 | ``iconv.h`` problems. | ||
169 | |||
170 | **A:** If you get an error message that indicates GNU ``libiconv`` is | ||
171 | not in use but ``iconv.h`` has been included from ``libiconv``, you need | ||
172 | to check to see if you have a previously installed version of the header | ||
173 | file in ``/usr/local/include``. | ||
174 | :: | ||
175 | |||
176 | #error GNU libiconv not in use but included iconv.h is from libiconv | ||
177 | |||
178 | If you find a previously installed | ||
179 | file, you should either uninstall it or temporarily rename it and try | ||
180 | the build again. | ||
181 | |||
182 | This issue is just a single manifestation of "system leakage" issues | ||
183 | caused when the OpenEmbedded build system finds and uses previously | ||
184 | installed files during a native build. This type of issue might not be | ||
185 | limited to ``iconv.h``. Be sure that leakage cannot occur from | ||
186 | ``/usr/local/include`` and ``/opt`` locations. | ||
187 | |||
188 | **Q:** What do we need to ship for license compliance? | ||
189 | |||
190 | **A:** This is a difficult question and you need to consult your lawyer | ||
191 | for the answer for your specific case. It is worth bearing in mind that | ||
192 | for GPL compliance, there needs to be enough information shipped to | ||
193 | allow someone else to rebuild and produce the same end result you are | ||
194 | shipping. This means sharing the source code, any patches applied to it, | ||
195 | and also any configuration information about how that package was | ||
196 | configured and built. | ||
197 | |||
198 | You can find more information on licensing in the | ||
199 | ":ref:`overview-manual/development-environment:licensing`" | ||
200 | section in the Yocto | ||
201 | Project Overview and Concepts Manual and also in the | ||
202 | ":ref:`dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle`" | ||
203 | section in the Yocto Project Development Tasks Manual. | ||
204 | |||
205 | **Q:** How do I disable the cursor on my touchscreen device? | ||
206 | |||
207 | **A:** You need to create a form factor file as described in the | ||
208 | ":ref:`bsp-guide/bsp:miscellaneous bsp-specific recipe files`" section in | ||
209 | the Yocto Project Board Support Packages (BSP) Developer's Guide. Set | ||
210 | the ``HAVE_TOUCHSCREEN`` variable equal to one as follows:: | ||
211 | |||
212 | HAVE_TOUCHSCREEN=1 | ||
213 | |||
214 | **Q:** How do I make sure connected network interfaces are brought up by | ||
215 | default? | ||
216 | |||
217 | **A:** The default interfaces file provided by the netbase recipe does | ||
218 | not automatically bring up network interfaces. Therefore, you will need | ||
219 | to add a BSP-specific netbase that includes an interfaces file. See the | ||
220 | ":ref:`bsp-guide/bsp:miscellaneous bsp-specific recipe files`" section in | ||
221 | the Yocto Project Board Support Packages (BSP) Developer's Guide for | ||
222 | information on creating these types of miscellaneous recipe files. | ||
223 | |||
224 | For example, add the following files to your layer:: | ||
225 | |||
226 | meta-MACHINE/recipes-bsp/netbase/netbase/MACHINE/interfaces | ||
227 | meta-MACHINE/recipes-bsp/netbase/netbase_5.0.bbappend | ||
228 | |||
229 | **Q:** How do I create images with more free space? | ||
230 | |||
231 | **A:** By default, the OpenEmbedded build system creates images that are | ||
232 | 1.3 times the size of the populated root filesystem. To affect the image | ||
233 | size, you need to set various configurations: | ||
234 | |||
235 | - *Image Size:* The OpenEmbedded build system uses the | ||
236 | :term:`IMAGE_ROOTFS_SIZE` variable to define | ||
237 | the size of the image in Kbytes. The build system determines the size | ||
238 | by taking into account the initial root filesystem size before any | ||
239 | modifications such as requested size for the image and any requested | ||
240 | additional free disk space to be added to the image. | ||
241 | |||
242 | - *Overhead:* Use the | ||
243 | :term:`IMAGE_OVERHEAD_FACTOR` variable | ||
244 | to define the multiplier that the build system applies to the initial | ||
245 | image size, which is 1.3 by default. | ||
246 | |||
247 | - *Additional Free Space:* Use the | ||
248 | :term:`IMAGE_ROOTFS_EXTRA_SPACE` | ||
249 | variable to add additional free space to the image. The build system | ||
250 | adds this space to the image after it determines its | ||
251 | :term:`IMAGE_ROOTFS_SIZE`. | ||
252 | |||
253 | **Q:** Why don't you support directories with spaces in the pathnames? | ||
254 | 50 | ||
255 | **A:** The Yocto Project team has tried to do this before but too many | 51 | Missing dependencies on the development system? |
256 | of the tools the OpenEmbedded build system depends on, such as | 52 | ----------------------------------------------- |
257 | ``autoconf``, break when they find spaces in pathnames. Until that | ||
258 | situation changes, the team will not support spaces in pathnames. | ||
259 | |||
260 | **Q:** How do I use an external toolchain? | ||
261 | 53 | ||
262 | **A:** The toolchain configuration is very flexible and customizable. It | 54 | If your development system does not meet the required Git, tar, and |
263 | is primarily controlled with the :term:`TCMODE` variable. This variable | 55 | Python versions, you can get the required tools on your host development |
264 | controls which ``tcmode-*.inc`` file to include from the | 56 | system in different ways (i.e. building a tarball or downloading a |
265 | ``meta/conf/distro/include`` directory within the :term:`Source Directory`. | 57 | tarball). See the ":ref:`ref-manual/system-requirements:required git, tar, python, make and gcc versions`" |
266 | 58 | section for steps on how to update your build tools. | |
267 | The default value of :term:`TCMODE` is "default", which tells the | ||
268 | OpenEmbedded build system to use its internally built toolchain (i.e. | ||
269 | ``tcmode-default.inc``). However, other patterns are accepted. In | ||
270 | particular, "external-\*" refers to external toolchains. One example is | ||
271 | the Sourcery G++ Toolchain. The support for this toolchain resides in | ||
272 | the separate ``meta-sourcery`` layer at | ||
273 | https://github.com/MentorEmbedded/meta-sourcery/. | ||
274 | |||
275 | In addition to the toolchain configuration, you also need a | ||
276 | corresponding toolchain recipe file. This recipe file needs to package | ||
277 | up any pre-built objects in the toolchain such as ``libgcc``, | ||
278 | ``libstdcc++``, any locales, and ``libc``. | ||
279 | 59 | ||
280 | **Q:** How does the OpenEmbedded build system obtain source code and | 60 | How does OpenEmbedded fetch source code? Will it work through a firewall or proxy server? |
281 | will it work behind my firewall or proxy server? | 61 | ----------------------------------------------------------------------------------------- |
282 | 62 | ||
283 | **A:** The way the build system obtains source code is highly | 63 | The way the build system obtains source code is highly |
284 | configurable. You can setup the build system to get source code in most | 64 | configurable. You can setup the build system to get source code in most |
285 | environments if HTTP transport is available. | 65 | environments if HTTP transport is available. |
286 | 66 | ||
@@ -322,16 +102,15 @@ Here is another technique:: | |||
322 | 102 | ||
323 | BB_FETCH_PREMIRRORONLY = "1" | 103 | BB_FETCH_PREMIRRORONLY = "1" |
324 | 104 | ||
325 | This statement | 105 | This statement limits the build system to pulling source from the |
326 | limits the build system to pulling source from the :term:`PREMIRRORS` only. | 106 | :term:`PREMIRRORS` only. Again, this technique is useful for reproducing |
327 | Again, this technique is useful for reproducing builds. | 107 | builds. |
328 | 108 | ||
329 | Here is another technique:: | 109 | Here is another technique:: |
330 | 110 | ||
331 | BB_GENERATE_MIRROR_TARBALLS = "1" | 111 | BB_GENERATE_MIRROR_TARBALLS = "1" |
332 | 112 | ||
333 | This | 113 | This statement tells the build system to generate mirror tarballs. This |
334 | statement tells the build system to generate mirror tarballs. This | ||
335 | technique is useful if you want to create a mirror server. If not, | 114 | technique is useful if you want to create a mirror server. If not, |
336 | however, the technique can simply waste time during the build. | 115 | however, the technique can simply waste time during the build. |
337 | 116 | ||
@@ -350,9 +129,32 @@ These changes would cause the build system to successfully fetch source | |||
350 | over HTTP and any network accesses to anything other than the | 129 | over HTTP and any network accesses to anything other than the |
351 | :term:`PREMIRRORS` would fail. | 130 | :term:`PREMIRRORS` would fail. |
352 | 131 | ||
353 | The build system also honors the standard shell environment variables | 132 | Most source fetching by the OpenEmbedded build system is done by |
354 | ``http_proxy``, ``ftp_proxy``, ``https_proxy``, and ``all_proxy`` to | 133 | ``wget`` and you therefore need to specify the proxy settings in a |
355 | redirect requests through proxy servers. | 134 | ``.wgetrc`` file, which can be in your home directory if you are a |
135 | single user or can be in ``/usr/local/etc/wgetrc`` as a global user | ||
136 | file. | ||
137 | |||
138 | Following is the applicable code for setting various proxy types in the | ||
139 | ``.wgetrc`` file. By default, these settings are disabled with comments. | ||
140 | To use them, remove the comments:: | ||
141 | |||
142 | # You can set the default proxies for Wget to use for http, https, and ftp. | ||
143 | # They will override the value in the environment. | ||
144 | #https_proxy = http://proxy.yoyodyne.com:18023/ | ||
145 | #http_proxy = http://proxy.yoyodyne.com:18023/ | ||
146 | #ftp_proxy = http://proxy.yoyodyne.com:18023/ | ||
147 | |||
148 | # If you do not want to use proxy at all, set this to off. | ||
149 | #use_proxy = on | ||
150 | |||
151 | The build system also accepts ``http_proxy``, ``ftp_proxy``, ``https_proxy``, | ||
152 | and ``all_proxy`` set as to standard shell environment variables to redirect | ||
153 | requests through proxy servers. | ||
154 | |||
155 | The Yocto Project also includes a | ||
156 | ``meta-poky/conf/templates/default/site.conf.sample`` file that shows | ||
157 | how to configure CVS and Git proxy servers if needed. | ||
356 | 158 | ||
357 | .. note:: | 159 | .. note:: |
358 | 160 | ||
@@ -360,23 +162,199 @@ redirect requests through proxy servers. | |||
360 | ":yocto_wiki:`Working Behind a Network Proxy </Working_Behind_a_Network_Proxy>`" | 162 | ":yocto_wiki:`Working Behind a Network Proxy </Working_Behind_a_Network_Proxy>`" |
361 | Wiki page. | 163 | Wiki page. |
362 | 164 | ||
363 | **Q:** Can I get rid of build output so I can start over? | 165 | Using the OpenEmbedded Build system |
166 | =================================== | ||
167 | |||
168 | How do I use an external toolchain? | ||
169 | ----------------------------------- | ||
170 | |||
171 | The toolchain configuration is very flexible and customizable. It | ||
172 | is primarily controlled with the :term:`TCMODE` variable. This variable | ||
173 | controls which ``tcmode-*.inc`` file to include from the | ||
174 | ``meta/conf/distro/include`` directory within the :term:`Source Directory`. | ||
175 | |||
176 | The default value of :term:`TCMODE` is "default", which tells the | ||
177 | OpenEmbedded build system to use its internally built toolchain (i.e. | ||
178 | ``tcmode-default.inc``). However, other patterns are accepted. In | ||
179 | particular, "external-\*" refers to external toolchains. One example is | ||
180 | the Sourcery G++ Toolchain. The support for this toolchain resides in | ||
181 | the separate ``meta-sourcery`` layer at | ||
182 | https://github.com/MentorEmbedded/meta-sourcery/. | ||
183 | |||
184 | In addition to the toolchain configuration, you also need a | ||
185 | corresponding toolchain recipe file. This recipe file needs to package | ||
186 | up any pre-built objects in the toolchain such as ``libgcc``, | ||
187 | ``libstdcc++``, any locales, and ``libc``. | ||
188 | |||
189 | Why do I get chmod permission issues? | ||
190 | ------------------------------------- | ||
191 | |||
192 | If you see the error | ||
193 | ``chmod: XXXXX new permissions are r-xrwxrwx, not r-xr-xr-x``, | ||
194 | you are probably running the build on an NTFS filesystem. Instead, | ||
195 | run the build system on a partition with a modern Linux filesystem such as | ||
196 | ``ext4``, ``btrfs`` or ``xfs``. | ||
197 | |||
198 | I see many 404 errors trying to download sources. Is anything wrong? | ||
199 | -------------------------------------------------------------------- | ||
200 | |||
201 | Nothing is wrong. The OpenEmbedded build system checks any | ||
202 | configured source mirrors before downloading from the upstream sources. | ||
203 | The build system does this searching for both source archives and | ||
204 | pre-checked out versions of SCM-managed software. These checks help in | ||
205 | large installations because it can reduce load on the SCM servers | ||
206 | themselves. This can also allow builds to continue to work if an | ||
207 | upstream source disappears. | ||
208 | |||
209 | Why do I get random build failures? | ||
210 | ----------------------------------- | ||
211 | |||
212 | If the same build is failing in totally different and random | ||
213 | ways, the most likely explanation is: | ||
214 | |||
215 | - The hardware you are running the build on has some problem. | ||
216 | |||
217 | - You are running the build under virtualization, in which case the | ||
218 | virtualization probably has bugs. | ||
219 | |||
220 | The OpenEmbedded build system processes a massive amount of data that | ||
221 | causes lots of network, disk and CPU activity and is sensitive to even | ||
222 | single-bit failures in any of these areas. True random failures have | ||
223 | always been traced back to hardware or virtualization issues. | ||
224 | |||
225 | Why does the build fail with ``iconv.h`` problems? | ||
226 | -------------------------------------------------- | ||
227 | |||
228 | When you try to build a native recipe, you may get an error message that | ||
229 | indicates that GNU ``libiconv`` is not in use but ``iconv.h`` has been | ||
230 | included from ``libiconv``:: | ||
231 | |||
232 | #error GNU libiconv not in use but included iconv.h is from libiconv | ||
233 | |||
234 | When this happens, you need to check whether you have a previously | ||
235 | installed version of the header file in ``/usr/local/include/``. | ||
236 | If that's the case, you should either uninstall it or temporarily rename | ||
237 | it and try the build again. | ||
238 | |||
239 | This issue is just a single manifestation of "system leakage" issues | ||
240 | caused when the OpenEmbedded build system finds and uses previously | ||
241 | installed files during a native build. This type of issue might not be | ||
242 | limited to ``iconv.h``. Make sure that leakage cannot occur from | ||
243 | ``/usr/local/include`` and ``/opt`` locations. | ||
244 | |||
245 | Why don't other recipes find the files provided by my ``*-native`` recipe? | ||
246 | -------------------------------------------------------------------------- | ||
247 | |||
248 | Files provided by your native recipe could be missing from the native | ||
249 | sysroot, your recipe could also be installing to the wrong place, or you | ||
250 | could be getting permission errors during the :ref:`ref-tasks-install` | ||
251 | task in your recipe. | ||
364 | 252 | ||
365 | **A:** Yes --- you can easily do this. When you use BitBake to build an | 253 | This situation happens when the build system used by a package does not |
254 | recognize the environment variables supplied to it by :term:`BitBake`. The | ||
255 | incident that prompted this FAQ entry involved a Makefile that used an | ||
256 | environment variable named ``BINDIR`` instead of the more standard | ||
257 | variable ``bindir``. The makefile's hardcoded default value of | ||
258 | "/usr/bin" worked most of the time, but not for the recipe's ``-native`` | ||
259 | variant. For another example, permission errors might be caused by a | ||
260 | Makefile that ignores ``DESTDIR`` or uses a different name for that | ||
261 | environment variable. Check the build system of the package to see if | ||
262 | these kinds of issues exist. | ||
263 | |||
264 | Can I get rid of build output so I can start over? | ||
265 | -------------------------------------------------- | ||
266 | |||
267 | Yes --- you can easily do this. When you use BitBake to build an | ||
366 | image, all the build output goes into the directory created when you run | 268 | image, all the build output goes into the directory created when you run |
367 | the build environment setup script (i.e. | 269 | the build environment setup script (i.e. :ref:`structure-core-script`). |
368 | :ref:`structure-core-script`). By default, this :term:`Build Directory` | 270 | By default, this :term:`Build Directory` is named ``build`` but can be named |
369 | is named ``build`` but can be named | ||
370 | anything you want. | 271 | anything you want. |
371 | 272 | ||
372 | Within the Build Directory, is the ``tmp`` directory. To remove all the | 273 | Within the Build Directory, is the ``tmp`` directory. To remove all the |
373 | build output yet preserve any source code or downloaded files from | 274 | build output yet preserve any source code or downloaded files from |
374 | previous builds, simply remove the ``tmp`` directory. | 275 | previous builds, simply remove the ``tmp`` directory. |
375 | 276 | ||
376 | **Q:** Why do ``${bindir}`` and ``${libdir}`` have strange values for | 277 | Customizing generated images |
377 | ``-native`` recipes? | 278 | ============================ |
279 | |||
280 | What does the OpenEmbedded build system produce as output? | ||
281 | ---------------------------------------------------------- | ||
282 | |||
283 | Because you can use the same set of recipes to create output of | ||
284 | various formats, the output of an OpenEmbedded build depends on how you | ||
285 | start it. Usually, the output is a flashable image ready for the target | ||
286 | device. | ||
287 | |||
288 | How do I make the Yocto Project support my board? | ||
289 | ------------------------------------------------- | ||
290 | |||
291 | Support for an additional board is added by creating a Board | ||
292 | Support Package (BSP) layer for it. For more information on how to | ||
293 | create a BSP layer, see the | ||
294 | ":ref:`dev-manual/common-tasks:understanding and creating layers`" | ||
295 | section in the Yocto Project Development Tasks Manual and the | ||
296 | :doc:`/bsp-guide/index`. | ||
297 | |||
298 | Usually, if the board is not completely exotic, adding support in the | ||
299 | Yocto Project is fairly straightforward. | ||
300 | |||
301 | How do I make the Yocto Project support my package? | ||
302 | --------------------------------------------------- | ||
303 | |||
304 | To add a package, you need to create a BitBake recipe. For | ||
305 | information on how to create a BitBake recipe, see the | ||
306 | ":ref:`dev-manual/common-tasks:writing a new recipe`" | ||
307 | section in the Yocto Project Development Tasks Manual. | ||
308 | |||
309 | What do I need to ship for license compliance? | ||
310 | ---------------------------------------------- | ||
311 | |||
312 | This is a difficult question and you need to consult your lawyer | ||
313 | for the answer for your specific case. It is worth bearing in mind that | ||
314 | for GPL compliance, there needs to be enough information shipped to | ||
315 | allow someone else to rebuild and produce the same end result you are | ||
316 | shipping. This means sharing the source code, any patches applied to it, | ||
317 | and also any configuration information about how that package was | ||
318 | configured and built. | ||
319 | |||
320 | You can find more information on licensing in the | ||
321 | ":ref:`overview-manual/development-environment:licensing`" | ||
322 | section in the Yocto Project Overview and Concepts Manual and also in the | ||
323 | ":ref:`dev-manual/common-tasks:maintaining open source license compliance during your product's lifecycle`" | ||
324 | section in the Yocto Project Development Tasks Manual. | ||
325 | |||
326 | Do I have to make a full reflash after recompiling one package? | ||
327 | --------------------------------------------------------------- | ||
378 | 328 | ||
379 | **A:** Executables and libraries might need to be used from a directory | 329 | The OpenEmbedded build system can build packages in various |
330 | formats such as IPK for OPKG, Debian package (``.deb``), or RPM. You can | ||
331 | then upgrade only the modified packages using the package tools on the device, | ||
332 | much like on a desktop distribution such as Ubuntu or Fedora. However, | ||
333 | package management on the target is entirely optional. | ||
334 | |||
335 | How to prevent my package from being marked as machine specific? | ||
336 | ---------------------------------------------------------------- | ||
337 | |||
338 | If you have machine-specific data in a package for one machine only | ||
339 | but the package is being marked as machine-specific in all cases, | ||
340 | you can set :term:`SRC_URI_OVERRIDES_PACKAGE_ARCH` = "0" in the ``.bb`` file. | ||
341 | However, but make sure the package is manually marked as machine-specific for the | ||
342 | case that needs it. The code that handles :term:`SRC_URI_OVERRIDES_PACKAGE_ARCH` | ||
343 | is in the ``meta/classes-global/base.bbclass`` file. | ||
344 | |||
345 | What's the difference between ``target`` and ``target-native``? | ||
346 | --------------------------------------------------------------- | ||
347 | |||
348 | The ``*-native`` targets are designed to run on the system being | ||
349 | used for the build. These are usually tools that are needed to assist | ||
350 | the build in some way such as ``quilt-native``, which is used to apply | ||
351 | patches. The non-native version is the one that runs on the target | ||
352 | device. | ||
353 | |||
354 | Why do ``${bindir}`` and ``${libdir}`` have strange values for ``-native`` recipes? | ||
355 | ----------------------------------------------------------------------------------- | ||
356 | |||
357 | Executables and libraries might need to be used from a directory | ||
380 | other than the directory into which they were initially installed. | 358 | other than the directory into which they were initially installed. |
381 | Complicating this situation is the fact that sometimes these executables | 359 | Complicating this situation is the fact that sometimes these executables |
382 | and libraries are compiled with the expectation of being run from that | 360 | and libraries are compiled with the expectation of being run from that |
@@ -408,15 +386,9 @@ native program (i.e. one that is intended to run on the build machine), | |||
408 | that program is never installed directly to the build machine's root | 386 | that program is never installed directly to the build machine's root |
409 | file system. Consequently, the build system uses paths within the Build | 387 | file system. Consequently, the build system uses paths within the Build |
410 | Directory for ``DESTDIR``, ``bindir`` and related variables. To better | 388 | Directory for ``DESTDIR``, ``bindir`` and related variables. To better |
411 | understand this, consider the following two paths where the first is | 389 | understand this, consider the following two paths (artificially broken |
412 | relatively normal and the second is not: | 390 | across lines for readability) where the first is relatively normal and |
413 | 391 | the second is not:: | |
414 | .. note:: | ||
415 | |||
416 | Due to these lengthy examples, the paths are artificially broken | ||
417 | across lines for readability. | ||
418 | |||
419 | :: | ||
420 | 392 | ||
421 | /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/ | 393 | /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/ |
422 | 1.2.8-r0/sysroot-destdir/usr/bin | 394 | 1.2.8-r0/sysroot-destdir/usr/bin |
@@ -425,32 +397,76 @@ relatively normal and the second is not: | |||
425 | zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/ | 397 | zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/ |
426 | build/tmp/sysroots/x86_64-linux/usr/bin | 398 | build/tmp/sysroots/x86_64-linux/usr/bin |
427 | 399 | ||
428 | Even if the paths look unusual, | 400 | Even if the paths look unusual, they both are correct --- the first for |
429 | they both are correct --- the first for a target and the second for a | 401 | a target and the second for a native recipe. These paths are a consequence |
430 | native recipe. These paths are a consequence of the ``DESTDIR`` | 402 | of the ``DESTDIR`` mechanism and while they appear strange, they are correct |
431 | mechanism and while they appear strange, they are correct and in | 403 | and in practice very effective. |
432 | practice very effective. | ||
433 | 404 | ||
434 | **Q:** The files provided by my ``*-native`` recipe do not appear to be | 405 | How do I create images with more free space? |
435 | available to other recipes. Files are missing from the native sysroot, | 406 | -------------------------------------------- |
436 | my recipe is installing to the wrong place, or I am getting permissions | ||
437 | errors during the :ref:`ref-tasks-install` task in my recipe! What is wrong? | ||
438 | 407 | ||
439 | **A:** This situation results when a build system does not recognize the | 408 | By default, the OpenEmbedded build system creates images that are |
440 | environment variables supplied to it by :term:`BitBake`. The | 409 | 1.3 times the size of the populated root filesystem. To affect the image |
441 | incident that prompted this FAQ entry involved a Makefile that used an | 410 | size, you need to set various configurations: |
442 | environment variable named ``BINDIR`` instead of the more standard | ||
443 | variable ``bindir``. The makefile's hardcoded default value of | ||
444 | "/usr/bin" worked most of the time, but not for the recipe's ``-native`` | ||
445 | variant. For another example, permissions errors might be caused by a | ||
446 | Makefile that ignores ``DESTDIR`` or uses a different name for that | ||
447 | environment variable. Check the build system to see if these kinds | ||
448 | of issues exist. | ||
449 | 411 | ||
450 | **Q:** I'm adding a binary in a recipe but it's different in the image, what is | 412 | - *Image Size:* The OpenEmbedded build system uses the |
451 | changing it? | 413 | :term:`IMAGE_ROOTFS_SIZE` variable to define |
414 | the size of the image in Kbytes. The build system determines the size | ||
415 | by taking into account the initial root filesystem size before any | ||
416 | modifications such as requested size for the image and any requested | ||
417 | additional free disk space to be added to the image. | ||
418 | |||
419 | - *Overhead:* Use the | ||
420 | :term:`IMAGE_OVERHEAD_FACTOR` variable | ||
421 | to define the multiplier that the build system applies to the initial | ||
422 | image size, which is 1.3 by default. | ||
423 | |||
424 | - *Additional Free Space:* Use the | ||
425 | :term:`IMAGE_ROOTFS_EXTRA_SPACE` | ||
426 | variable to add additional free space to the image. The build system | ||
427 | adds this space to the image after it determines its | ||
428 | :term:`IMAGE_ROOTFS_SIZE`. | ||
429 | |||
430 | Why aren't spaces in path names supported? | ||
431 | ------------------------------------------ | ||
432 | |||
433 | The Yocto Project team has tried to do this before but too many | ||
434 | of the tools the OpenEmbedded build system depends on, such as | ||
435 | ``autoconf``, break when they find spaces in pathnames. Until that | ||
436 | situation changes, the team will not support spaces in pathnames. | ||
452 | 437 | ||
453 | **A:** The first most obvious change is the system stripping debug symbols from | 438 | I'm adding a binary in a recipe. Why is it different in the image? |
454 | it. Setting :term:`INHIBIT_PACKAGE_STRIP` to stop debug symbols being stripped and/or | 439 | ------------------------------------------------------------------ |
455 | :term:`INHIBIT_PACKAGE_DEBUG_SPLIT` to stop debug symbols being split into a separate | 440 | |
456 | file will ensure the binary is unchanged. | 441 | The first most obvious change is the system stripping debug symbols from |
442 | it. Setting :term:`INHIBIT_PACKAGE_STRIP` to stop debug symbols being | ||
443 | stripped and/or :term:`INHIBIT_PACKAGE_DEBUG_SPLIT` to stop debug symbols | ||
444 | being split into a separate file will ensure the binary is unchanged. | ||
445 | |||
446 | Issues on the running system | ||
447 | ============================ | ||
448 | |||
449 | How do I disable the cursor on my touchscreen device? | ||
450 | ----------------------------------------------------- | ||
451 | |||
452 | You need to create a form factor file as described in the | ||
453 | ":ref:`bsp-guide/bsp:miscellaneous bsp-specific recipe files`" section in | ||
454 | the Yocto Project Board Support Packages (BSP) Developer's Guide. Set | ||
455 | the ``HAVE_TOUCHSCREEN`` variable equal to one as follows:: | ||
456 | |||
457 | HAVE_TOUCHSCREEN=1 | ||
458 | |||
459 | How to always bring up connected network interfaces? | ||
460 | ---------------------------------------------------- | ||
461 | |||
462 | The default interfaces file provided by the netbase recipe does | ||
463 | not automatically bring up network interfaces. Therefore, you will need | ||
464 | to add a BSP-specific netbase that includes an interfaces file. See the | ||
465 | ":ref:`bsp-guide/bsp:miscellaneous bsp-specific recipe files`" section in | ||
466 | the Yocto Project Board Support Packages (BSP) Developer's Guide for | ||
467 | information on creating these types of miscellaneous recipe files. | ||
468 | |||
469 | For example, add the following files to your layer:: | ||
470 | |||
471 | meta-MACHINE/recipes-bsp/netbase/netbase/MACHINE/interfaces | ||
472 | meta-MACHINE/recipes-bsp/netbase/netbase_5.0.bbappend | ||