summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-09-07 23:04:05 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-17 10:09:34 +0100
commitf77ab9bc9c9d124a45f4e555b97d481cb6d8ccdc (patch)
tree4b6f964732694e36e6b6123df89bc54dbff7d481 /documentation
parente4b904b21cd30f0b2f412117b73411b0f2844fef (diff)
downloadpoky-f77ab9bc9c9d124a45f4e555b97d481cb6d8ccdc.tar.gz
sphinx: convert 'what I wish I'd known'
This page is currently a static web page in the Yocto project website, in the docs section. While we are converting the whole YP docs into its own website, let's convert this file as well. (From yocto-docs rev: 1d4db1f776cdb775f79cd5e2089da01e0d9c43ea) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/figures/yp-how-it-works-new-diagram.pngbin0 -> 249657 bytes
-rw-r--r--documentation/index.rst2
-rw-r--r--documentation/what-i-wish-id-known.rst231
3 files changed, 232 insertions, 1 deletions
diff --git a/documentation/figures/yp-how-it-works-new-diagram.png b/documentation/figures/yp-how-it-works-new-diagram.png
new file mode 100644
index 0000000000..2ce076f3c3
--- /dev/null
+++ b/documentation/figures/yp-how-it-works-new-diagram.png
Binary files differ
diff --git a/documentation/index.rst b/documentation/index.rst
index 4e8b3647f4..4fd1dfba18 100644
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -15,7 +15,7 @@ Welcome to The Yocto Project's documentation!
15 :caption: Introduction and Overview 15 :caption: Introduction and Overview
16 16
17 Quick Build <brief-yoctoprojectqs/brief-yoctoprojectqs> 17 Quick Build <brief-yoctoprojectqs/brief-yoctoprojectqs>
18 What I wish I'd known about Yocto Project <https://www.yoctoproject.org/docs/what-i-wish-id-known/> 18 what-i-wish-id-known
19 Transitioning to a custom environment for systems development <https://www.yoctoproject.org/docs/transitioning-to-a-custom-environment> 19 Transitioning to a custom environment for systems development <https://www.yoctoproject.org/docs/transitioning-to-a-custom-environment>
20 Yocto Project Software Overview <https://www.yoctoproject.org/software-overview/> 20 Yocto Project Software Overview <https://www.yoctoproject.org/software-overview/>
21 Tips and Tricks Wiki <https://wiki.yoctoproject.org/wiki/TipsAndTricks> 21 Tips and Tricks Wiki <https://wiki.yoctoproject.org/wiki/TipsAndTricks>
diff --git a/documentation/what-i-wish-id-known.rst b/documentation/what-i-wish-id-known.rst
new file mode 100644
index 0000000000..7cf6dfd9a1
--- /dev/null
+++ b/documentation/what-i-wish-id-known.rst
@@ -0,0 +1,231 @@
1.. SPDX-License-Identifier: CC-BY-2.0-UK
2
3=========================================
4What I wish I'd known about Yocto Project
5=========================================
6
7|
8
9.. note::
10
11 Before reading further, make sure you’ve taken a look at the
12 :yocto_home:`Software Overview</software-overview>` page which presents the
13 definitions for many of the terms referenced here. Also, know that some of the
14 information here won't make sense now, but as you start developing, it is the
15 information you'll want to keep close at hand. These are best known methods for
16 working with Yocto Project and they are updated regularly.
17
18Using the Yocto Project is fairly easy, *until something goes wrong*. Without an
19understanding of how the build process works, you’ll find yourself trying to
20troubleshoot “a black box”. Here are a few items that new users wished they had
21known before embarking on their first build with Yocto Project. Feel free to
22contact us with other suggestions.
23
24#. **Use Git, not the tarball download:**
25 If you use git the software will be automatically updated with bug updates
26 because of how git works. If you download the tarball instead, you will need
27 to be responsible for your own updates.
28
29#. **Get to know the layer index:**
30 All layers can be found in the `layer index
31 <https://layers.openembedded.org/>`_. Layers which have applied for Yocto
32 Project Compatible status (structure continuity assurance and testing) can be
33 found in the :yocto_home:`Yocto Project Compatible index
34 </software-over/layer/>`. Generally check the Compatible layer index first,
35 and if you don't find the necessary layer check the general layer index. The
36 layer index is an original artifact from the Open Embedded Project. As such,
37 that index doesn’t have the curating and testing that the Yocto Project
38 provides on Yocto Project Compatible layer list, but the latter has fewer
39 entries. Know that when you start searching in the layer index that not all
40 layers have the same level of maturity, validation, or usability. Nor do
41 searches prioritize displayed results. There is no easy way to help you
42 through the process of choosing the best layer to suit your needs.
43 Consequently, it is often trial and error, checking the mailing lists, or
44 working with other developers through collaboration rooms that can help you
45 make good choices.
46
47#. **Use existing BSP layers from silicon vendors when possible:**
48 Intel, TI, NXP and others have information on what BSP layers to use with
49 their silicon. These layers have names such as "meta-intel" or "meta-ti". Try
50 not to build layers from scratch. If you do have custom silicon, use one of
51 these layers as a guide or template and familiarize yourself with the
52 :doc:`bsp-guide/bsp-guide`.
53
54#. **Do not put everything into one layer:**
55 Use different layers to logically separate information in your build. As an
56 example, you could have a BSP layer, a GUI layer, a distro configuration,
57 middleware, or an application (e.g. "meta-filesystems", "meta-python",
58 "meta-intel", and so forth). Putting your entire build into one layer limits
59 and complicates future customization and reuse. Isolating information into
60 layers, on the other hand, helps keep simplify future customizations and
61 reuse.
62
63#. **Never modify the POKY layer. Never. Ever. When you update to the next
64 release, you'll lose all of your work. ALL OF IT.**
65
66#. **Don't be fooled by documentation searching results:**
67 Yocto Project documentation is always being updated. Unfortunately, when you
68 use Google to search for Yocto Project concepts or terms, Google consistently
69 searches and retrieves older versions of Yocto Project manuals. For example,
70 searching for a particular topic using Google could result in a "hit" on a
71 Yocto Project manual that is several releases old. To be sure that you are
72 using the most current Yocto Project documentation, use the
73 :yocto_docs:`Yocto Project documentation </>` page to locate the right
74 documentation for your software release version. If you use the search bar on
75 the top of the Documentation Overview page, while that search isn’t optimal,
76 it will point you to the documents where your search string can be
77 found. That search will usually identify where most of the attention on a
78 given term or concept is.
79
80 Many developers look through the complete Yocto Project set of manuals for a
81 concept or term by doing a search through the "Yocto Project Complete
82 Documentation Set". This manual is a concatenation of the core set of Yocto
83 Project manual. Thus, a simple string search using Ctrl-F in this manual
84 produces all the "hits" for a desired term or concept. Once you find the area
85 in which you are interested, you can display the actual manual, if desired.
86
87#. **Understand the basic concepts of how the build system works: the workflow:**
88 Understanding the Yocto Project workflow is important as it can help you both
89 pinpoint where trouble is occurring and how the build is breaking. The
90 workflow breaks down into the following steps:
91
92 #. Fetch – get the sourcecode
93 #. Extract – unpack the sources
94 #. Patch – apply patches for bug fixes and new capability
95 #. Configure – set up your environment specifications
96 #. Build – compile and link
97 #. Install – copy files to target directories
98 #. Package – bundle files for installation
99
100 During "fetch", there may be an inability to find code. During "extract",
101 there is likely an invalid zip or something similar. In other words, the
102 function of a particular part of the workflow gives you an idea of what might
103 be going wrong.
104
105 .. image:: figures/yp-how-it-works-new-diagram.png
106
107#. **Know that you can generate a dependency graph and learn how to do it:**
108 A dependency graph shows dependencies between recipes, tasks, and targets.
109 You can use the "-g" option with BitBake to generate this graph. When you
110 start a build and the build breaks, you could see packages you have no clue
111 about or have any idea why the build system has included them. The
112 dependency graph can clarify that confustion. You can learn more about
113 dependency graphs and how to generate them in the
114 :ref:`bitbake-user-manual/bitbake-user-manual-intro:generating dependency
115 graphs` section in the BitBake User Manual.
116
117#. **Here’s how you decode “magic” folder names in tmp/work:**
118 The build system fetches, unpacks, preprocesses, and builds. If something
119 goes wrong, the build system reports to you directly the path to a folder
120 where the temporary (build/tmp) files and packages reside resulting from the
121 build. For a detailed example of this process, see the :yocto_wiki:`example
122 </Cookbook:Example:Adding_packages_to_your_OS_image>`. Unfortunately this
123 example is on an earlier release of Yocto Project.
124
125 When you perform a build, you can use the "-u" BitBake command-line option to
126 specify a user interface viewer into the dependency graph (e.g. knotty,
127 ncurses, or taskexp) that helps you understand the build dependencies better.
128
129#. **You can build more than just images:**
130 You can build and run a specific task for a specific package (including
131 devshell) or even a single recipe. When developers first start using the
132 Yocto Project, the instructions found in the
133 :doc:`brief-yoctoprojectqs/brief-yoctoprojectqs` show how to create an image
134 and then run or flash that image. However, you can actually build just a
135 single recipe. Thus, if some dependency or recipe isn’t working, you can just
136 say “bitbake foo” where "foo" is the name for a specific recipe. As you
137 become more advanced using the Yocto Project, and if builds are failing, it
138 can be useful to make sure the fetch itself works as desired. Here are some
139 valuable links: :ref:`dev-manual/dev-manual-common-tasks:Using a Development
140 Shell` for information on how to build and run a specific task using
141 devshell. Also, the :ref:`SDK manual shows how to build out a specific recipe
142 <sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component>`.
143
144#. **An ambiguous definition: Package vs Recipe:**
145 A recipe contains instructions the build system uses to create
146 packages. Recipes and Packages are the difference between the front end and
147 the result of the build process.
148
149 As mentioned, the build system takes the recipe and creates packages from the
150 recipe's instructions. The resulting packages are related to the one thing
151 the recipe is building but are different parts (packages) of the build
152 (i.e. the main package, the doc package, the debug symbols package, the
153 separate utilities package, and so forth). The build system splits out the
154 packages so that you don’t need to install the packages you don’t want or
155 need, which is advantageous because you are building for small devices when
156 developing for embedded and IoT.
157
158#. **You will want to learn about and know what’s packaged in rootfs.**
159
160#. **Create your own image recipe:**
161 There are a number of ways to create your own image recipe. We suggest you
162 create your own image recipe as opposed to appending an existing recipe. It
163 is trivial and easy to write an image recipe. Again, do not try appending to
164 an existing image recipe. Create your own and do it right from the start.
165
166#. **Finally, here is a list of the basic skills you will need as a systems
167 developer. You must be able to:**
168
169 * deal with corporate proxies
170 * add a package to an image
171 * understand the difference between a recipe and package
172 * build a package by itself and why that's useful
173 * find out what packages are created by a recipe
174 * find out what files are in a package
175 * find out what files are in an image
176 * add an ssh server to an image (enable transferring of files to target)
177 * know the anatomy of a recipe
178 * know how to create and use layers
179 * find recipes (with the `OpenEmbedded Layer index <https://layers.openembedded.org>`_)
180 * understand difference between machine and distro settings
181 * find and use the right BSP (machine) for your hardware
182 * find examples of distro features and know where to set them
183 * understanding the task pipeline and executing individual tasks
184 * understand devtool and how it simplifies your workflow
185 * improve build speeds with shared downloads and shared state cache
186 * generate and understand a dependency graph
187 * generate and understand bitbake environment
188 * build an Extensible SDK for applications development
189
190#. **Depending on what you primary interests are with the Yocto Project, you
191 could consider any of the following reading:**
192
193 * **Look Through the Yocto Project Development Tasks Manual**: This manual
194 contains procedural information grouped to help you get set up, work with
195 layers, customize images, write new recipes, work with libraries, and use
196 QEMU. The information is task-based and spans the breadth of the Yocto
197 Project.
198
199 * **Look Through the Yocto Project Application Development and the Extensible
200 Software Development Kit (eSDK) manual**: This manual describes how to use
201 both the standard SDK and the extensible SDK, which are used primarily for
202 application development. This manual also provides example workflows that
203 use the popular Eclipse\ |trade| development environment and that use
204 devtool. See the "Workflow using Eclipse\ |trade|" and "Using devtool in
205 your SDK Workflow" sections for more information.
206
207 * **Learn About Kernel Development**: If you want to see how to work with the
208 kernel and understand Yocto Linux kernels, see the Yocto Project Linux
209 Kernel Development Manual. This manual provides information on how to patch
210 the kernel, modify kernel recipes, and configure the kernel.
211
212 * **Learn About Board Support Packages (BSPs)**: If you want to learn about
213 BSPs, see the Yocto Project Board Support Packages (BSP) Developer's
214 Guide. This manual also provides an example BSP creation workflow. See the
215 "Developing a Board Support Package (BSP)" section.
216
217 * **Learn About Toaster**: Toaster is a web interface to the Yocto Project's
218 OpenEmbedded build system. If you are interested in using this type of
219 interface to create images, see the Toaster User Manual.
220
221 * **Have Available the Yocto Project Reference Manual**: Unlike the rest of
222 the Yocto Project manual set, this manual is comprised of material suited
223 for reference rather than procedures. You can get build details, a closer
224 look at how the pieces of the Yocto Project development environment work
225 together, information on various technical details, guidance on migrating
226 to a newer Yocto Project release, reference material on the directory
227 structure, classes, and tasks. The Yocto Project Reference Manual also
228 contains a fairly comprehensive glossary of variables used within the Yocto
229 Project.
230
231.. include:: /boilerplate.rst