xref: /OK3568_Linux_fs/yocto/poky/documentation/brief-yoctoprojectqs/index.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun=========================
4*4882a593SmuzhiyunYocto Project Quick Build
5*4882a593Smuzhiyun=========================
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunWelcome!
8*4882a593Smuzhiyun========
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunThis short document steps you through the process for a typical
11*4882a593Smuzhiyunimage build using the Yocto Project. The document also introduces how to
12*4882a593Smuzhiyunconfigure a build for specific hardware. You will use Yocto Project to
13*4882a593Smuzhiyunbuild a reference embedded OS called Poky.
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun.. note::
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun   -  The examples in this paper assume you are using a native Linux
18*4882a593Smuzhiyun      system running a recent Ubuntu Linux distribution. If the machine
19*4882a593Smuzhiyun      you want to use Yocto Project on to build an image
20*4882a593Smuzhiyun      (:term:`Build Host`) is not
21*4882a593Smuzhiyun      a native Linux system, you can still perform these steps by using
22*4882a593Smuzhiyun      CROss PlatformS (CROPS) and setting up a Poky container. See the
23*4882a593Smuzhiyun      :ref:`dev-manual/start:setting up to use cross platforms (crops)`
24*4882a593Smuzhiyun      section
25*4882a593Smuzhiyun      in the Yocto Project Development Tasks Manual for more
26*4882a593Smuzhiyun      information.
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun   -  You may use Windows Subsystem For Linux v2 to set up a build host
29*4882a593Smuzhiyun      using Windows 10.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun      .. note::
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun         The Yocto Project is not compatible with WSLv1, it is
34*4882a593Smuzhiyun         compatible but not officially supported nor validated with
35*4882a593Smuzhiyun         WSLv2, if you still decide to use WSL please upgrade to WSLv2.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun      See the :ref:`dev-manual/start:setting up to use windows
38*4882a593Smuzhiyun      subsystem for linux (wslv2)` section in the Yocto Project Development
39*4882a593Smuzhiyun      Tasks Manual for more information.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunIf you want more conceptual or background information on the Yocto
42*4882a593SmuzhiyunProject, see the :doc:`/overview-manual/index`.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunCompatible Linux Distribution
45*4882a593Smuzhiyun=============================
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunMake sure your :term:`Build Host` meets the
48*4882a593Smuzhiyunfollowing requirements:
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun-  50 Gbytes of free disk space
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun-  Runs a supported Linux distribution (i.e. recent releases of Fedora,
53*4882a593Smuzhiyun   openSUSE, CentOS, Debian, or Ubuntu). For a list of Linux
54*4882a593Smuzhiyun   distributions that support the Yocto Project, see the
55*4882a593Smuzhiyun   :ref:`ref-manual/system-requirements:supported linux distributions`
56*4882a593Smuzhiyun   section in the Yocto Project Reference Manual. For detailed
57*4882a593Smuzhiyun   information on preparing your build host, see the
58*4882a593Smuzhiyun   :ref:`dev-manual/start:preparing the build host`
59*4882a593Smuzhiyun   section in the Yocto Project Development Tasks Manual.
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun-
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun   -  Git &MIN_GIT_VERSION; or greater
64*4882a593Smuzhiyun   -  tar &MIN_TAR_VERSION; or greater
65*4882a593Smuzhiyun   -  Python &MIN_PYTHON_VERSION; or greater.
66*4882a593Smuzhiyun   -  gcc &MIN_GCC_VERSION; or greater.
67*4882a593Smuzhiyun   -  GNU make &MIN_MAKE_VERSION; or greater
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunIf your build host does not meet any of these three listed version
70*4882a593Smuzhiyunrequirements, you can take steps to prepare the system so that you
71*4882a593Smuzhiyuncan still use the Yocto Project. See the
72*4882a593Smuzhiyun:ref:`ref-manual/system-requirements:required git, tar, python and gcc versions`
73*4882a593Smuzhiyunsection in the Yocto Project Reference Manual for information.
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunBuild Host Packages
76*4882a593Smuzhiyun===================
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunYou must install essential host packages on your build host. The
79*4882a593Smuzhiyunfollowing command installs the host packages based on an Ubuntu
80*4882a593Smuzhiyundistribution:
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun.. code-block:: shell
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun  $ sudo apt install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun.. note::
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun   For host package requirements on all supported Linux distributions,
89*4882a593Smuzhiyun   see the :ref:`ref-manual/system-requirements:required packages for the build host`
90*4882a593Smuzhiyun   section in the Yocto Project Reference Manual.
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunUse Git to Clone Poky
93*4882a593Smuzhiyun=====================
94*4882a593Smuzhiyun
95*4882a593SmuzhiyunOnce you complete the setup instructions for your machine, you need to
96*4882a593Smuzhiyunget a copy of the Poky repository on your build host. Use the following
97*4882a593Smuzhiyuncommands to clone the Poky repository.
98*4882a593Smuzhiyun
99*4882a593Smuzhiyun.. code-block:: shell
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun   $ git clone git://git.yoctoproject.org/poky
102*4882a593Smuzhiyun   Cloning into 'poky'...
103*4882a593Smuzhiyun   remote: Counting
104*4882a593Smuzhiyun   objects: 432160, done. remote: Compressing objects: 100%
105*4882a593Smuzhiyun   (102056/102056), done. remote: Total 432160 (delta 323116), reused
106*4882a593Smuzhiyun   432037 (delta 323000) Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
107*4882a593Smuzhiyun   Resolving deltas: 100% (323116/323116), done.
108*4882a593Smuzhiyun   Checking connectivity... done.
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunGo to :yocto_wiki:`Releases wiki page </Releases>`, and choose a release
111*4882a593Smuzhiyuncodename (such as ``&DISTRO_NAME_NO_CAP;``), corresponding to either the
112*4882a593Smuzhiyunlatest stable release or a Long Term Support release.
113*4882a593Smuzhiyun
114*4882a593SmuzhiyunThen move to the ``poky`` directory and take a look at existing branches:
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun.. code-block:: shell
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun   $ cd poky
119*4882a593Smuzhiyun   $ git branch -a
120*4882a593Smuzhiyun   .
121*4882a593Smuzhiyun   .
122*4882a593Smuzhiyun   .
123*4882a593Smuzhiyun   remotes/origin/HEAD -> origin/master
124*4882a593Smuzhiyun   remotes/origin/dunfell
125*4882a593Smuzhiyun   remotes/origin/dunfell-next
126*4882a593Smuzhiyun   .
127*4882a593Smuzhiyun   .
128*4882a593Smuzhiyun   .
129*4882a593Smuzhiyun   remotes/origin/gatesgarth
130*4882a593Smuzhiyun   remotes/origin/gatesgarth-next
131*4882a593Smuzhiyun   .
132*4882a593Smuzhiyun   .
133*4882a593Smuzhiyun   .
134*4882a593Smuzhiyun   remotes/origin/master
135*4882a593Smuzhiyun   remotes/origin/master-next
136*4882a593Smuzhiyun   .
137*4882a593Smuzhiyun   .
138*4882a593Smuzhiyun   .
139*4882a593Smuzhiyun
140*4882a593Smuzhiyun
141*4882a593SmuzhiyunFor this example, check out the ``&DISTRO_NAME_NO_CAP;`` branch based on the
142*4882a593Smuzhiyun``&DISTRO_NAME;`` release:
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun.. code-block:: shell
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun   $ git checkout -t origin/&DISTRO_NAME_NO_CAP; -b my-&DISTRO_NAME_NO_CAP;
147*4882a593Smuzhiyun   Branch 'my-&DISTRO_NAME_NO_CAP;' set up to track remote branch '&DISTRO_NAME_NO_CAP;' from 'origin'.
148*4882a593Smuzhiyun   Switched to a new branch 'my-&DISTRO_NAME_NO_CAP;'
149*4882a593Smuzhiyun
150*4882a593SmuzhiyunThe previous Git checkout command creates a local branch named
151*4882a593Smuzhiyun``my-&DISTRO_NAME_NO_CAP;``. The files available to you in that branch
152*4882a593Smuzhiyunexactly match the repository's files in the ``&DISTRO_NAME_NO_CAP;``
153*4882a593Smuzhiyunrelease branch.
154*4882a593Smuzhiyun
155*4882a593SmuzhiyunNote that you can regularly type the following command in the same directory
156*4882a593Smuzhiyunto keep your local files in sync with the release branch:
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun.. code-block:: shell
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun   $ git pull
161*4882a593Smuzhiyun
162*4882a593SmuzhiyunFor more options and information about accessing Yocto Project related
163*4882a593Smuzhiyunrepositories, see the
164*4882a593Smuzhiyun:ref:`dev-manual/start:locating yocto project source files`
165*4882a593Smuzhiyunsection in the Yocto Project Development Tasks Manual.
166*4882a593Smuzhiyun
167*4882a593SmuzhiyunBuilding Your Image
168*4882a593Smuzhiyun===================
169*4882a593Smuzhiyun
170*4882a593SmuzhiyunUse the following steps to build your image. The build process creates
171*4882a593Smuzhiyunan entire Linux distribution, including the toolchain, from source.
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun.. note::
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun   -  If you are working behind a firewall and your build host is not
176*4882a593Smuzhiyun      set up for proxies, you could encounter problems with the build
177*4882a593Smuzhiyun      process when fetching source code (e.g. fetcher failures or Git
178*4882a593Smuzhiyun      failures).
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun   -  If you do not know your proxy settings, consult your local network
181*4882a593Smuzhiyun      infrastructure resources and get that information. A good starting
182*4882a593Smuzhiyun      point could also be to check your web browser settings. Finally,
183*4882a593Smuzhiyun      you can find more information on the
184*4882a593Smuzhiyun      ":yocto_wiki:`Working Behind a Network Proxy </Working_Behind_a_Network_Proxy>`"
185*4882a593Smuzhiyun      page of the Yocto Project Wiki.
186*4882a593Smuzhiyun
187*4882a593Smuzhiyun#. **Initialize the Build Environment:** From within the ``poky``
188*4882a593Smuzhiyun   directory, run the :ref:`ref-manual/structure:\`\`oe-init-build-env\`\``
189*4882a593Smuzhiyun   environment
190*4882a593Smuzhiyun   setup script to define Yocto Project's build environment on your
191*4882a593Smuzhiyun   build host.
192*4882a593Smuzhiyun
193*4882a593Smuzhiyun   .. code-block:: shell
194*4882a593Smuzhiyun
195*4882a593Smuzhiyun      $ cd poky
196*4882a593Smuzhiyun      $ source oe-init-build-env
197*4882a593Smuzhiyun      You had no conf/local.conf file. This configuration file has therefore been
198*4882a593Smuzhiyun      created for you with some default values. You may wish to edit it to, for
199*4882a593Smuzhiyun      example, select a different MACHINE (target hardware). See conf/local.conf
200*4882a593Smuzhiyun      for more information as common configuration options are commented.
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun      You had no conf/bblayers.conf file. This configuration file has therefore
203*4882a593Smuzhiyun      been created for you with some default values. To add additional metadata
204*4882a593Smuzhiyun      layers into your configuration please add entries to conf/bblayers.conf.
205*4882a593Smuzhiyun
206*4882a593Smuzhiyun      The Yocto Project has extensive documentation about OE including a reference
207*4882a593Smuzhiyun      manual which can be found at:
208*4882a593Smuzhiyun          https://docs.yoctoproject.org
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun      For more information about OpenEmbedded see their website:
211*4882a593Smuzhiyun          https://www.openembedded.org/
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun      ### Shell environment set up for builds. ###
214*4882a593Smuzhiyun
215*4882a593Smuzhiyun      You can now run 'bitbake <target>'
216*4882a593Smuzhiyun
217*4882a593Smuzhiyun      Common targets are:
218*4882a593Smuzhiyun          core-image-minimal
219*4882a593Smuzhiyun          core-image-full-cmdline
220*4882a593Smuzhiyun          core-image-sato
221*4882a593Smuzhiyun          core-image-weston
222*4882a593Smuzhiyun          meta-toolchain
223*4882a593Smuzhiyun          meta-ide-support
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun      You can also run generated QEMU images with a command like 'runqemu qemux86-64'
226*4882a593Smuzhiyun
227*4882a593Smuzhiyun      Other commonly useful commands are:
228*4882a593Smuzhiyun       - 'devtool' and 'recipetool' handle common recipe tasks
229*4882a593Smuzhiyun       - 'bitbake-layers' handles common layer tasks
230*4882a593Smuzhiyun       - 'oe-pkgdata-util' handles common target package tasks
231*4882a593Smuzhiyun
232*4882a593Smuzhiyun   Among other things, the script creates the :term:`Build Directory`, which is
233*4882a593Smuzhiyun   ``build`` in this case and is located in the :term:`Source Directory`.  After
234*4882a593Smuzhiyun   the script runs, your current working directory is set to the Build
235*4882a593Smuzhiyun   Directory. Later, when the build completes, the Build Directory contains all the
236*4882a593Smuzhiyun   files created during the build.
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun#. **Examine Your Local Configuration File:** When you set up the build
239*4882a593Smuzhiyun   environment, a local configuration file named ``local.conf`` becomes
240*4882a593Smuzhiyun   available in a ``conf`` subdirectory of the Build Directory. For this
241*4882a593Smuzhiyun   example, the defaults are set to build for a ``qemux86`` target,
242*4882a593Smuzhiyun   which is suitable for emulation. The package manager used is set to
243*4882a593Smuzhiyun   the RPM package manager.
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun   .. tip::
246*4882a593Smuzhiyun
247*4882a593Smuzhiyun      You can significantly speed up your build and guard against fetcher
248*4882a593Smuzhiyun      failures by using :ref:`overview-manual/concepts:shared state cache`
249*4882a593Smuzhiyun      mirrors and enabling :ref:`overview-manual/concepts:hash equivalence`.
250*4882a593Smuzhiyun      This way, you can use pre-built artifacts rather than building them.
251*4882a593Smuzhiyun      This is relevant only when your network and the server that you use
252*4882a593Smuzhiyun      can download these artifacts faster than you would be able to build them.
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun      To use such mirrors, uncomment the below lines in your ``conf/local.conf``
255*4882a593Smuzhiyun      file in the :term:`Build Directory`::
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun         BB_SIGNATURE_HANDLER = "OEEquivHash"
258*4882a593Smuzhiyun         BB_HASHSERVE = "auto"
259*4882a593Smuzhiyun         BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
260*4882a593Smuzhiyun         SSTATE_MIRRORS ?= "file://.* https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
261*4882a593Smuzhiyun
262*4882a593Smuzhiyun#. **Start the Build:** Continue with the following command to build an OS
263*4882a593Smuzhiyun   image for the target, which is ``core-image-sato`` in this example:
264*4882a593Smuzhiyun
265*4882a593Smuzhiyun   .. code-block:: shell
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun      $ bitbake core-image-sato
268*4882a593Smuzhiyun
269*4882a593Smuzhiyun   For information on using the ``bitbake`` command, see the
270*4882a593Smuzhiyun   :ref:`overview-manual/concepts:bitbake` section in the Yocto Project Overview and
271*4882a593Smuzhiyun   Concepts Manual, or see
272*4882a593Smuzhiyun   :ref:`bitbake:bitbake-user-manual/bitbake-user-manual-intro:the bitbake command`
273*4882a593Smuzhiyun   in the BitBake User Manual.
274*4882a593Smuzhiyun
275*4882a593Smuzhiyun#. **Simulate Your Image Using QEMU:** Once this particular image is
276*4882a593Smuzhiyun   built, you can start QEMU, which is a Quick EMUlator that ships with
277*4882a593Smuzhiyun   the Yocto Project:
278*4882a593Smuzhiyun
279*4882a593Smuzhiyun   .. code-block:: shell
280*4882a593Smuzhiyun
281*4882a593Smuzhiyun      $ runqemu qemux86-64
282*4882a593Smuzhiyun
283*4882a593Smuzhiyun   If you want to learn more about running QEMU, see the
284*4882a593Smuzhiyun   :ref:`dev-manual/qemu:using the quick emulator (qemu)` chapter in
285*4882a593Smuzhiyun   the Yocto Project Development Tasks Manual.
286*4882a593Smuzhiyun
287*4882a593Smuzhiyun#. **Exit QEMU:** Exit QEMU by either clicking on the shutdown icon or by typing
288*4882a593Smuzhiyun   ``Ctrl-C`` in the QEMU transcript window from which you evoked QEMU.
289*4882a593Smuzhiyun
290*4882a593SmuzhiyunCustomizing Your Build for Specific Hardware
291*4882a593Smuzhiyun============================================
292*4882a593Smuzhiyun
293*4882a593SmuzhiyunSo far, all you have done is quickly built an image suitable for
294*4882a593Smuzhiyunemulation only. This section shows you how to customize your build for
295*4882a593Smuzhiyunspecific hardware by adding a hardware layer into the Yocto Project
296*4882a593Smuzhiyundevelopment environment.
297*4882a593Smuzhiyun
298*4882a593SmuzhiyunIn general, layers are repositories that contain related sets of
299*4882a593Smuzhiyuninstructions and configurations that tell the Yocto Project what to do.
300*4882a593SmuzhiyunIsolating related metadata into functionally specific layers facilitates
301*4882a593Smuzhiyunmodular development and makes it easier to reuse the layer metadata.
302*4882a593Smuzhiyun
303*4882a593Smuzhiyun.. note::
304*4882a593Smuzhiyun
305*4882a593Smuzhiyun   By convention, layer names start with the string "meta-".
306*4882a593Smuzhiyun
307*4882a593SmuzhiyunFollow these steps to add a hardware layer:
308*4882a593Smuzhiyun
309*4882a593Smuzhiyun#. **Find a Layer:** Many hardware layers are available. The Yocto Project
310*4882a593Smuzhiyun   :yocto_git:`Source Repositories <>` has many hardware layers.
311*4882a593Smuzhiyun   This example adds the
312*4882a593Smuzhiyun   `meta-altera <https://github.com/kraj/meta-altera>`__ hardware layer.
313*4882a593Smuzhiyun
314*4882a593Smuzhiyun#. **Clone the Layer:** Use Git to make a local copy of the layer on your
315*4882a593Smuzhiyun   machine. You can put the copy in the top level of the copy of the
316*4882a593Smuzhiyun   Poky repository created earlier:
317*4882a593Smuzhiyun
318*4882a593Smuzhiyun   .. code-block:: shell
319*4882a593Smuzhiyun
320*4882a593Smuzhiyun      $ cd poky
321*4882a593Smuzhiyun      $ git clone https://github.com/kraj/meta-altera.git
322*4882a593Smuzhiyun      Cloning into 'meta-altera'...
323*4882a593Smuzhiyun      remote: Counting objects: 25170, done.
324*4882a593Smuzhiyun      remote: Compressing objects: 100% (350/350), done.
325*4882a593Smuzhiyun      remote: Total 25170 (delta 645), reused 719 (delta 538), pack-reused 24219
326*4882a593Smuzhiyun      Receiving objects: 100% (25170/25170), 41.02 MiB | 1.64 MiB/s, done.
327*4882a593Smuzhiyun      Resolving deltas: 100% (13385/13385), done.
328*4882a593Smuzhiyun      Checking connectivity... done.
329*4882a593Smuzhiyun
330*4882a593Smuzhiyun   The hardware layer is now available
331*4882a593Smuzhiyun   next to other layers inside the Poky reference repository on your build
332*4882a593Smuzhiyun   host as ``meta-altera`` and contains all the metadata needed to
333*4882a593Smuzhiyun   support hardware from Altera, which is owned by Intel.
334*4882a593Smuzhiyun
335*4882a593Smuzhiyun   .. note::
336*4882a593Smuzhiyun
337*4882a593Smuzhiyun      It is recommended for layers to have a branch per Yocto Project release.
338*4882a593Smuzhiyun      Please make sure to checkout the layer branch supporting the Yocto Project
339*4882a593Smuzhiyun      release you're using.
340*4882a593Smuzhiyun
341*4882a593Smuzhiyun#. **Change the Configuration to Build for a Specific Machine:** The
342*4882a593Smuzhiyun   :term:`MACHINE` variable in the
343*4882a593Smuzhiyun   ``local.conf`` file specifies the machine for the build. For this
344*4882a593Smuzhiyun   example, set the :term:`MACHINE` variable to ``cyclone5``. These
345*4882a593Smuzhiyun   configurations are used:
346*4882a593Smuzhiyun   https://github.com/kraj/meta-altera/blob/master/conf/machine/cyclone5.conf.
347*4882a593Smuzhiyun
348*4882a593Smuzhiyun   .. note::
349*4882a593Smuzhiyun
350*4882a593Smuzhiyun      See the "Examine Your Local Configuration File" step earlier for more
351*4882a593Smuzhiyun      information on configuring the build.
352*4882a593Smuzhiyun
353*4882a593Smuzhiyun#. **Add Your Layer to the Layer Configuration File:** Before you can use
354*4882a593Smuzhiyun   a layer during a build, you must add it to your ``bblayers.conf``
355*4882a593Smuzhiyun   file, which is found in the
356*4882a593Smuzhiyun   :term:`Build Directory` ``conf``
357*4882a593Smuzhiyun   directory.
358*4882a593Smuzhiyun
359*4882a593Smuzhiyun   Use the ``bitbake-layers add-layer`` command to add the layer to the
360*4882a593Smuzhiyun   configuration file:
361*4882a593Smuzhiyun
362*4882a593Smuzhiyun   .. code-block:: shell
363*4882a593Smuzhiyun
364*4882a593Smuzhiyun      $ cd poky/build
365*4882a593Smuzhiyun      $ bitbake-layers add-layer ../meta-altera
366*4882a593Smuzhiyun      NOTE: Starting bitbake server...
367*4882a593Smuzhiyun      Parsing recipes: 100% |##################################################################| Time: 0:00:32
368*4882a593Smuzhiyun      Parsing of 918 .bb files complete (0 cached, 918 parsed). 1401 targets,
369*4882a593Smuzhiyun      123 skipped, 0 masked, 0 errors.
370*4882a593Smuzhiyun
371*4882a593Smuzhiyun   You can find
372*4882a593Smuzhiyun   more information on adding layers in the
373*4882a593Smuzhiyun   :ref:`dev-manual/common-tasks:adding a layer using the \`\`bitbake-layers\`\` script`
374*4882a593Smuzhiyun   section.
375*4882a593Smuzhiyun
376*4882a593SmuzhiyunCompleting these steps has added the ``meta-altera`` layer to your Yocto
377*4882a593SmuzhiyunProject development environment and configured it to build for the
378*4882a593Smuzhiyun``cyclone5`` machine.
379*4882a593Smuzhiyun
380*4882a593Smuzhiyun.. note::
381*4882a593Smuzhiyun
382*4882a593Smuzhiyun   The previous steps are for demonstration purposes only. If you were
383*4882a593Smuzhiyun   to attempt to build an image for the ``cyclone5`` machine, you should
384*4882a593Smuzhiyun   read the Altera ``README``.
385*4882a593Smuzhiyun
386*4882a593SmuzhiyunCreating Your Own General Layer
387*4882a593Smuzhiyun===============================
388*4882a593Smuzhiyun
389*4882a593SmuzhiyunMaybe you have an application or specific set of behaviors you need to
390*4882a593Smuzhiyunisolate. You can create your own general layer using the
391*4882a593Smuzhiyun``bitbake-layers create-layer`` command. The tool automates layer
392*4882a593Smuzhiyuncreation by setting up a subdirectory with a ``layer.conf``
393*4882a593Smuzhiyunconfiguration file, a ``recipes-example`` subdirectory that contains an
394*4882a593Smuzhiyun``example.bb`` recipe, a licensing file, and a ``README``.
395*4882a593Smuzhiyun
396*4882a593SmuzhiyunThe following commands run the tool to create a layer named
397*4882a593Smuzhiyun``meta-mylayer`` in the ``poky`` directory:
398*4882a593Smuzhiyun
399*4882a593Smuzhiyun.. code-block:: shell
400*4882a593Smuzhiyun
401*4882a593Smuzhiyun   $ cd poky
402*4882a593Smuzhiyun   $ bitbake-layers create-layer meta-mylayer
403*4882a593Smuzhiyun   NOTE: Starting bitbake server...
404*4882a593Smuzhiyun   Add your new layer with 'bitbake-layers add-layer meta-mylayer'
405*4882a593Smuzhiyun
406*4882a593SmuzhiyunFor more information
407*4882a593Smuzhiyunon layers and how to create them, see the
408*4882a593Smuzhiyun:ref:`dev-manual/common-tasks:creating a general layer using the \`\`bitbake-layers\`\` script`
409*4882a593Smuzhiyunsection in the Yocto Project Development Tasks Manual.
410*4882a593Smuzhiyun
411*4882a593SmuzhiyunWhere To Go Next
412*4882a593Smuzhiyun================
413*4882a593Smuzhiyun
414*4882a593SmuzhiyunNow that you have experienced using the Yocto Project, you might be
415*4882a593Smuzhiyunasking yourself "What now?". The Yocto Project has many sources of
416*4882a593Smuzhiyuninformation including the website, wiki pages, and user manuals:
417*4882a593Smuzhiyun
418*4882a593Smuzhiyun-  **Website:** The :yocto_home:`Yocto Project Website <>` provides
419*4882a593Smuzhiyun   background information, the latest builds, breaking news, full
420*4882a593Smuzhiyun   development documentation, and access to a rich Yocto Project
421*4882a593Smuzhiyun   Development Community into which you can tap.
422*4882a593Smuzhiyun
423*4882a593Smuzhiyun-  **Video Seminar:** The `Introduction to the Yocto Project and Bitbake, Part 1
424*4882a593Smuzhiyun   <https://youtu.be/yuE7my3KOpo>`__ and
425*4882a593Smuzhiyun   `Introduction to the Yocto Project and Bitbake, Part 2
426*4882a593Smuzhiyun   <https://youtu.be/iZ05TTyzGHk>`__ videos offer a video seminar
427*4882a593Smuzhiyun   introducing you to the most important aspects of developing a
428*4882a593Smuzhiyun   custom embedded Linux distribution with the Yocto Project.
429*4882a593Smuzhiyun
430*4882a593Smuzhiyun-  **Yocto Project Overview and Concepts Manual:** The
431*4882a593Smuzhiyun   :doc:`/overview-manual/index` is a great
432*4882a593Smuzhiyun   place to start to learn about the Yocto Project. This manual
433*4882a593Smuzhiyun   introduces you to the Yocto Project and its development environment.
434*4882a593Smuzhiyun   The manual also provides conceptual information for various aspects
435*4882a593Smuzhiyun   of the Yocto Project.
436*4882a593Smuzhiyun
437*4882a593Smuzhiyun-  **Yocto Project Wiki:** The :yocto_wiki:`Yocto Project Wiki <>`
438*4882a593Smuzhiyun   provides additional information on where to go next when ramping up
439*4882a593Smuzhiyun   with the Yocto Project, release information, project planning, and QA
440*4882a593Smuzhiyun   information.
441*4882a593Smuzhiyun
442*4882a593Smuzhiyun-  **Yocto Project Mailing Lists:** Related mailing lists provide a forum
443*4882a593Smuzhiyun   for discussion, patch submission and announcements. There are several
444*4882a593Smuzhiyun   mailing lists grouped by topic. See the
445*4882a593Smuzhiyun   :ref:`ref-manual/resources:mailing lists`
446*4882a593Smuzhiyun   section in the Yocto Project Reference Manual for a complete list of
447*4882a593Smuzhiyun   Yocto Project mailing lists.
448*4882a593Smuzhiyun
449*4882a593Smuzhiyun-  **Comprehensive List of Links and Other Documentation:** The
450*4882a593Smuzhiyun   :ref:`ref-manual/resources:links and related documentation`
451*4882a593Smuzhiyun   section in the Yocto Project Reference Manual provides a
452*4882a593Smuzhiyun   comprehensive list of all related links and other user documentation.
453*4882a593Smuzhiyun
454*4882a593Smuzhiyun.. include:: /boilerplate.rst
455