mirror of
https://git.yoctoproject.org/poky
synced 2026-04-20 00:32:13 +02:00
sphinx: import docs
The Yocto Project docs was migrated from Docbook to Sphinx in YP 3.2. This 3.1 is an LTS release, and since 3.1 docs are 'close to' the docs in 3.2, we agreed to backport sphinx docs onto 3.1. This first patch brings all changes done in 3.2 until: 7f64574f7 README: include detailed information about sphinx There are other changes after this commit, but they will be selectively backported in individual patches. This patch was generated with the following command: git cherry-pick -n \ $(git log --reverse --oneline \ ac352ad7f95db7eeacb53c2778caa31800bd7c26..7f64574f7 \ | cut -f1 -d' ') The following commits were applies in the dunfell docs, but not in master, so they were first reverted (and squashed into this change). A commit will reintroduce the content from these patches in the Sphinx files in a followup patch. 069c27574 Documenation: Prepared for the 3.1.1 release bd140f0f9 Documentation: Add 3.1.1 version updates missing from previous commit 17cc71a8f Documenation: Prepared for the 3.1.2 release 1a69e2c02 Documenation: Prepared for the 3.1.3 release 8910ac1c7 Documenation: Prepared for the 3.1.4 release (From yocto-docs rev: c25fe058b88b893b0d146f3ed27320b47cdec236) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a038e58f3c
commit
fa0cb4d34b
1
documentation/.gitignore
vendored
Normal file
1
documentation/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_build/
|
||||
@@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
#
|
||||
# This is a single Makefile to handle all generated Yocto Project documents,
|
||||
# which includes the BitBake User Manual and the Toaster User Manual.
|
||||
# The Makefile needs to live in the documents directory and all figures used
|
||||
@@ -137,32 +140,10 @@ ALLPREQ = html tarball
|
||||
# This would be appropriate for "master" branch.
|
||||
#
|
||||
|
||||
ifeq ($(BRANCH),edison)
|
||||
TARFILES = dev-style.css dev-manual.html \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png \
|
||||
figures/dev-title.png figures/git-workflow.png \
|
||||
figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos-edison.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3-edison.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
else ifeq ($(BRANCH),denzil)
|
||||
TARFILES = dev-style.css dev-manual.html \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png \
|
||||
figures/dev-title.png figures/git-workflow.png \
|
||||
figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos-denzil.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3-denzil.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
else
|
||||
TARFILES = dev-style.css dev-manual.html figures/buildhistory-web.png \
|
||||
figures/dev-title.png figures/buildhistory.png \
|
||||
figures/recipe-workflow.png figures/bitbake-build-flow.png \
|
||||
figures/multiconfig_files.png figures/cute-files-npm-example.png
|
||||
endif
|
||||
|
||||
MANUALS = $(DOC)/$(DOC).html
|
||||
FIGURES = figures
|
||||
@@ -178,37 +159,6 @@ XSLTOPTS = --stringparam html.stylesheet mega-style.css \
|
||||
--xinclude
|
||||
ALLPREQ = html tarball
|
||||
|
||||
ifeq ($(BRANCH),edison)
|
||||
TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
|
||||
figures/building-an-image.png \
|
||||
figures/using-a-pre-built-image.png \
|
||||
figures/poky-title.png \
|
||||
figures/adt-title.png figures/bsp-title.png \
|
||||
figures/kernel-title.png figures/kernel-architecture-overview.png \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png \
|
||||
figures/dev-title.png figures/git-workflow.png \
|
||||
figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos-edison.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3-edison.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
else ifeq ($(BRANCH),denzil)
|
||||
TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
|
||||
figures/building-an-image.png \
|
||||
figures/using-a-pre-built-image.png \
|
||||
figures/poky-title.png \
|
||||
figures/adt-title.png figures/bsp-title.png \
|
||||
figures/kernel-title.png figures/kernel-architecture-overview.png \
|
||||
figures/app-dev-flow.png figures/bsp-dev-flow.png \
|
||||
figures/dev-title.png figures/git-workflow.png \
|
||||
figures/index-downloads.png figures/kernel-dev-flow.png \
|
||||
figures/kernel-example-repos-denzil.png \
|
||||
figures/kernel-overview-1.png figures/kernel-overview-2.png \
|
||||
figures/kernel-overview-3-denzil.png \
|
||||
figures/source-repos.png figures/yp-download.png \
|
||||
figures/wip.png
|
||||
else
|
||||
TARFILES = mega-manual.html mega-style.css \
|
||||
figures/YP-flow-diagram.png \
|
||||
figures/using-a-pre-built-image.png \
|
||||
@@ -266,7 +216,6 @@ TARFILES = mega-manual.html mega-style.css \
|
||||
figures/sdk-devtool-upgrade-flow.png figures/bitbake-build-flow.png figures/bypqs-title.png \
|
||||
figures/overview-manual-title.png figures/sdk-autotools-flow.png figures/sdk-makefile-flow.png \
|
||||
figures/bb_multiconfig_files.png figures/bitbake-title.png figures/cute-files-npm-example.png
|
||||
endif
|
||||
|
||||
MANUALS = $(DOC)/$(DOC).html
|
||||
FIGURES = figures
|
||||
@@ -355,6 +304,16 @@ STYLESHEET = $(DOC)/*.css
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(DOC),test-manual)
|
||||
XSLTOPTS = --xinclude
|
||||
ALLPREQ = html tarball
|
||||
TARFILES = test-manual.html test-manual-style.css \
|
||||
figures/test-manual-title.png figures/ab-test-cluster.png
|
||||
MANUALS = $(DOC)/$(DOC).html
|
||||
FIGURES = figures
|
||||
STYLESHEET = $(DOC)/*.css
|
||||
endif
|
||||
|
||||
##
|
||||
# These URI should be rewritten by your distribution's xml catalog to
|
||||
# match your locally installed XSL stylesheets.
|
||||
|
||||
35
documentation/Makefile.sphinx
Normal file
35
documentation/Makefile.sphinx
Normal file
@@ -0,0 +1,35 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
DESTDIR = final
|
||||
|
||||
ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
|
||||
$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
|
||||
endif
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile.sphinx clean publish
|
||||
|
||||
publish: Makefile.sphinx html singlehtml
|
||||
rm -rf $(BUILDDIR)/$(DESTDIR)/
|
||||
mkdir -p $(BUILDDIR)/$(DESTDIR)/
|
||||
cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/
|
||||
cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html
|
||||
sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILDDIR)
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile.sphinx
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@@ -40,16 +40,11 @@ Folders exist for individual manuals as follows:
|
||||
* kernel-dev - The Yocto Project Linux Kernel Development Tasks Manual
|
||||
* ref-manual - The Yocto Project Reference Manual
|
||||
* yocto-project-qs - The Yocto Project Quick Start
|
||||
* mega-manual - The Yocto Project Mega-Manual, which is an aggregated manual comprised
|
||||
of all YP manuals and guides
|
||||
* profile-manual - The Yocto Project Profile and Tracing Manual
|
||||
* toaster-manual - The Toaster Manual
|
||||
* test-manual - The Test Environment Manual
|
||||
|
||||
Each folder is self-contained regarding content and figures. Note that there
|
||||
is a sed file needed to process the links of the mega-manual. The sed file
|
||||
is located in the tools directory. Also note that the figures folder in the
|
||||
mega-manual directory contains duplicates of all the figures in the YP folders
|
||||
directories for all YP manuals and guides.
|
||||
Each folder is self-contained regarding content and figures.
|
||||
|
||||
If you want to find HTML versions of the Yocto Project manuals on the web,
|
||||
go to http://www.yoctoproject.org and click on the "Documentation" tab. From
|
||||
@@ -60,23 +55,8 @@ currently being developed.
|
||||
In general, the Yocto Project site (http://www.yoctoproject.org) is a great
|
||||
reference for both information and downloads.
|
||||
|
||||
Makefile
|
||||
========
|
||||
|
||||
The Makefile processes manual directories to create HTML, PDF,
|
||||
tarballs, etc. Details on how the Makefile work are documented
|
||||
inside the Makefile. See that file for more information.
|
||||
|
||||
To build a manual, you run the make command and pass it the name
|
||||
of the folder containing the manual's contents.
|
||||
For example, the following command run from the documentation directory
|
||||
creates an HTML version of the SDK manual.
|
||||
The DOC variable specifies the manual you are making:
|
||||
|
||||
$ make DOC=sdk-manual
|
||||
|
||||
poky.ent
|
||||
========
|
||||
poky.yaml
|
||||
=========
|
||||
|
||||
This file defines variables used for documentation production. The variables
|
||||
are used to define release pathnames, URLs for the published manuals, etc.
|
||||
@@ -85,9 +65,256 @@ template
|
||||
========
|
||||
Contains various templates, fonts, and some old PNG files.
|
||||
|
||||
tools
|
||||
=====
|
||||
Contains a tool to convert the DocBook files to PDF format. This folder also
|
||||
contains the mega-manual.sed file, which is used by Makefile to process
|
||||
cross-references from within the manual that normally go to an external
|
||||
manual.
|
||||
Sphinx
|
||||
======
|
||||
|
||||
The Yocto Project documentation was migrated from the original DocBook
|
||||
format to Sphinx based documentation for the Yocto Project 3.2
|
||||
release. This section will provide additional information related to
|
||||
the Sphinx migration, and guidelines for developers willing to
|
||||
contribute to the Yocto Project documentation.
|
||||
|
||||
Sphinx is a tool that makes it easy to create intelligent and
|
||||
beautiful documentation, written by Georg Brandl and licensed under
|
||||
the BSD license. It was originally created for the Python
|
||||
documentation.
|
||||
|
||||
Extensive documentation is available on the Sphinx website:
|
||||
https://www.sphinx-doc.org/en/master/. Sphinx is designed to be
|
||||
extensible thanks to the ability to write our own custom extensions,
|
||||
as Python modules, which will be executed during the generation of the
|
||||
documentation.
|
||||
|
||||
Yocto Project documentation website
|
||||
===================================
|
||||
|
||||
A new website has been created to host the Yocto Project
|
||||
documentation, it can be found at: https://docs.yoctoproject.org/.
|
||||
|
||||
The entire Yocto Project documentation, as well as the BitBake manual
|
||||
is published on this website, including all previously released
|
||||
versions. A version switcher was added, as a drop-down menu on the top
|
||||
of the page to switch back and forth between the various versions of
|
||||
the current active Yocto Project releases.
|
||||
|
||||
Transition pages have been added (as rst file) to show links to old
|
||||
versions of the Yocto Project documentation with links to each manual
|
||||
generated with DocBook.
|
||||
|
||||
How to build the Yocto Project documentation
|
||||
============================================
|
||||
|
||||
Sphinx is written in Python. While it might work with Python2, for
|
||||
obvious reasons, we will only support building the Yocto Project
|
||||
documentation with Python3.
|
||||
|
||||
Sphinx might be available in your Linux distro packages repositories,
|
||||
however it is not recommend using distro packages, as they might be
|
||||
old versions, especially if you are using an LTS version of your
|
||||
distro. The recommended method to install Sphinx and all required
|
||||
dependencies is to use the Python Package Index (pip).
|
||||
|
||||
To install all required packages run:
|
||||
|
||||
$ pip3 install sphinx sphinx_rtd_theme pyyaml
|
||||
|
||||
To build the documentation locally, run:
|
||||
|
||||
$ cd documentation
|
||||
$ make -f Makefile.sphinx html
|
||||
|
||||
The resulting HTML index page will be _build/html/index.html, and you
|
||||
can browse your own copy of the locally generated documentation with
|
||||
your browser.
|
||||
|
||||
Sphinx theme and CSS customization
|
||||
==================================
|
||||
|
||||
The Yocto Project documentation is currently based on the "Read the
|
||||
Docs" Sphinx theme, with a few changes to make sure the look and feel
|
||||
of the project documentation is preserved.
|
||||
|
||||
Most of the theme changes can be done using the file
|
||||
'sphinx-static/theme_overrides.css'. Most CSS changes in this file
|
||||
were inherited from the DocBook CSS stylesheets.
|
||||
|
||||
Sphinx design guidelines and principles
|
||||
=======================================
|
||||
|
||||
The initial Docbook to Sphinx migration was done with an automated
|
||||
tool called Pandoc (https://pandoc.org/). The tool produced some clean
|
||||
output markdown text files. After the initial automated conversion
|
||||
additional changes were done to fix up headings, images and links. In
|
||||
addition Sphinx has built in mechanisms (directives) which were used
|
||||
to replace similar functions implemented in Docbook such as glossary,
|
||||
variables substitutions, notes and references.
|
||||
|
||||
Headings
|
||||
========
|
||||
|
||||
The layout of the Yocto Project manuals is organized as follows
|
||||
|
||||
Book
|
||||
Chapter
|
||||
Section
|
||||
Section
|
||||
Section
|
||||
|
||||
The following headings styles are defined in Sphinx:
|
||||
|
||||
Book => overline ===
|
||||
Chapter => overline ***
|
||||
Section => ====
|
||||
Section => ----
|
||||
Section => ^^^^
|
||||
Section => """" or ~~~~
|
||||
|
||||
With this proposal, we preserve the same TOCs between Sphinx and Docbook.
|
||||
|
||||
Built-in glossary
|
||||
=================
|
||||
|
||||
Sphinx has a glossary directive. From
|
||||
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#glossary:
|
||||
|
||||
This directive must contain a reST definition list with terms and
|
||||
definitions. The definitions will then be referencable with the
|
||||
[https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-term
|
||||
'term' role].
|
||||
|
||||
So anywhere in any of the Yocto Project manuals, :term:`VAR` can be
|
||||
used to refer to an item from the glossary, and a link is created
|
||||
automatically. A general index of terms is also generated by Sphinx
|
||||
automatically.
|
||||
|
||||
Global substitutions
|
||||
====================
|
||||
|
||||
The Yocto Project documentation makes heavy use of global
|
||||
variables. In Docbook these variables are stored in the file
|
||||
poky.ent. This Docbook feature is not handled automatically with
|
||||
Pandoc. Sphinx has builtin support for substitutions
|
||||
(https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#substitutions),
|
||||
however there are important shortcomings. For example they cannot be
|
||||
used/nested inside code-block sections.
|
||||
|
||||
A Sphinx extension was implemented to support variable substitutions
|
||||
to mimic the DocBook based documentation behavior. Variabes
|
||||
substitutions are done while reading/parsing the .rst files. The
|
||||
pattern for variables substitutions is the same as with DocBook,
|
||||
e.g. `&VAR;`.
|
||||
|
||||
The implementation of the extension can be found here in the file
|
||||
documentation/sphinx/yocto-vars.py, this extension is enabled by
|
||||
default when building the Yocto Project documentation. All variables
|
||||
are set in a file call poky.yaml, which was initially generated from
|
||||
poky.ent. The file was converted into YAML so that it is easier to
|
||||
process by the custom Sphinx extension (which is a Python module).
|
||||
|
||||
For example, the following .rst content will produce the 'expected'
|
||||
content:
|
||||
|
||||
.. code-block::
|
||||
$ mkdir ~/poky-&DISTRO;
|
||||
or
|
||||
$ git clone &YOCTO_GIT_URL;/git/poky -b &DISTRO_NAME_NO_CAP;
|
||||
|
||||
Variables can be nested, like it was the case for DocBook:
|
||||
|
||||
YOCTO_HOME_URL : "http://www.yoctoproject.org"
|
||||
YOCTO_DOCS_URL : "&YOCTO_HOME_URL;/docs"
|
||||
|
||||
Note directive
|
||||
==============
|
||||
|
||||
Sphinx has a builtin 'note' directive that produces clean Note section
|
||||
in the output file. There are various types of directives such as
|
||||
"attention", "caution", "danger", "error", "hint", "important", "tip",
|
||||
"warning", "admonition" that are supported, and additional directive
|
||||
can be added as Sphinx extension if needed.
|
||||
|
||||
Figures
|
||||
=======
|
||||
|
||||
The Yocto Project documentation has many figures/images. Sphinx has a
|
||||
'figure' directive which is straight forward to use. To include a
|
||||
figure in the body of the documentation:
|
||||
|
||||
.. image:: figures/YP-flow-diagram.png
|
||||
|
||||
Links and References
|
||||
====================
|
||||
|
||||
The following types of links can be used: links to other locations in
|
||||
the same document, to locations in other documents and to external
|
||||
websites.
|
||||
|
||||
More information can be found here:
|
||||
https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html.
|
||||
|
||||
References
|
||||
==========
|
||||
|
||||
The following extension is enabed by default:
|
||||
sphinx.ext.autosectionlabel
|
||||
(https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html).
|
||||
|
||||
This extension allows you to refer sections by their titles. Note that
|
||||
autosectionlabel_prefix_document is enabled by default, so that we can
|
||||
insert references from any document.
|
||||
|
||||
For example, to insert an HTML link to a section from
|
||||
documentaion/manual/intro.rst, use:
|
||||
|
||||
Please check this :ref:`manual/intro:Cross-References to Locations in the Same Document`
|
||||
|
||||
Alternatively a custom text can be used instead of using the section
|
||||
text:
|
||||
|
||||
Please check this :ref:`section <manual/intro:Cross-References to Locations in the Same Document>`
|
||||
|
||||
TIP: The following command can be used to dump all the references that
|
||||
are defined in the project documentation:
|
||||
|
||||
python -msphinx.ext.intersphinx <path to build folder>/html/objects.inv
|
||||
|
||||
This dump contains all links and for each link it shows the default
|
||||
"Link Text" that Sphinx would use. If the default link text is not
|
||||
appropriate, a custom link text can be used in the ':ref:' directive.
|
||||
|
||||
Extlinks
|
||||
========
|
||||
|
||||
The sphinx.ext.extlinks extension is enabled by default
|
||||
(https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#use-the-external-links-extension),
|
||||
and it is configured with:
|
||||
|
||||
'yocto_home': ('https://yoctoproject.org%s', None),
|
||||
'yocto_wiki': ('https://wiki.yoctoproject.org%s', None),
|
||||
'yocto_dl': ('https://downloads.yoctoproject.org%s', None),
|
||||
'yocto_lists': ('https://lists.yoctoproject.org%s', None),
|
||||
'yocto_bugs': ('https://bugzilla.yoctoproject.org%s', None),
|
||||
'yocto_ab': ('https://autobuilder.yoctoproject.org%s', None),
|
||||
'yocto_docs': ('https://docs.yoctoproject.org%s', None),
|
||||
'yocto_git': ('https://git.yoctoproject.org%s', None),
|
||||
'oe_home': ('https://www.openembedded.org%s', None),
|
||||
'oe_lists': ('https://lists.openembedded.org%s', None),
|
||||
|
||||
It creates convenient shortcuts which can be used throughout the
|
||||
documentation rst files, as:
|
||||
|
||||
Please check this :yocto_wiki:`wiki page </Weekly_Status>`
|
||||
|
||||
Intersphinx links
|
||||
=================
|
||||
|
||||
The sphinx.ext.intersphinx extension is enabled by default
|
||||
(https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html),
|
||||
so that we can cross reference content from other Sphinx based
|
||||
documentation projects, such as the BitBake manual.
|
||||
|
||||
References to the bitbake manual can be done like this:
|
||||
|
||||
See the ":ref:`-D <bitbake:bitbake-user-manual/bitbake-user-manual-intro:usage and syntax>`" option
|
||||
or
|
||||
:term:`bitbake:BB_NUMBER_PARSE_THREADS`
|
||||
|
||||
14
documentation/_templates/breadcrumbs.html
Normal file
14
documentation/_templates/breadcrumbs.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "!breadcrumbs.html" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<li>
|
||||
<span class="doctype_switcher_placeholder">{{ doctype or 'single' }}</span>
|
||||
<span class="version_switcher_placeholder">{{ release }}</span>
|
||||
</li>
|
||||
<li> »</li>
|
||||
{% for doc in parents %}
|
||||
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> »</li>
|
||||
{% endfor %}
|
||||
<li>{{ title }}</li>
|
||||
{% endblock %}
|
||||
|
||||
7
documentation/_templates/layout.html
Normal file
7
documentation/_templates/layout.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "!layout.html" %}
|
||||
|
||||
{% block extrabody %}
|
||||
<div id="outdated-warning" style="text-align: center; background-color: #FFBABA; color: #6A0E0E;">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
180
documentation/adt-manual/adt-command.rst
Normal file
180
documentation/adt-manual/adt-command.rst
Normal file
@@ -0,0 +1,180 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
**********************
|
||||
Using the Command Line
|
||||
**********************
|
||||
|
||||
Recall that earlier the manual discussed how to use an existing
|
||||
toolchain tarball that had been installed into the default installation
|
||||
directory, ``/opt/poky/DISTRO``, which is outside of the :term:`Build Directory`
|
||||
(see the section
|
||||
"`Using a Cross-Toolchain
|
||||
Tarball) <#using-an-existing-toolchain-tarball>`__". And, that sourcing
|
||||
your architecture-specific environment setup script initializes a
|
||||
suitable cross-toolchain development environment.
|
||||
|
||||
During this setup, locations for the compiler, QEMU scripts, QEMU
|
||||
binary, a special version of ``pkgconfig`` and other useful utilities
|
||||
are added to the ``PATH`` variable. Also, variables to assist
|
||||
``pkgconfig`` and ``autotools`` are also defined so that, for example,
|
||||
``configure.sh`` can find pre-generated test results for tests that need
|
||||
target hardware on which to run. You can see the "`Setting Up the
|
||||
Cross-Development
|
||||
Environment <#setting-up-the-cross-development-environment>`__" section
|
||||
for the list of cross-toolchain environment variables established by the
|
||||
script.
|
||||
|
||||
Collectively, these conditions allow you to easily use the toolchain
|
||||
outside of the OpenEmbedded build environment on both Autotools-based
|
||||
projects and Makefile-based projects. This chapter provides information
|
||||
for both these types of projects.
|
||||
|
||||
Autotools-Based Projects
|
||||
========================
|
||||
|
||||
Once you have a suitable cross-toolchain installed, it is very easy to
|
||||
develop a project outside of the OpenEmbedded build system. This section
|
||||
presents a simple "Helloworld" example that shows how to set up,
|
||||
compile, and run the project.
|
||||
|
||||
Creating and Running a Project Based on GNU Autotools
|
||||
-----------------------------------------------------
|
||||
|
||||
Follow these steps to create a simple Autotools-based project:
|
||||
|
||||
1. *Create your directory:* Create a clean directory for your project
|
||||
and then make that directory your working location: $ mkdir
|
||||
$HOME/helloworld $ cd $HOME/helloworld
|
||||
|
||||
2. *Populate the directory:* Create ``hello.c``, ``Makefile.am``, and
|
||||
``configure.in`` files as follows:
|
||||
|
||||
- For ``hello.c``, include these lines: #include <stdio.h> main() {
|
||||
printf("Hello World!\n"); }
|
||||
|
||||
- For ``Makefile.am``, include these lines: bin_PROGRAMS = hello
|
||||
hello_SOURCES = hello.c
|
||||
|
||||
- For ``configure.in``, include these lines: AC_INIT(hello.c)
|
||||
AM_INIT_AUTOMAKE(hello,0.1) AC_PROG_CC AC_PROG_INSTALL
|
||||
AC_OUTPUT(Makefile)
|
||||
|
||||
3. *Source the cross-toolchain environment setup file:* Installation of
|
||||
the cross-toolchain creates a cross-toolchain environment setup
|
||||
script in the directory that the ADT was installed. Before you can
|
||||
use the tools to develop your project, you must source this setup
|
||||
script. The script begins with the string "environment-setup" and
|
||||
contains the machine architecture, which is followed by the string
|
||||
"poky-linux". Here is an example that sources a script from the
|
||||
default ADT installation directory that uses the 32-bit Intel x86
|
||||
Architecture and the DISTRO_NAME Yocto Project release: $ source
|
||||
/opt/poky/DISTRO/environment-setup-i586-poky-linux
|
||||
|
||||
4. *Generate the local aclocal.m4 files and create the configure
|
||||
script:* The following GNU Autotools generate the local
|
||||
``aclocal.m4`` files and create the configure script: $ aclocal $
|
||||
autoconf
|
||||
|
||||
5. *Generate files needed by GNU coding standards:* GNU coding
|
||||
standards require certain files in order for the project to be
|
||||
compliant. This command creates those files: $ touch NEWS README
|
||||
AUTHORS ChangeLog
|
||||
|
||||
6. *Generate the configure file:* This command generates the
|
||||
``configure``: $ automake -a
|
||||
|
||||
7. *Cross-compile the project:* This command compiles the project using
|
||||
the cross-compiler. The
|
||||
:term:`CONFIGURE_FLAGS`
|
||||
environment variable provides the minimal arguments for GNU
|
||||
configure: $ ./configure ${CONFIGURE_FLAGS}
|
||||
|
||||
8. *Make and install the project:* These two commands generate and
|
||||
install the project into the destination directory: $ make $ make
|
||||
install DESTDIR=./tmp
|
||||
|
||||
9. *Verify the installation:* This command is a simple way to verify
|
||||
the installation of your project. Running the command prints the
|
||||
architecture on which the binary file can run. This architecture
|
||||
should be the same architecture that the installed cross-toolchain
|
||||
supports. $ file ./tmp/usr/local/bin/hello
|
||||
|
||||
10. *Execute your project:* To execute the project in the shell, simply
|
||||
enter the name. You could also copy the binary to the actual target
|
||||
hardware and run the project there as well: $ ./hello As expected,
|
||||
the project displays the "Hello World!" message.
|
||||
|
||||
Passing Host Options
|
||||
--------------------
|
||||
|
||||
For an Autotools-based project, you can use the cross-toolchain by just
|
||||
passing the appropriate host option to ``configure.sh``. The host option
|
||||
you use is derived from the name of the environment setup script found
|
||||
in the directory in which you installed the cross-toolchain. For
|
||||
example, the host option for an ARM-based target that uses the GNU EABI
|
||||
is ``armv5te-poky-linux-gnueabi``. You will notice that the name of the
|
||||
script is ``environment-setup-armv5te-poky-linux-gnueabi``. Thus, the
|
||||
following command works to update your project and rebuild it using the
|
||||
appropriate cross-toolchain tools: $ ./configure
|
||||
--host=armv5te-poky-linux-gnueabi \\ --with-libtool-sysroot=sysroot_dir
|
||||
|
||||
.. note::
|
||||
|
||||
If the
|
||||
configure
|
||||
script results in problems recognizing the
|
||||
--with-libtool-sysroot=
|
||||
sysroot-dir
|
||||
option, regenerate the script to enable the support by doing the
|
||||
following and then run the script again:
|
||||
::
|
||||
|
||||
$ libtoolize --automake
|
||||
$ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \
|
||||
[-I dir_containing_your_project-specific_m4_macros]
|
||||
$ autoconf
|
||||
$ autoheader
|
||||
$ automake -a
|
||||
|
||||
|
||||
Makefile-Based Projects
|
||||
=======================
|
||||
|
||||
For Makefile-based projects, the cross-toolchain environment variables
|
||||
established by running the cross-toolchain environment setup script are
|
||||
subject to general ``make`` rules.
|
||||
|
||||
To illustrate this, consider the following four cross-toolchain
|
||||
environment variables:
|
||||
:term:`CC`\ =i586-poky-linux-gcc -m32
|
||||
-march=i586 --sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
|
||||
:term:`LD`\ =i586-poky-linux-ld
|
||||
--sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
|
||||
:term:`CFLAGS`\ =-O2 -pipe -g
|
||||
-feliminate-unused-debug-types
|
||||
:term:`CXXFLAGS`\ =-O2 -pipe -g
|
||||
-feliminate-unused-debug-types Now, consider the following three cases:
|
||||
|
||||
- *Case 1 - No Variables Set in the ``Makefile``:* Because these
|
||||
variables are not specifically set in the ``Makefile``, the variables
|
||||
retain their values based on the environment.
|
||||
|
||||
- *Case 2 - Variables Set in the ``Makefile``:* Specifically setting
|
||||
variables in the ``Makefile`` during the build results in the
|
||||
environment settings of the variables being overwritten.
|
||||
|
||||
- *Case 3 - Variables Set when the ``Makefile`` is Executed from the
|
||||
Command Line:* Executing the ``Makefile`` from the command line
|
||||
results in the variables being overwritten with command-line content
|
||||
regardless of what is being set in the ``Makefile``. In this case,
|
||||
environment variables are not considered unless you use the "-e" flag
|
||||
during the build: $ make -e file If you use this flag, then the
|
||||
environment values of the variables override any variables
|
||||
specifically set in the ``Makefile``.
|
||||
|
||||
.. note::
|
||||
|
||||
For the list of variables set up by the cross-toolchain environment
|
||||
setup script, see the "
|
||||
Setting Up the Cross-Development Environment
|
||||
" section.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='using-the-command-line'>
|
||||
<title>Using the Command Line</title>
|
||||
|
||||
138
documentation/adt-manual/adt-intro.rst
Normal file
138
documentation/adt-manual/adt-intro.rst
Normal file
@@ -0,0 +1,138 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*****************************************
|
||||
The Application Development Toolkit (ADT)
|
||||
*****************************************
|
||||
|
||||
Part of the Yocto Project development solution is an Application
|
||||
Development Toolkit (ADT). The ADT provides you with a custom-built,
|
||||
cross-development platform suited for developing a user-targeted product
|
||||
application.
|
||||
|
||||
Fundamentally, the ADT consists of the following:
|
||||
|
||||
- An architecture-specific cross-toolchain and matching sysroot both
|
||||
built by the :term:`OpenEmbedded Build System`.
|
||||
The toolchain and
|
||||
sysroot are based on a `Metadata <&YOCTO_DOCS_DEV_URL;#metadata>`__
|
||||
configuration and extensions, which allows you to cross-develop on
|
||||
the host machine for the target hardware.
|
||||
|
||||
- The Eclipse IDE Yocto Plug-in.
|
||||
|
||||
- The Quick EMUlator (QEMU), which lets you simulate target hardware.
|
||||
|
||||
- Various user-space tools that greatly enhance your application
|
||||
development experience.
|
||||
|
||||
The Cross-Development Toolchain
|
||||
===============================
|
||||
|
||||
The `Cross-Development
|
||||
Toolchain <&YOCTO_DOCS_DEV_URL;#cross-development-toolchain>`__ consists
|
||||
of a cross-compiler, cross-linker, and cross-debugger that are used to
|
||||
develop user-space applications for targeted hardware. This toolchain is
|
||||
created either by running the ADT Installer script, a toolchain
|
||||
installer script, or through a :term:`Build Directory`
|
||||
that is based on
|
||||
your Metadata configuration or extension for your targeted device. The
|
||||
cross-toolchain works with a matching target sysroot.
|
||||
|
||||
Sysroot
|
||||
=======
|
||||
|
||||
The matching target sysroot contains needed headers and libraries for
|
||||
generating binaries that run on the target architecture. The sysroot is
|
||||
based on the target root filesystem image that is built by the
|
||||
OpenEmbedded build system and uses the same Metadata configuration used
|
||||
to build the cross-toolchain.
|
||||
|
||||
.. _eclipse-overview:
|
||||
|
||||
Eclipse Yocto Plug-in
|
||||
=====================
|
||||
|
||||
The Eclipse IDE is a popular development environment and it fully
|
||||
supports development using the Yocto Project. When you install and
|
||||
configure the Eclipse Yocto Project Plug-in into the Eclipse IDE, you
|
||||
maximize your Yocto Project experience. Installing and configuring the
|
||||
Plug-in results in an environment that has extensions specifically
|
||||
designed to let you more easily develop software. These extensions allow
|
||||
for cross-compilation, deployment, and execution of your output into a
|
||||
QEMU emulation session. You can also perform cross-debugging and
|
||||
profiling. The environment also supports a suite of tools that allows
|
||||
you to perform remote profiling, tracing, collection of power data,
|
||||
collection of latency data, and collection of performance data.
|
||||
|
||||
For information about the application development workflow that uses the
|
||||
Eclipse IDE and for a detailed example of how to install and configure
|
||||
the Eclipse Yocto Project Plug-in, see the "`Working Within
|
||||
Eclipse <&YOCTO_DOCS_DEV_URL;#adt-eclipse>`__" section of the Yocto
|
||||
Project Development Manual.
|
||||
|
||||
The QEMU Emulator
|
||||
=================
|
||||
|
||||
The QEMU emulator allows you to simulate your hardware while running
|
||||
your application or image. QEMU is made available a number of ways:
|
||||
|
||||
- If you use the ADT Installer script to install ADT, you can specify
|
||||
whether or not to install QEMU.
|
||||
|
||||
- If you have cloned the ``poky`` Git repository to create a
|
||||
:term:`Source Directory` and you have
|
||||
sourced the environment setup script, QEMU is installed and
|
||||
automatically available.
|
||||
|
||||
- If you have downloaded a Yocto Project release and unpacked it to
|
||||
create a :term:`Source Directory`
|
||||
and you have sourced the environment setup script, QEMU is installed
|
||||
and automatically available.
|
||||
|
||||
- If you have installed the cross-toolchain tarball and you have
|
||||
sourced the toolchain's setup environment script, QEMU is also
|
||||
installed and automatically available.
|
||||
|
||||
User-Space Tools
|
||||
================
|
||||
|
||||
User-space tools are included as part of the Yocto Project. You will
|
||||
find these tools helpful during development. The tools include
|
||||
LatencyTOP, PowerTOP, OProfile, Perf, SystemTap, and Lttng-ust. These
|
||||
tools are common development tools for the Linux platform.
|
||||
|
||||
- *LatencyTOP:* LatencyTOP focuses on latency that causes skips in
|
||||
audio, stutters in your desktop experience, or situations that
|
||||
overload your server even when you have plenty of CPU power left.
|
||||
|
||||
- *PowerTOP:* Helps you determine what software is using the most
|
||||
power. You can find out more about PowerTOP at
|
||||
https://01.org/powertop/.
|
||||
|
||||
- *OProfile:* A system-wide profiler for Linux systems that is capable
|
||||
of profiling all running code at low overhead. You can find out more
|
||||
about OProfile at http://oprofile.sourceforge.net/about/. For
|
||||
examples on how to setup and use this tool, see the
|
||||
"`OProfile <&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile>`__"
|
||||
section in the Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *Perf:* Performance counters for Linux used to keep track of certain
|
||||
types of hardware and software events. For more information on these
|
||||
types of counters see https://perf.wiki.kernel.org/. For
|
||||
examples on how to setup and use this tool, see the
|
||||
"`perf <&YOCTO_DOCS_PROF_URL;#profile-manual-perf>`__" section in the
|
||||
Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *SystemTap:* A free software infrastructure that simplifies
|
||||
information gathering about a running Linux system. This information
|
||||
helps you diagnose performance or functional problems. SystemTap is
|
||||
not available as a user-space tool through the Eclipse IDE Yocto
|
||||
Plug-in. See http://sourceware.org/systemtap for more
|
||||
information on SystemTap. For examples on how to setup and use this
|
||||
tool, see the
|
||||
"`SystemTap <&YOCTO_DOCS_PROF_URL;#profile-manual-systemtap>`__"
|
||||
section in the Yocto Project Profiling and Tracing Manual.
|
||||
|
||||
- *Lttng-ust:* A User-space Tracer designed to provide detailed
|
||||
information on user-space activity. See http://lttng.org/ust
|
||||
for more information on Lttng-ust.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='adt-intro'>
|
||||
<title>The Application Development Toolkit (ADT)</title>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
|
||||
24
documentation/adt-manual/adt-manual-intro.rst
Normal file
24
documentation/adt-manual/adt-manual-intro.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
************
|
||||
Introduction
|
||||
************
|
||||
|
||||
Welcome to the Yocto Project Application Developer's Guide. This manual
|
||||
provides information that lets you begin developing applications using
|
||||
the Yocto Project.
|
||||
|
||||
The Yocto Project provides an application development environment based
|
||||
on an Application Development Toolkit (ADT) and the availability of
|
||||
stand-alone cross-development toolchains and other tools. This manual
|
||||
describes the ADT and how you can configure and install it, how to
|
||||
access and use the cross-development toolchains, how to customize the
|
||||
development packages installation, how to use command-line development
|
||||
for both Autotools-based and Makefile-based projects, and an
|
||||
introduction to the Eclipse IDE Yocto Plug-in.
|
||||
|
||||
.. note::
|
||||
|
||||
The ADT is distribution-neutral and does not require the Yocto
|
||||
Project reference distribution, which is called Poky. This manual,
|
||||
however, uses examples that use the Poky distribution.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='adt-manual-intro'>
|
||||
<title>Introduction</title>
|
||||
|
||||
17
documentation/adt-manual/adt-manual.rst
Normal file
17
documentation/adt-manual/adt-manual.rst
Normal file
@@ -0,0 +1,17 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
===========================================
|
||||
Yocto Project Application Developer's Guide
|
||||
===========================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
adt-manual-intro
|
||||
adt-intro
|
||||
adt-prepare
|
||||
adt-package
|
||||
adt-command
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='adt-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
|
||||
70
documentation/adt-manual/adt-package.rst
Normal file
70
documentation/adt-manual/adt-package.rst
Normal file
@@ -0,0 +1,70 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
************************************************************
|
||||
Optionally Customizing the Development Packages Installation
|
||||
************************************************************
|
||||
|
||||
Because the Yocto Project is suited for embedded Linux development, it
|
||||
is likely that you will need to customize your development packages
|
||||
installation. For example, if you are developing a minimal image, then
|
||||
you might not need certain packages (e.g. graphics support packages).
|
||||
Thus, you would like to be able to remove those packages from your
|
||||
target sysroot.
|
||||
|
||||
Package Management Systems
|
||||
==========================
|
||||
|
||||
The OpenEmbedded build system supports the generation of sysroot files
|
||||
using three different Package Management Systems (PMS):
|
||||
|
||||
- *OPKG:* A less well known PMS whose use originated in the
|
||||
OpenEmbedded and OpenWrt embedded Linux projects. This PMS works with
|
||||
files packaged in an ``.ipk`` format. See
|
||||
http://en.wikipedia.org/wiki/Opkg for more information about
|
||||
OPKG.
|
||||
|
||||
- *RPM:* A more widely known PMS intended for GNU/Linux distributions.
|
||||
This PMS works with files packaged in an ``.rpm`` format. The build
|
||||
system currently installs through this PMS by default. See
|
||||
http://en.wikipedia.org/wiki/RPM_Package_Manager for more
|
||||
information about RPM.
|
||||
|
||||
- *Debian:* The PMS for Debian-based systems is built on many PMS
|
||||
tools. The lower-level PMS tool ``dpkg`` forms the base of the Debian
|
||||
PMS. For information on dpkg see
|
||||
http://en.wikipedia.org/wiki/Dpkg.
|
||||
|
||||
Configuring the PMS
|
||||
===================
|
||||
|
||||
Whichever PMS you are using, you need to be sure that the
|
||||
:term:`PACKAGE_CLASSES`
|
||||
variable in the ``conf/local.conf`` file is set to reflect that system.
|
||||
The first value you choose for the variable specifies the package file
|
||||
format for the root filesystem at sysroot. Additional values specify
|
||||
additional formats for convenience or testing. See the
|
||||
``conf/local.conf`` configuration file for details.
|
||||
|
||||
.. note::
|
||||
|
||||
For build performance information related to the PMS, see the "
|
||||
package.bbclass
|
||||
" section in the Yocto Project Reference Manual.
|
||||
|
||||
As an example, consider a scenario where you are using OPKG and you want
|
||||
to add the ``libglade`` package to the target sysroot.
|
||||
|
||||
First, you should generate the IPK file for the ``libglade`` package and
|
||||
add it into a working ``opkg`` repository. Use these commands: $ bitbake
|
||||
libglade $ bitbake package-index
|
||||
|
||||
Next, source the cross-toolchain environment setup script found in the
|
||||
:term:`Source Directory`. Follow
|
||||
that by setting up the installation destination to point to your sysroot
|
||||
as sysroot_dir. Finally, have an OPKG configuration file conf_file that
|
||||
corresponds to the ``opkg`` repository you have just created. The
|
||||
following command forms should now work: $ opkg-cl –f conf_file -o
|
||||
sysroot_dir update $ opkg-cl –f cconf_file -o sysroot_dir \\
|
||||
--force-overwrite install libglade $ opkg-cl –f cconf_file -o
|
||||
sysroot_dir \\ --force-overwrite install libglade-dbg $ opkg-cl –f
|
||||
conf_file> -osysroot_dir> \\ --force-overwrite install libglade-dev
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='adt-package'>
|
||||
<title>Optionally Customizing the Development Packages Installation</title>
|
||||
|
||||
752
documentation/adt-manual/adt-prepare.rst
Normal file
752
documentation/adt-manual/adt-prepare.rst
Normal file
@@ -0,0 +1,752 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*************************************
|
||||
Preparing for Application Development
|
||||
*************************************
|
||||
|
||||
In order to develop applications, you need set up your host development
|
||||
system. Several ways exist that allow you to install cross-development
|
||||
tools, QEMU, the Eclipse Yocto Plug-in, and other tools. This chapter
|
||||
describes how to prepare for application development.
|
||||
|
||||
.. _installing-the-adt:
|
||||
|
||||
Installing the ADT and Toolchains
|
||||
=================================
|
||||
|
||||
The following list describes installation methods that set up varying
|
||||
degrees of tool availability on your system. Regardless of the
|
||||
installation method you choose, you must ``source`` the cross-toolchain
|
||||
environment setup script, which establishes several key environment
|
||||
variables, before you use a toolchain. See the "`Setting Up the
|
||||
Cross-Development
|
||||
Environment <#setting-up-the-cross-development-environment>`__" section
|
||||
for more information.
|
||||
|
||||
.. note::
|
||||
|
||||
Avoid mixing installation methods when installing toolchains for
|
||||
different architectures. For example, avoid using the ADT Installer
|
||||
to install some toolchains and then hand-installing cross-development
|
||||
toolchains by running the toolchain installer for different
|
||||
architectures. Mixing installation methods can result in situations
|
||||
where the ADT Installer becomes unreliable and might not install the
|
||||
toolchain.
|
||||
|
||||
If you must mix installation methods, you might avoid problems by
|
||||
deleting ``/var/lib/opkg``, thus purging the ``opkg`` package
|
||||
metadata.
|
||||
|
||||
- *Use the ADT installer script:* This method is the recommended way to
|
||||
install the ADT because it automates much of the process for you. For
|
||||
example, you can configure the installation to install the QEMU
|
||||
emulator and the user-space NFS, specify which root filesystem
|
||||
profiles to download, and define the target sysroot location.
|
||||
|
||||
- *Use an existing toolchain:* Using this method, you select and
|
||||
download an architecture-specific toolchain installer and then run
|
||||
the script to hand-install the toolchain. If you use this method, you
|
||||
just get the cross-toolchain and QEMU - you do not get any of the
|
||||
other mentioned benefits had you run the ADT Installer script.
|
||||
|
||||
- *Use the toolchain from within the Build Directory:* If you already
|
||||
have a :term:`Build Directory`,
|
||||
you can build the cross-toolchain within the directory. However, like
|
||||
the previous method mentioned, you only get the cross-toolchain and
|
||||
QEMU - you do not get any of the other benefits without taking
|
||||
separate steps.
|
||||
|
||||
Using the ADT Installer
|
||||
-----------------------
|
||||
|
||||
To run the ADT Installer, you need to get the ADT Installer tarball, be
|
||||
sure you have the necessary host development packages that support the
|
||||
ADT Installer, and then run the ADT Installer Script.
|
||||
|
||||
For a list of the host packages needed to support ADT installation and
|
||||
use, see the "ADT Installer Extras" lists in the "`Required Packages for
|
||||
the Host Development
|
||||
System <&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system>`__"
|
||||
section of the Yocto Project Reference Manual.
|
||||
|
||||
Getting the ADT Installer Tarball
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The ADT Installer is contained in the ADT Installer tarball. You can get
|
||||
the tarball using either of these methods:
|
||||
|
||||
- *Download the Tarball:* You can download the tarball from
|
||||
` <&YOCTO_ADTINSTALLER_DL_URL;>`__ into any directory.
|
||||
|
||||
- *Build the Tarball:* You can use
|
||||
:term:`BitBake` to generate the
|
||||
tarball inside an existing :term:`Build Directory`.
|
||||
|
||||
If you use BitBake to generate the ADT Installer tarball, you must
|
||||
``source`` the environment setup script
|
||||
(````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the Source Directory before running the ``bitbake``
|
||||
command that creates the tarball.
|
||||
|
||||
The following example commands establish the
|
||||
:term:`Source Directory`, check out the
|
||||
current release branch, set up the build environment while also
|
||||
creating the default Build Directory, and run the ``bitbake`` command
|
||||
that results in the tarball
|
||||
``poky/build/tmp/deploy/sdk/adt_installer.tar.bz2``:
|
||||
|
||||
.. note::
|
||||
|
||||
Before using BitBake to build the ADT tarball, be sure to make
|
||||
sure your
|
||||
local.conf
|
||||
file is properly configured. See the "
|
||||
User Configuration
|
||||
" section in the Yocto Project Reference Manual for general
|
||||
configuration information.
|
||||
|
||||
$ cd ~ $ git clone git://git.yoctoproject.org/poky $ cd poky $ git
|
||||
checkout -b DISTRO_NAME origin/DISTRO_NAME $ source OE_INIT_FILE $
|
||||
bitbake adt-installer
|
||||
|
||||
Configuring and Running the ADT Installer Script
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Before running the ADT Installer script, you need to unpack the tarball.
|
||||
You can unpack the tarball in any directory you wish. For example, this
|
||||
command copies the ADT Installer tarball from where it was built into
|
||||
the home directory and then unpacks the tarball into a top-level
|
||||
directory named ``adt-installer``: $ cd ~ $ cp
|
||||
poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME $ tar -xjf
|
||||
adt_installer.tar.bz2 Unpacking it creates the directory
|
||||
``adt-installer``, which contains the ADT Installer script
|
||||
(``adt_installer``) and its configuration file (``adt_installer.conf``).
|
||||
|
||||
Before you run the script, however, you should examine the ADT Installer
|
||||
configuration file and be sure you are going to get what you want. Your
|
||||
configurations determine which kernel and filesystem image are
|
||||
downloaded.
|
||||
|
||||
The following list describes the configurations you can define for the
|
||||
ADT Installer. For configuration values and restrictions, see the
|
||||
comments in the ``adt-installer.conf`` file:
|
||||
|
||||
- ``YOCTOADT_REPO``: This area includes the IPKG-based packages and the
|
||||
root filesystem upon which the installation is based. If you want to
|
||||
set up your own IPKG repository pointed to by ``YOCTOADT_REPO``, you
|
||||
need to be sure that the directory structure follows the same layout
|
||||
as the reference directory set up at
|
||||
http://adtrepo.yoctoproject.org. Also, your repository needs
|
||||
to be accessible through HTTP.
|
||||
|
||||
- ``YOCTOADT_TARGETS``: The machine target architectures for which you
|
||||
want to set up cross-development environments.
|
||||
|
||||
- ``YOCTOADT_QEMU``: Indicates whether or not to install the emulator
|
||||
QEMU.
|
||||
|
||||
- ``YOCTOADT_NFS_UTIL``: Indicates whether or not to install user-mode
|
||||
NFS. If you plan to use the Eclipse IDE Yocto plug-in against QEMU,
|
||||
you should install NFS.
|
||||
|
||||
.. note::
|
||||
|
||||
To boot QEMU images using our userspace NFS server, you need to be
|
||||
running
|
||||
portmap
|
||||
or
|
||||
rpcbind
|
||||
. If you are running
|
||||
rpcbind
|
||||
, you will also need to add the
|
||||
-i
|
||||
option when
|
||||
rpcbind
|
||||
starts up. Please make sure you understand the security
|
||||
implications of doing this. You might also have to modify your
|
||||
firewall settings to allow NFS booting to work.
|
||||
|
||||
- ``YOCTOADT_ROOTFS_``\ arch: The root filesystem images you want to
|
||||
download from the ``YOCTOADT_IPKG_REPO`` repository.
|
||||
|
||||
- ``YOCTOADT_TARGET_SYSROOT_IMAGE_``\ arch: The particular root
|
||||
filesystem used to extract and create the target sysroot. The value
|
||||
of this variable must have been specified with
|
||||
``YOCTOADT_ROOTFS_``\ arch. For example, if you downloaded both
|
||||
``minimal`` and ``sato-sdk`` images by setting
|
||||
``YOCTOADT_ROOTFS_``\ arch to "minimal sato-sdk", then
|
||||
``YOCTOADT_ROOTFS_``\ arch must be set to either "minimal" or
|
||||
"sato-sdk".
|
||||
|
||||
- ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch: The location on the
|
||||
development host where the target sysroot is created.
|
||||
|
||||
After you have configured the ``adt_installer.conf`` file, run the
|
||||
installer using the following command: $ cd adt-installer $
|
||||
./adt_installer Once the installer begins to run, you are asked to enter
|
||||
the location for cross-toolchain installation. The default location is
|
||||
``/opt/poky/``\ release. After either accepting the default location or
|
||||
selecting your own location, you are prompted to run the installation
|
||||
script interactively or in silent mode. If you want to closely monitor
|
||||
the installation, choose "I" for interactive mode rather than "S" for
|
||||
silent mode. Follow the prompts from the script to complete the
|
||||
installation.
|
||||
|
||||
Once the installation completes, the ADT, which includes the
|
||||
cross-toolchain, is installed in the selected installation directory.
|
||||
You will notice environment setup files for the cross-toolchain in the
|
||||
installation directory, and image tarballs in the ``adt-installer``
|
||||
directory according to your installer configurations, and the target
|
||||
sysroot located according to the ``YOCTOADT_TARGET_SYSROOT_LOC_``\ arch
|
||||
variable also in your configuration file.
|
||||
|
||||
.. _using-an-existing-toolchain-tarball:
|
||||
|
||||
Using a Cross-Toolchain Tarball
|
||||
-------------------------------
|
||||
|
||||
If you want to simply install a cross-toolchain by hand, you can do so
|
||||
by running the toolchain installer. The installer includes the pre-built
|
||||
cross-toolchain, the ``runqemu`` script, and support files. If you use
|
||||
this method to install the cross-toolchain, you might still need to
|
||||
install the target sysroot by installing and extracting it separately.
|
||||
For information on how to install the sysroot, see the "`Extracting the
|
||||
Root Filesystem <#extracting-the-root-filesystem>`__" section.
|
||||
|
||||
Follow these steps:
|
||||
|
||||
1. *Get your toolchain installer using one of the following methods:*
|
||||
|
||||
- Go to ` <&YOCTO_TOOLCHAIN_DL_URL;>`__ and find the folder that
|
||||
matches your host development system (i.e. ``i686`` for 32-bit
|
||||
machines or ``x86_64`` for 64-bit machines).
|
||||
|
||||
Go into that folder and download the toolchain installer whose
|
||||
name includes the appropriate target architecture. The toolchains
|
||||
provided by the Yocto Project are based off of the
|
||||
``core-image-sato`` image and contain libraries appropriate for
|
||||
developing against that image. For example, if your host
|
||||
development system is a 64-bit x86 system and you are going to use
|
||||
your cross-toolchain for a 32-bit x86 target, go into the
|
||||
``x86_64`` folder and download the following installer:
|
||||
poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
- Build your own toolchain installer. For cases where you cannot use
|
||||
an installer from the download area, you can build your own as
|
||||
described in the "`Optionally Building a Toolchain
|
||||
Installer <#optionally-building-a-toolchain-installer>`__"
|
||||
section.
|
||||
|
||||
2. *Once you have the installer, run it to install the toolchain:*
|
||||
|
||||
.. note::
|
||||
|
||||
You must change the permissions on the toolchain installer script
|
||||
so that it is executable.
|
||||
|
||||
The following command shows how to run the installer given a
|
||||
toolchain tarball for a 64-bit x86 development host system and a
|
||||
32-bit x86 target architecture. The example assumes the toolchain
|
||||
installer is located in ``~/Downloads/``. $
|
||||
~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
The first thing the installer prompts you for is the directory into
|
||||
which you want to install the toolchain. The default directory used
|
||||
is ``/opt/poky/DISTRO``. If you do not have write permissions for the
|
||||
directory into which you are installing the toolchain, the toolchain
|
||||
installer notifies you and exits. Be sure you have write permissions
|
||||
in the directory and run the installer again.
|
||||
|
||||
When the script finishes, the cross-toolchain is installed. You will
|
||||
notice environment setup files for the cross-toolchain in the
|
||||
installation directory.
|
||||
|
||||
.. _using-the-toolchain-from-within-the-build-tree:
|
||||
|
||||
Using BitBake and the Build Directory
|
||||
-------------------------------------
|
||||
|
||||
A final way of making the cross-toolchain available is to use BitBake to
|
||||
generate the toolchain within an existing :term:`Build Directory`.
|
||||
This method does
|
||||
not install the toolchain into the default ``/opt`` directory. As with
|
||||
the previous method, if you need to install the target sysroot, you must
|
||||
do that separately as well.
|
||||
|
||||
Follow these steps to generate the toolchain into the Build Directory:
|
||||
|
||||
1. *Set up the Build Environment:* Source the OpenEmbedded build
|
||||
environment setup script (i.e.
|
||||
````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the :term:`Source Directory`.
|
||||
|
||||
2. *Check your Local Configuration File:* At this point, you should be
|
||||
sure that the :term:`MACHINE`
|
||||
variable in the ``local.conf`` file found in the ``conf`` directory
|
||||
of the Build Directory is set for the target architecture. Comments
|
||||
within the ``local.conf`` file list the values you can use for the
|
||||
``MACHINE`` variable. If you do not change the ``MACHINE`` variable,
|
||||
the OpenEmbedded build system uses ``qemux86`` as the default target
|
||||
machine when building the cross-toolchain.
|
||||
|
||||
.. note::
|
||||
|
||||
You can populate the Build Directory with the cross-toolchains for
|
||||
more than a single architecture. You just need to edit the
|
||||
MACHINE
|
||||
variable in the
|
||||
local.conf
|
||||
file and re-run the
|
||||
bitbake
|
||||
command.
|
||||
|
||||
3. *Make Sure Your Layers are Enabled:* Examine the
|
||||
``conf/bblayers.conf`` file and make sure that you have enabled all
|
||||
the compatible layers for your target machine. The OpenEmbedded build
|
||||
system needs to be aware of each layer you want included when
|
||||
building images and cross-toolchains. For information on how to
|
||||
enable a layer, see the "`Enabling Your
|
||||
Layer <&YOCTO_DOCS_DEV_URL;#enabling-your-layer>`__" section in the
|
||||
Yocto Project Development Manual.
|
||||
|
||||
4. *Generate the Cross-Toolchain:* Run ``bitbake meta-ide-support`` to
|
||||
complete the cross-toolchain generation. Once the ``bitbake`` command
|
||||
finishes, the cross-toolchain is generated and populated within the
|
||||
Build Directory. You will notice environment setup files for the
|
||||
cross-toolchain that contain the string "``environment-setup``" in
|
||||
the Build Directory's ``tmp`` folder.
|
||||
|
||||
Be aware that when you use this method to install the toolchain, you
|
||||
still need to separately extract and install the sysroot filesystem.
|
||||
For information on how to do this, see the "`Extracting the Root
|
||||
Filesystem <#extracting-the-root-filesystem>`__" section.
|
||||
|
||||
Setting Up the Cross-Development Environment
|
||||
============================================
|
||||
|
||||
Before you can develop using the cross-toolchain, you need to set up the
|
||||
cross-development environment by sourcing the toolchain's environment
|
||||
setup script. If you used the ADT Installer or hand-installed
|
||||
cross-toolchain, then you can find this script in the directory you
|
||||
chose for installation. For this release, the default installation
|
||||
directory is ````. If you installed the toolchain in the
|
||||
:term:`Build Directory`, you can find the
|
||||
environment setup script for the toolchain in the Build Directory's
|
||||
``tmp`` directory.
|
||||
|
||||
Be sure to run the environment setup script that matches the
|
||||
architecture for which you are developing. Environment setup scripts
|
||||
begin with the string "``environment-setup``" and include as part of
|
||||
their name the architecture. For example, the toolchain environment
|
||||
setup script for a 64-bit IA-based architecture installed in the default
|
||||
installation directory would be the following:
|
||||
YOCTO_ADTPATH_DIR/environment-setup-x86_64-poky-linux When you run the
|
||||
setup script, many environment variables are defined:
|
||||
:term:`SDKTARGETSYSROOT` -
|
||||
The path to the sysroot used for cross-compilation
|
||||
:term:`PKG_CONFIG_PATH` - The
|
||||
path to the target pkg-config files
|
||||
:term:`CONFIG_SITE` - A GNU
|
||||
autoconf site file preconfigured for the target
|
||||
:term:`CC` - The minimal command and
|
||||
arguments to run the C compiler
|
||||
:term:`CXX` - The minimal command and
|
||||
arguments to run the C++ compiler
|
||||
:term:`CPP` - The minimal command and
|
||||
arguments to run the C preprocessor
|
||||
:term:`AS` - The minimal command and
|
||||
arguments to run the assembler :term:`LD`
|
||||
- The minimal command and arguments to run the linker
|
||||
:term:`GDB` - The minimal command and
|
||||
arguments to run the GNU Debugger
|
||||
:term:`STRIP` - The minimal command and
|
||||
arguments to run 'strip', which strips symbols
|
||||
:term:`RANLIB` - The minimal command
|
||||
and arguments to run 'ranlib'
|
||||
:term:`OBJCOPY` - The minimal command
|
||||
and arguments to run 'objcopy'
|
||||
:term:`OBJDUMP` - The minimal command
|
||||
and arguments to run 'objdump' :term:`AR`
|
||||
- The minimal command and arguments to run 'ar'
|
||||
:term:`NM` - The minimal command and
|
||||
arguments to run 'nm'
|
||||
:term:`TARGET_PREFIX` - The
|
||||
toolchain binary prefix for the target tools
|
||||
:term:`CROSS_COMPILE` - The
|
||||
toolchain binary prefix for the target tools
|
||||
:term:`CONFIGURE_FLAGS` - The
|
||||
minimal arguments for GNU configure
|
||||
:term:`CFLAGS` - Suggested C flags
|
||||
:term:`CXXFLAGS` - Suggested C++
|
||||
flags :term:`LDFLAGS` - Suggested
|
||||
linker flags when you use CC to link
|
||||
:term:`CPPFLAGS` - Suggested
|
||||
preprocessor flags
|
||||
|
||||
Securing Kernel and Filesystem Images
|
||||
=====================================
|
||||
|
||||
You will need to have a kernel and filesystem image to boot using your
|
||||
hardware or the QEMU emulator. Furthermore, if you plan on booting your
|
||||
image using NFS or you want to use the root filesystem as the target
|
||||
sysroot, you need to extract the root filesystem.
|
||||
|
||||
Getting the Images
|
||||
------------------
|
||||
|
||||
To get the kernel and filesystem images, you either have to build them
|
||||
or download pre-built versions. For an example of how to build these
|
||||
images, see the "`Buiding
|
||||
Images <&YOCTO_DOCS_QS_URL;#qs-buiding-images>`__" section of the Yocto
|
||||
Project Quick Start. For an example of downloading pre-build versions,
|
||||
see the "`Example Using Pre-Built Binaries and
|
||||
QEMU <#using-pre-built>`__" section.
|
||||
|
||||
The Yocto Project ships basic kernel and filesystem images for several
|
||||
architectures (``x86``, ``x86-64``, ``mips``, ``powerpc``, and ``arm``)
|
||||
that you can use unaltered in the QEMU emulator. These kernel images
|
||||
reside in the release area - ` <&YOCTO_MACHINES_DL_URL;>`__ and are
|
||||
ideal for experimentation using Yocto Project. For information on the
|
||||
image types you can build using the OpenEmbedded build system, see the
|
||||
":ref:`ref-manual/ref-images:Images`" chapter in the Yocto
|
||||
Project Reference Manual.
|
||||
|
||||
If you are planning on developing against your image and you are not
|
||||
building or using one of the Yocto Project development images (e.g.
|
||||
``core-image-*-dev``), you must be sure to include the development
|
||||
packages as part of your image recipe.
|
||||
|
||||
If you plan on remotely deploying and debugging your application from
|
||||
within the Eclipse IDE, you must have an image that contains the Yocto
|
||||
Target Communication Framework (TCF) agent (``tcf-agent``). You can do
|
||||
this by including the ``eclipse-debug`` image feature.
|
||||
|
||||
.. note::
|
||||
|
||||
See the "
|
||||
Image Features
|
||||
" section in the Yocto Project Reference Manual for information on
|
||||
image features.
|
||||
|
||||
To include the ``eclipse-debug`` image feature, modify your
|
||||
``local.conf`` file in the :term:`Build Directory`
|
||||
so that the
|
||||
:term:`EXTRA_IMAGE_FEATURES`
|
||||
variable includes the "eclipse-debug" feature. After modifying the
|
||||
configuration file, you can rebuild the image. Once the image is
|
||||
rebuilt, the ``tcf-agent`` will be included in the image and is launched
|
||||
automatically after the boot.
|
||||
|
||||
Extracting the Root Filesystem
|
||||
------------------------------
|
||||
|
||||
If you install your toolchain by hand or build it using BitBake and you
|
||||
need a root filesystem, you need to extract it separately. If you use
|
||||
the ADT Installer to install the ADT, the root filesystem is
|
||||
automatically extracted and installed.
|
||||
|
||||
Here are some cases where you need to extract the root filesystem:
|
||||
|
||||
- You want to boot the image using NFS.
|
||||
|
||||
- You want to use the root filesystem as the target sysroot. For
|
||||
example, the Eclipse IDE environment with the Eclipse Yocto Plug-in
|
||||
installed allows you to use QEMU to boot under NFS.
|
||||
|
||||
- You want to develop your target application using the root filesystem
|
||||
as the target sysroot.
|
||||
|
||||
To extract the root filesystem, first ``source`` the cross-development
|
||||
environment setup script to establish necessary environment variables.
|
||||
If you built the toolchain in the Build Directory, you will find the
|
||||
toolchain environment script in the ``tmp`` directory. If you installed
|
||||
the toolchain by hand, the environment setup script is located in
|
||||
``/opt/poky/DISTRO``.
|
||||
|
||||
After sourcing the environment script, use the ``runqemu-extract-sdk``
|
||||
command and provide the filesystem image.
|
||||
|
||||
Following is an example. The second command sets up the environment. In
|
||||
this case, the setup script is located in the ``/opt/poky/DISTRO``
|
||||
directory. The third command extracts the root filesystem from a
|
||||
previously built filesystem that is located in the ``~/Downloads``
|
||||
directory. Furthermore, this command extracts the root filesystem into
|
||||
the ``qemux86-sato`` directory: $ cd ~ $ source
|
||||
/opt/poky/DISTRO/environment-setup-i586-poky-linux $ runqemu-extract-sdk
|
||||
\\ ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2
|
||||
\\ $HOME/qemux86-sato You could now point to the target sysroot at
|
||||
``qemux86-sato``.
|
||||
|
||||
Optionally Building a Toolchain Installer
|
||||
=========================================
|
||||
|
||||
As an alternative to locating and downloading a toolchain installer, you
|
||||
can build the toolchain installer if you have a :term:`Build Directory`.
|
||||
|
||||
.. note::
|
||||
|
||||
Although not the preferred method, it is also possible to use
|
||||
bitbake meta-toolchain
|
||||
to build the toolchain installer. If you do use this method, you must
|
||||
separately install and extract the target sysroot. For information on
|
||||
how to install the sysroot, see the "
|
||||
Extracting the Root Filesystem
|
||||
" section.
|
||||
|
||||
To build the toolchain installer and populate the SDK image, use the
|
||||
following command: $ bitbake image -c populate_sdk The command results
|
||||
in a toolchain installer that contains the sysroot that matches your
|
||||
target root filesystem.
|
||||
|
||||
Another powerful feature is that the toolchain is completely
|
||||
self-contained. The binaries are linked against their own copy of
|
||||
``libc``, which results in no dependencies on the target system. To
|
||||
achieve this, the pointer to the dynamic loader is configured at install
|
||||
time since that path cannot be dynamically altered. This is the reason
|
||||
for a wrapper around the ``populate_sdk`` archive.
|
||||
|
||||
Another feature is that only one set of cross-canadian toolchain
|
||||
binaries are produced per architecture. This feature takes advantage of
|
||||
the fact that the target hardware can be passed to ``gcc`` as a set of
|
||||
compiler options. Those options are set up by the environment script and
|
||||
contained in variables such as :term:`CC`
|
||||
and :term:`LD`. This reduces the space
|
||||
needed for the tools. Understand, however, that a sysroot is still
|
||||
needed for every target since those binaries are target-specific.
|
||||
|
||||
Remember, before using any BitBake command, you must source the build
|
||||
environment setup script (i.e.
|
||||
````` <&YOCTO_DOCS_REF_URL;#structure-core-script>`__ or
|
||||
```oe-init-build-env-memres`` <&YOCTO_DOCS_REF_URL;#structure-memres-core-script>`__)
|
||||
located in the Source Directory and you must make sure your
|
||||
``conf/local.conf`` variables are correct. In particular, you need to be
|
||||
sure the :term:`MACHINE` variable
|
||||
matches the architecture for which you are building and that the
|
||||
:term:`SDKMACHINE` variable is
|
||||
correctly set if you are building a toolchain designed to run on an
|
||||
architecture that differs from your current development host machine
|
||||
(i.e. the build machine).
|
||||
|
||||
When the ``bitbake`` command completes, the toolchain installer will be
|
||||
in ``tmp/deploy/sdk`` in the Build Directory.
|
||||
|
||||
.. note::
|
||||
|
||||
By default, this toolchain does not build static binaries. If you
|
||||
want to use the toolchain to build these types of libraries, you need
|
||||
to be sure your image has the appropriate static development
|
||||
libraries. Use the
|
||||
IMAGE_INSTALL
|
||||
variable inside your
|
||||
local.conf
|
||||
file to install the appropriate library packages. Following is an
|
||||
example using
|
||||
glibc
|
||||
static development libraries:
|
||||
::
|
||||
|
||||
IMAGE_INSTALL_append = " glibc-staticdev"
|
||||
|
||||
|
||||
Optionally Using an External Toolchain
|
||||
======================================
|
||||
|
||||
You might want to use an external toolchain as part of your development.
|
||||
If this is the case, the fundamental steps you need to accomplish are as
|
||||
follows:
|
||||
|
||||
- Understand where the installed toolchain resides. For cases where you
|
||||
need to build the external toolchain, you would need to take separate
|
||||
steps to build and install the toolchain.
|
||||
|
||||
- Make sure you add the layer that contains the toolchain to your
|
||||
``bblayers.conf`` file through the
|
||||
:term:`BBLAYERS` variable.
|
||||
|
||||
- Set the
|
||||
:term:`EXTERNAL_TOOLCHAIN`
|
||||
variable in your ``local.conf`` file to the location in which you
|
||||
installed the toolchain.
|
||||
|
||||
A good example of an external toolchain used with the Yocto Project is
|
||||
Mentor Graphics Sourcery G++ Toolchain. You can see information on how
|
||||
to use that particular layer in the ``README`` file at
|
||||
http://github.com/MentorEmbedded/meta-sourcery/. You can find
|
||||
further information by reading about the
|
||||
:term:`TCMODE` variable in the Yocto
|
||||
Project Reference Manual's variable glossary.
|
||||
|
||||
.. _using-pre-built:
|
||||
|
||||
Example Using Pre-Built Binaries and QEMU
|
||||
=========================================
|
||||
|
||||
If hardware, libraries and services are stable, you can get started by
|
||||
using a pre-built binary of the filesystem image, kernel, and toolchain
|
||||
and run it using the QEMU emulator. This scenario is useful for
|
||||
developing application software.
|
||||
|
||||
|Using a Pre-Built Image|
|
||||
|
||||
For this scenario, you need to do several things:
|
||||
|
||||
- Install the appropriate stand-alone toolchain tarball.
|
||||
|
||||
- Download the pre-built image that will boot with QEMU. You need to be
|
||||
sure to get the QEMU image that matches your target machine's
|
||||
architecture (e.g. x86, ARM, etc.).
|
||||
|
||||
- Download the filesystem image for your target machine's architecture.
|
||||
|
||||
- Set up the environment to emulate the hardware and then start the
|
||||
QEMU emulator.
|
||||
|
||||
Installing the Toolchain
|
||||
------------------------
|
||||
|
||||
You can download a tarball installer, which includes the pre-built
|
||||
toolchain, the ``runqemu`` script, and support files from the
|
||||
appropriate directory under ` <&YOCTO_TOOLCHAIN_DL_URL;>`__. Toolchains
|
||||
are available for 32-bit and 64-bit x86 development systems from the
|
||||
``i686`` and ``x86_64`` directories, respectively. The toolchains the
|
||||
Yocto Project provides are based off the ``core-image-sato`` image and
|
||||
contain libraries appropriate for developing against that image. Each
|
||||
type of development system supports five or more target architectures.
|
||||
|
||||
The names of the tarball installer scripts are such that a string
|
||||
representing the host system appears first in the filename and then is
|
||||
immediately followed by a string representing the target architecture.
|
||||
|
||||
::
|
||||
|
||||
poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
|
||||
|
||||
Where:
|
||||
host_system is a string representing your development system:
|
||||
|
||||
i686 or x86_64.
|
||||
|
||||
image_type is a string representing the image you wish to
|
||||
develop a Software Development Toolkit (SDK) for use against.
|
||||
The Yocto Project builds toolchain installers using the
|
||||
following BitBake command:
|
||||
|
||||
bitbake core-image-sato -c populate_sdk
|
||||
|
||||
arch is a string representing the tuned target architecture:
|
||||
|
||||
i586, x86_64, powerpc, mips, armv7a or armv5te
|
||||
|
||||
release_version is a string representing the release number of the
|
||||
Yocto Project:
|
||||
|
||||
DISTRO, DISTRO+snapshot
|
||||
|
||||
|
||||
For example, the following toolchain installer is for a 64-bit
|
||||
development host system and a i586-tuned target architecture based off
|
||||
the SDK for ``core-image-sato``:
|
||||
poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
Toolchains are self-contained and by default are installed into
|
||||
``/opt/poky``. However, when you run the toolchain installer, you can
|
||||
choose an installation directory.
|
||||
|
||||
The following command shows how to run the installer given a toolchain
|
||||
tarball for a 64-bit x86 development host system and a 32-bit x86 target
|
||||
architecture. You must change the permissions on the toolchain installer
|
||||
script so that it is executable.
|
||||
|
||||
The example assumes the toolchain installer is located in
|
||||
``~/Downloads/``.
|
||||
|
||||
.. note::
|
||||
|
||||
If you do not have write permissions for the directory into which you
|
||||
are installing the toolchain, the toolchain installer notifies you
|
||||
and exits. Be sure you have write permissions in the directory and
|
||||
run the installer again.
|
||||
|
||||
$ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
|
||||
|
||||
For more information on how to install tarballs, see the "`Using a
|
||||
Cross-Toolchain
|
||||
Tarball <&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball>`__"
|
||||
and "`Using BitBake and the Build
|
||||
Directory <&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree>`__"
|
||||
sections in the Yocto Project Application Developer's Guide.
|
||||
|
||||
Downloading the Pre-Built Linux Kernel
|
||||
--------------------------------------
|
||||
|
||||
You can download the pre-built Linux kernel suitable for running in the
|
||||
QEMU emulator from ` <&YOCTO_QEMU_DL_URL;>`__. Be sure to use the kernel
|
||||
that matches the architecture you want to simulate. Download areas exist
|
||||
for the five supported machine architectures: ``qemuarm``, ``qemumips``,
|
||||
``qemuppc``, ``qemux86``, and ``qemux86-64``.
|
||||
|
||||
Most kernel files have one of the following forms: \*zImage-qemuarch.bin
|
||||
vmlinux-qemuarch.bin Where: arch is a string representing the target
|
||||
architecture: x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
You can learn more about downloading a Yocto Project kernel in the
|
||||
"`Yocto Project Kernel <&YOCTO_DOCS_DEV_URL;#local-kernel-files>`__"
|
||||
bulleted item in the Yocto Project Development Manual.
|
||||
|
||||
Downloading the Filesystem
|
||||
--------------------------
|
||||
|
||||
You can also download the filesystem image suitable for your target
|
||||
architecture from ` <&YOCTO_QEMU_DL_URL;>`__. Again, be sure to use the
|
||||
filesystem that matches the architecture you want to simulate.
|
||||
|
||||
The filesystem image has two tarball forms: ``ext3`` and ``tar``. You
|
||||
must use the ``ext3`` form when booting an image using the QEMU
|
||||
emulator. The ``tar`` form can be flattened out in your host development
|
||||
system and used for build purposes with the Yocto Project.
|
||||
core-image-profile-qemuarch.ext3 core-image-profile-qemuarch.tar.bz2
|
||||
Where: profile is the filesystem image's profile: lsb, lsb-dev, lsb-sdk,
|
||||
lsb-qt3, minimal, minimal-dev, sato, sato-dev, or sato-sdk. For
|
||||
information on these types of image profiles, see the
|
||||
":ref:`ref-manual/ref-images:Images`" chapter in the Yocto
|
||||
Project Reference Manual. arch is a string representing the target
|
||||
architecture: x86, x86-64, ppc, mips, or arm.
|
||||
|
||||
Setting Up the Environment and Starting the QEMU Emulator
|
||||
---------------------------------------------------------
|
||||
|
||||
Before you start the QEMU emulator, you need to set up the emulation
|
||||
environment. The following command form sets up the emulation
|
||||
environment. $ source
|
||||
YOCTO_ADTPATH_DIR/environment-setup-arch-poky-linux-if Where: arch is a
|
||||
string representing the target architecture: i586, x86_64, ppc603e,
|
||||
mips, or armv5te. if is a string representing an embedded application
|
||||
binary interface. Not all setup scripts include this string.
|
||||
|
||||
Finally, this command form invokes the QEMU emulator $ runqemu qemuarch
|
||||
kernel-image filesystem-image Where: qemuarch is a string representing
|
||||
the target architecture: qemux86, qemux86-64, qemuppc, qemumips, or
|
||||
qemuarm. kernel-image is the architecture-specific kernel image.
|
||||
filesystem-image is the .ext3 filesystem image.
|
||||
|
||||
Continuing with the example, the following two commands setup the
|
||||
emulation environment and launch QEMU. This example assumes the root
|
||||
filesystem (``.ext3`` file) and the pre-built kernel image file both
|
||||
reside in your home directory. The kernel and filesystem are for a
|
||||
32-bit target architecture. $ cd $HOME $ source
|
||||
YOCTO_ADTPATH_DIR/environment-setup-i586-poky-linux $ runqemu qemux86
|
||||
bzImage-qemux86.bin \\ core-image-sato-qemux86.ext3
|
||||
|
||||
The environment in which QEMU launches varies depending on the
|
||||
filesystem image and on the target architecture. For example, if you
|
||||
source the environment for the ARM target architecture and then boot the
|
||||
minimal QEMU image, the emulator comes up in a new shell in command-line
|
||||
mode. However, if you boot the SDK image, QEMU comes up with a GUI.
|
||||
|
||||
.. note::
|
||||
|
||||
Booting the PPC image results in QEMU launching in the same shell in
|
||||
command-line mode.
|
||||
|
||||
.. |Using a Pre-Built Image| image:: figures/using-a-pre-built-image.png
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='adt-prepare'>
|
||||
|
||||
@@ -231,7 +232,7 @@
|
||||
own location, you are prompted to run the installation script
|
||||
interactively or in silent mode.
|
||||
If you want to closely monitor the installation,
|
||||
choose “I” for interactive mode rather than “S” for silent mode.
|
||||
choose "I" for interactive mode rather than "S" for silent mode.
|
||||
Follow the prompts from the script to complete the installation.
|
||||
</para>
|
||||
|
||||
@@ -764,7 +765,7 @@
|
||||
<itemizedlist>
|
||||
<listitem><para>Install the appropriate stand-alone toolchain tarball.</para></listitem>
|
||||
<listitem><para>Download the pre-built image that will boot with QEMU.
|
||||
You need to be sure to get the QEMU image that matches your target machine’s
|
||||
You need to be sure to get the QEMU image that matches your target machine's
|
||||
architecture (e.g. x86, ARM, etc.).</para></listitem>
|
||||
<listitem><para>Download the filesystem image for your target machine's architecture.
|
||||
</para></listitem>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
18
documentation/boilerplate.rst
Normal file
18
documentation/boilerplate.rst
Normal file
@@ -0,0 +1,18 @@
|
||||
.. include:: <xhtml1-lat1.txt>
|
||||
.. include:: <xhtml1-symbol.txt>
|
||||
|
||||
----
|
||||
|
||||
| |project_name|
|
||||
| <docs@lists.yoctoproject.org>
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document under the
|
||||
terms of the `Creative Commons Attribution-Share Alike 2.0 UK: England & Wales
|
||||
<http://creativecommons.org/licenses/by-sa/2.0/uk/>`_ as published by Creative
|
||||
Commons.
|
||||
|
||||
To report any inaccuracies or problems with this (or any other Yocto Project)
|
||||
manual, or to send additions or changes, please send email/patches to the Yocto
|
||||
Project documentation mailing list at ``docs@lists.yoctoproject.org`` or
|
||||
log into the freenode ``#yocto`` channel.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
|
||||
|
||||
|
||||
430
documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.rst
Normal file
430
documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.rst
Normal file
@@ -0,0 +1,430 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
=========================
|
||||
Yocto Project Quick Build
|
||||
=========================
|
||||
|
||||
Welcome!
|
||||
========
|
||||
|
||||
This short document steps you through the process for a typical
|
||||
image build using the Yocto Project. The document also introduces how to
|
||||
configure a build for specific hardware. You will use Yocto Project to
|
||||
build a reference embedded OS called Poky.
|
||||
|
||||
.. note::
|
||||
|
||||
- The examples in this paper assume you are using a native Linux
|
||||
system running a recent Ubuntu Linux distribution. If the machine
|
||||
you want to use Yocto Project on to build an image
|
||||
(:term:`Build Host`) is not
|
||||
a native Linux system, you can still perform these steps by using
|
||||
CROss PlatformS (CROPS) and setting up a Poky container. See the
|
||||
:ref:`dev-manual/dev-manual-start:setting up to use cross platforms (crops)`
|
||||
section
|
||||
in the Yocto Project Development Tasks Manual for more
|
||||
information.
|
||||
|
||||
- You may use Windows Subsystem For Linux v2 to set up a build host
|
||||
using Windows 10.
|
||||
|
||||
.. note::
|
||||
|
||||
The Yocto Project is not compatible with WSLv1, it is
|
||||
compatible but not officially supported nor validated with
|
||||
WSLv2, if you still decide to use WSL please upgrade to WSLv2.
|
||||
|
||||
See the :ref:`dev-manual/dev-manual-start:setting up to use windows
|
||||
subsystem for linux (wslv2)` section in the Yocto Project Development
|
||||
Tasks Manual for more information.
|
||||
|
||||
If you want more conceptual or background information on the Yocto
|
||||
Project, see the :doc:`../overview-manual/overview-manual`.
|
||||
|
||||
Compatible Linux Distribution
|
||||
=============================
|
||||
|
||||
Make sure your :term:`Build Host` meets the
|
||||
following requirements:
|
||||
|
||||
- 50 Gbytes of free disk space
|
||||
|
||||
- Runs a supported Linux distribution (i.e. recent releases of Fedora,
|
||||
openSUSE, CentOS, Debian, or Ubuntu). For a list of Linux
|
||||
distributions that support the Yocto Project, see the
|
||||
:ref:`ref-manual/ref-system-requirements:supported linux distributions`
|
||||
section in the Yocto Project Reference Manual. For detailed
|
||||
information on preparing your build host, see the
|
||||
:ref:`dev-manual/dev-manual-start:preparing the build host`
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
-
|
||||
|
||||
- Git 1.8.3.1 or greater
|
||||
- tar 1.28 or greater
|
||||
- Python 3.5.0 or greater.
|
||||
- gcc 5.0 or greater.
|
||||
|
||||
If your build host does not meet any of these three listed version
|
||||
requirements, you can take steps to prepare the system so that you
|
||||
can still use the Yocto Project. See the
|
||||
:ref:`ref-manual/ref-system-requirements:required git, tar, python and gcc versions`
|
||||
section in the Yocto Project Reference Manual for information.
|
||||
|
||||
Build Host Packages
|
||||
===================
|
||||
|
||||
You must install essential host packages on your build host. The
|
||||
following command installs the host packages based on an Ubuntu
|
||||
distribution:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
|
||||
|
||||
.. note::
|
||||
|
||||
For host package requirements on all supported Linux distributions,
|
||||
see the :ref:`ref-manual/ref-system-requirements:required packages for the build host`
|
||||
section in the Yocto Project Reference Manual.
|
||||
|
||||
Use Git to Clone Poky
|
||||
=====================
|
||||
|
||||
Once you complete the setup instructions for your machine, you need to
|
||||
get a copy of the Poky repository on your build host. Use the following
|
||||
commands to clone the Poky repository.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
Cloning into 'poky'...
|
||||
remote: Counting
|
||||
objects: 432160, done. remote: Compressing objects: 100%
|
||||
(102056/102056), done. remote: Total 432160 (delta 323116), reused
|
||||
432037 (delta 323000) Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
|
||||
Resolving deltas: 100% (323116/323116), done.
|
||||
Checking connectivity... done.
|
||||
|
||||
Move to the ``poky`` directory and take a look at the tags:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd poky
|
||||
$ git fetch --tags
|
||||
$ git tag
|
||||
1.1_M1.final
|
||||
1.1_M1.rc1
|
||||
1.1_M1.rc2
|
||||
1.1_M2.final
|
||||
1.1_M2.rc1
|
||||
.
|
||||
.
|
||||
.
|
||||
yocto-2.5
|
||||
yocto-2.5.1
|
||||
yocto-2.5.2
|
||||
yocto-2.6
|
||||
yocto-2.6.1
|
||||
yocto-2.6.2
|
||||
yocto-2.7
|
||||
yocto_1.5_M5.rc8
|
||||
|
||||
For this example, check out the branch based on the
|
||||
``&DISTRO_REL_TAG;`` release:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ git checkout tags/&DISTRO_REL_TAG; -b my-&DISTRO_REL_TAG;
|
||||
Switched to a new branch 'my-&DISTRO_REL_TAG;'
|
||||
|
||||
The previous Git checkout command creates a local branch named
|
||||
``my-&DISTRO_REL_TAG;``. The files available to you in that branch exactly
|
||||
match the repository's files in the ``&DISTRO_NAME_NO_CAP;`` development
|
||||
branch at the time of the Yocto Project &DISTRO_REL_TAG; release.
|
||||
|
||||
For more options and information about accessing Yocto Project related
|
||||
repositories, see the
|
||||
:ref:`dev-manual/dev-manual-start:locating yocto project source files`
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Building Your Image
|
||||
===================
|
||||
|
||||
Use the following steps to build your image. The build process creates
|
||||
an entire Linux distribution, including the toolchain, from source.
|
||||
|
||||
.. note::
|
||||
|
||||
- If you are working behind a firewall and your build host is not
|
||||
set up for proxies, you could encounter problems with the build
|
||||
process when fetching source code (e.g. fetcher failures or Git
|
||||
failures).
|
||||
|
||||
- If you do not know your proxy settings, consult your local network
|
||||
infrastructure resources and get that information. A good starting
|
||||
point could also be to check your web browser settings. Finally,
|
||||
you can find more information on the
|
||||
":yocto_wiki:`Working Behind a Network Proxy </wiki/Working_Behind_a_Network_Proxy>`"
|
||||
page of the Yocto Project Wiki.
|
||||
|
||||
#. **Initialize the Build Environment:** From within the ``poky``
|
||||
directory, run the :ref:`ref-manual/ref-structure:\`\`oe-init-build-env\`\``
|
||||
environment
|
||||
setup script to define Yocto Project's build environment on your
|
||||
build host.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd ~/poky
|
||||
$ source &OE_INIT_FILE;
|
||||
You had no conf/local.conf file. This configuration file has therefore been
|
||||
created for you with some default values. You may wish to edit it to, for
|
||||
example, select a different MACHINE (target hardware). See conf/local.conf
|
||||
for more information as common configuration options are commented.
|
||||
|
||||
You had no conf/bblayers.conf file. This configuration file has therefore
|
||||
been created for you with some default values. To add additional metadata
|
||||
layers into your configuration please add entries to conf/bblayers.conf.
|
||||
|
||||
The Yocto Project has extensive documentation about OE including a reference
|
||||
manual which can be found at:
|
||||
http://yoctoproject.org/documentation
|
||||
|
||||
For more information about OpenEmbedded see their website:
|
||||
http://www.openembedded.org/
|
||||
|
||||
### Shell environment set up for builds. ###
|
||||
|
||||
You can now run 'bitbake <target>'
|
||||
|
||||
Common targets are:
|
||||
core-image-minimal
|
||||
core-image-sato
|
||||
meta-toolchain
|
||||
meta-ide-support
|
||||
|
||||
You can also run generated qemu images with a command like 'runqemu qemux86-64'
|
||||
|
||||
Among other things, the script creates the :term:`Build Directory`, which is
|
||||
``build`` in this case and is located in the :term:`Source Directory`. After
|
||||
the script runs, your current working directory is set to the Build
|
||||
Directory. Later, when the build completes, the Build Directory contains all the
|
||||
files created during the build.
|
||||
|
||||
#. **Examine Your Local Configuration File:** When you set up the build
|
||||
environment, a local configuration file named ``local.conf`` becomes
|
||||
available in a ``conf`` subdirectory of the Build Directory. For this
|
||||
example, the defaults are set to build for a ``qemux86`` target,
|
||||
which is suitable for emulation. The package manager used is set to
|
||||
the RPM package manager.
|
||||
|
||||
.. tip::
|
||||
|
||||
You can significantly speed up your build and guard against fetcher
|
||||
failures by using mirrors. To use mirrors, add these lines to your
|
||||
local.conf file in the Build directory: ::
|
||||
|
||||
SSTATE_MIRRORS = "\
|
||||
file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \
|
||||
file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION_MINUS_ONE;/PATH;downloadfilename=PATH \n \
|
||||
file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION;/PATH;downloadfilename=PATH \n \
|
||||
"
|
||||
|
||||
|
||||
The previous examples showed how to add sstate paths for Yocto Project
|
||||
&YOCTO_DOC_VERSION_MINUS_ONE;, &YOCTO_DOC_VERSION;, and a development
|
||||
area. For a complete index of sstate locations, see http://sstate.yoctoproject.org/.
|
||||
|
||||
#. **Start the Build:** Continue with the following command to build an OS
|
||||
image for the target, which is ``core-image-sato`` in this example:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ bitbake core-image-sato
|
||||
|
||||
For information on using the ``bitbake`` command, see the
|
||||
:ref:`usingpoky-components-bitbake` section in the Yocto Project Overview and
|
||||
Concepts Manual, or see the ":ref:`BitBake Command
|
||||
<bitbake:bitbake-user-manual-command>`" section in the BitBake User Manual.
|
||||
|
||||
#. **Simulate Your Image Using QEMU:** Once this particular image is
|
||||
built, you can start QEMU, which is a Quick EMUlator that ships with
|
||||
the Yocto Project:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ runqemu qemux86-64
|
||||
|
||||
If you want to learn more about running QEMU, see the
|
||||
:ref:`dev-manual/dev-manual-qemu:using the quick emulator (qemu)` chapter in
|
||||
the Yocto Project Development Tasks Manual.
|
||||
|
||||
#. **Exit QEMU:** Exit QEMU by either clicking on the shutdown icon or by typing
|
||||
``Ctrl-C`` in the QEMU transcript window from which you evoked QEMU.
|
||||
|
||||
Customizing Your Build for Specific Hardware
|
||||
============================================
|
||||
|
||||
So far, all you have done is quickly built an image suitable for
|
||||
emulation only. This section shows you how to customize your build for
|
||||
specific hardware by adding a hardware layer into the Yocto Project
|
||||
development environment.
|
||||
|
||||
In general, layers are repositories that contain related sets of
|
||||
instructions and configurations that tell the Yocto Project what to do.
|
||||
Isolating related metadata into functionally specific layers facilitates
|
||||
modular development and makes it easier to reuse the layer metadata.
|
||||
|
||||
.. note::
|
||||
|
||||
By convention, layer names start with the string "meta-".
|
||||
|
||||
Follow these steps to add a hardware layer:
|
||||
|
||||
#. **Find a Layer:** Lots of hardware layers exist. The Yocto Project
|
||||
:yocto_git:`Source Repositories <>` has many hardware layers.
|
||||
This example adds the
|
||||
`meta-altera <https://github.com/kraj/meta-altera>`__ hardware layer.
|
||||
|
||||
#. **Clone the Layer:** Use Git to make a local copy of the layer on your
|
||||
machine. You can put the copy in the top level of the copy of the
|
||||
Poky repository created earlier:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd ~/poky
|
||||
$ git clone https://github.com/kraj/meta-altera.git
|
||||
Cloning into 'meta-altera'...
|
||||
remote: Counting objects: 25170, done.
|
||||
remote: Compressing objects: 100% (350/350), done.
|
||||
remote: Total 25170 (delta 645), reused 719 (delta 538), pack-reused 24219
|
||||
Receiving objects: 100% (25170/25170), 41.02 MiB | 1.64 MiB/s, done.
|
||||
Resolving deltas: 100% (13385/13385), done.
|
||||
Checking connectivity... done.
|
||||
|
||||
The hardware layer now exists
|
||||
with other layers inside the Poky reference repository on your build
|
||||
host as ``meta-altera`` and contains all the metadata needed to
|
||||
support hardware from Altera, which is owned by Intel.
|
||||
|
||||
.. note::
|
||||
|
||||
It is recommended for layers to have a branch per Yocto Project release.
|
||||
Please make sure to checkout the layer branch supporting the Yocto Project
|
||||
release you're using.
|
||||
|
||||
#. **Change the Configuration to Build for a Specific Machine:** The
|
||||
:term:`MACHINE` variable in the
|
||||
``local.conf`` file specifies the machine for the build. For this
|
||||
example, set the ``MACHINE`` variable to ``cyclone5``. These
|
||||
configurations are used:
|
||||
https://github.com/kraj/meta-altera/blob/master/conf/machine/cyclone5.conf.
|
||||
|
||||
.. note::
|
||||
|
||||
See the "Examine Your Local Configuration File" step earlier for more
|
||||
information on configuring the build.
|
||||
|
||||
#. **Add Your Layer to the Layer Configuration File:** Before you can use
|
||||
a layer during a build, you must add it to your ``bblayers.conf``
|
||||
file, which is found in the
|
||||
:term:`Build Directory` ``conf``
|
||||
directory.
|
||||
|
||||
Use the ``bitbake-layers add-layer`` command to add the layer to the
|
||||
configuration file:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd ~/poky/build
|
||||
$ bitbake-layers add-layer ../meta-altera
|
||||
NOTE: Starting bitbake server...
|
||||
Parsing recipes: 100% |##################################################################| Time: 0:00:32
|
||||
Parsing of 918 .bb files complete (0 cached, 918 parsed). 1401 targets,
|
||||
123 skipped, 0 masked, 0 errors.
|
||||
|
||||
You can find
|
||||
more information on adding layers in the
|
||||
:ref:`dev-manual/dev-manual-common-tasks:adding a layer using the \`\`bitbake-layers\`\` script`
|
||||
section.
|
||||
|
||||
Completing these steps has added the ``meta-altera`` layer to your Yocto
|
||||
Project development environment and configured it to build for the
|
||||
``cyclone5`` machine.
|
||||
|
||||
.. note::
|
||||
|
||||
The previous steps are for demonstration purposes only. If you were
|
||||
to attempt to build an image for the ``cyclone5`` machine, you should
|
||||
read the Altera ``README``.
|
||||
|
||||
Creating Your Own General Layer
|
||||
===============================
|
||||
|
||||
Maybe you have an application or specific set of behaviors you need to
|
||||
isolate. You can create your own general layer using the
|
||||
``bitbake-layers create-layer`` command. The tool automates layer
|
||||
creation by setting up a subdirectory with a ``layer.conf``
|
||||
configuration file, a ``recipes-example`` subdirectory that contains an
|
||||
``example.bb`` recipe, a licensing file, and a ``README``.
|
||||
|
||||
The following commands run the tool to create a layer named
|
||||
``meta-mylayer`` in the ``poky`` directory:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
$ cd ~/poky
|
||||
$ bitbake-layers create-layer meta-mylayer
|
||||
NOTE: Starting bitbake server...
|
||||
Add your new layer with 'bitbake-layers add-layer meta-mylayer'
|
||||
|
||||
For more information
|
||||
on layers and how to create them, see the
|
||||
:ref:`dev-manual/dev-manual-common-tasks:creating a general layer using the \`\`bitbake-layers\`\` script`
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Where To Go Next
|
||||
================
|
||||
|
||||
Now that you have experienced using the Yocto Project, you might be
|
||||
asking yourself "What now?". The Yocto Project has many sources of
|
||||
information including the website, wiki pages, and user manuals:
|
||||
|
||||
- **Website:** The :yocto_home:`Yocto Project Website <>` provides
|
||||
background information, the latest builds, breaking news, full
|
||||
development documentation, and access to a rich Yocto Project
|
||||
Development Community into which you can tap.
|
||||
|
||||
- **Developer Screencast:** The `Getting Started with the Yocto Project -
|
||||
New Developer Screencast Tutorial <http://vimeo.com/36450321>`__
|
||||
provides a 30-minute video created for users unfamiliar with the
|
||||
Yocto Project but familiar with Linux build hosts. While this
|
||||
screencast is somewhat dated, the introductory and fundamental
|
||||
concepts are useful for the beginner.
|
||||
|
||||
- **Yocto Project Overview and Concepts Manual:** The
|
||||
:doc:`../overview-manual/overview-manual` is a great
|
||||
place to start to learn about the Yocto Project. This manual
|
||||
introduces you to the Yocto Project and its development environment.
|
||||
The manual also provides conceptual information for various aspects
|
||||
of the Yocto Project.
|
||||
|
||||
- **Yocto Project Wiki:** The :yocto_wiki:`Yocto Project Wiki <>`
|
||||
provides additional information on where to go next when ramping up
|
||||
with the Yocto Project, release information, project planning, and QA
|
||||
information.
|
||||
|
||||
- **Yocto Project Mailing Lists:** Related mailing lists provide a forum
|
||||
for discussion, patch submission and announcements. Several mailing
|
||||
lists exist and are grouped according to areas of concern. See the
|
||||
:ref:`ref-manual/resources:mailing lists`
|
||||
section in the Yocto Project Reference Manual for a complete list of
|
||||
Yocto Project mailing lists.
|
||||
|
||||
- **Comprehensive List of Links and Other Documentation:** The
|
||||
:ref:`ref-manual/resources:links and related documentation`
|
||||
section in the Yocto Project Reference Manual provides a
|
||||
comprehensive list of all related links and other user documentation.
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<article id='brief-yocto-project-qs-intro'>
|
||||
<articleinfo>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
16
documentation/bsp-guide/bsp-guide.rst
Normal file
16
documentation/bsp-guide/bsp-guide.rst
Normal file
@@ -0,0 +1,16 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
=====================================================
|
||||
Yocto Project Board Support Package Developer's Guide
|
||||
=====================================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
bsp
|
||||
history
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='bsp-guide' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -127,28 +128,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
1527
documentation/bsp-guide/bsp.rst
Normal file
1527
documentation/bsp-guide/bsp.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='bsp'>
|
||||
|
||||
@@ -2157,7 +2158,7 @@
|
||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_BOOT_FILES'><filename>IMAGE_BOOT_FILES</filename></ulink>:
|
||||
Files installed into the device's boot partition
|
||||
when preparing the image using the Wic tool
|
||||
with the <filename>bootimg-partition</filename>
|
||||
with the <filename>bootimg-partition</filename> or <filename>bootimg-efi</filename>
|
||||
source plugin.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
73
documentation/bsp-guide/history.rst
Normal file
73
documentation/bsp-guide/history.rst
Normal file
@@ -0,0 +1,73 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************
|
||||
Manual Revision History
|
||||
***********************
|
||||
|
||||
.. list-table::
|
||||
:widths: 10 15 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Revision
|
||||
- Date
|
||||
- Note
|
||||
* - 0.9
|
||||
- November 2010
|
||||
- The initial document released with the Yocto Project 0.9 Release
|
||||
* - 1.0
|
||||
- April 2011
|
||||
- Released with the Yocto Project 1.0 Release.
|
||||
* - 1.1
|
||||
- October 2011
|
||||
- Released with the Yocto Project 1.1 Release.
|
||||
* - 1.2
|
||||
- April 2012
|
||||
- Released with the Yocto Project 1.2 Release.
|
||||
* - 1.3
|
||||
- October 2012
|
||||
- Released with the Yocto Project 1.3 Release.
|
||||
* - 1.4
|
||||
- April 2013
|
||||
- Released with the Yocto Project 1.4 Release.
|
||||
* - 1.5
|
||||
- October 2013
|
||||
- Released with the Yocto Project 1.5 Release.
|
||||
* - 1.6
|
||||
- April 2014
|
||||
- Released with the Yocto Project 1.6 Release.
|
||||
* - 1.7
|
||||
- October 2014
|
||||
- Released with the Yocto Project 1.7 Release.
|
||||
* - 1.8
|
||||
- April 2015
|
||||
- Released with the Yocto Project 1.8 Release.
|
||||
* - 2.0
|
||||
- October 2015
|
||||
- Released with the Yocto Project 2.0 Release.
|
||||
* - 2.1
|
||||
- April 2016
|
||||
- Released with the Yocto Project 2.1 Release.
|
||||
* - 2.2
|
||||
- October 2016
|
||||
- Released with the Yocto Project 2.2 Release.
|
||||
* - 2.3
|
||||
- May 2017
|
||||
- Released with the Yocto Project 2.3 Release.
|
||||
* - 2.4
|
||||
- October 2017
|
||||
- Released with the Yocto Project 2.4 Release.
|
||||
* - 2.5
|
||||
- May 2018
|
||||
- Released with the Yocto Project 2.5 Release.
|
||||
* - 2.6
|
||||
- November 2018
|
||||
- Released with the Yocto Project 2.6 Release.
|
||||
* - 2.7
|
||||
- May 2019
|
||||
- Released with the Yocto Project 2.7 Release.
|
||||
* - 3.0
|
||||
- October 2019
|
||||
- Released with the Yocto Project 3.0 Release.
|
||||
* - 3.1
|
||||
- April 2020
|
||||
- Released with the Yocto Project 3.1 Release.
|
||||
127
documentation/conf.py
Normal file
127
documentation/conf.py
Normal file
@@ -0,0 +1,127 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
current_version = "dev"
|
||||
|
||||
# String used in sidebar
|
||||
version = 'Version: ' + current_version
|
||||
if current_version == 'dev':
|
||||
version = 'Version: Current Development'
|
||||
# Version seen in documentation_options.js and hence in js switchers code
|
||||
release = current_version
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
project = 'The Yocto Project'
|
||||
copyright = '2010-%s, The Linux Foundation' % datetime.datetime.now().year
|
||||
author = 'The Linux Foundation'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# to load local extension from the folder 'sphinx'
|
||||
sys.path.insert(0, os.path.abspath('sphinx'))
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'sphinx.ext.extlinks',
|
||||
'sphinx.ext.intersphinx',
|
||||
'yocto-vars'
|
||||
]
|
||||
autosectionlabel_prefix_document = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'boilerplate.rst',
|
||||
'adt-manual/*.rst']
|
||||
|
||||
# master document name. The default changed from contents to index. so better
|
||||
# set it ourselves.
|
||||
master_doc = 'index'
|
||||
|
||||
# create substitution for project configuration variables
|
||||
rst_prolog = """
|
||||
.. |project_name| replace:: %s
|
||||
.. |copyright| replace:: %s
|
||||
.. |author| replace:: %s
|
||||
""" % (project, copyright, author)
|
||||
|
||||
# external links and substitutions
|
||||
extlinks = {
|
||||
'yocto_home': ('https://yoctoproject.org%s', None),
|
||||
'yocto_wiki': ('https://wiki.yoctoproject.org%s', None),
|
||||
'yocto_dl': ('https://downloads.yoctoproject.org%s', None),
|
||||
'yocto_lists': ('https://lists.yoctoproject.org%s', None),
|
||||
'yocto_bugs': ('https://bugzilla.yoctoproject.org%s', None),
|
||||
'yocto_ab': ('https://autobuilder.yoctoproject.org%s', None),
|
||||
'yocto_docs': ('https://docs.yoctoproject.org%s', None),
|
||||
'yocto_git': ('https://git.yoctoproject.org%s', None),
|
||||
'oe_home': ('https://www.openembedded.org%s', None),
|
||||
'oe_lists': ('https://lists.openembedded.org%s', None),
|
||||
}
|
||||
|
||||
# Intersphinx config to use cross reference with Bitbake user manual
|
||||
intersphinx_mapping = {
|
||||
'bitbake': ('https://docs.yoctoproject.org/bitbake/', None)
|
||||
}
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
try:
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_options = {
|
||||
'sticky_navigation': False,
|
||||
}
|
||||
except ImportError:
|
||||
sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\
|
||||
\nPlease make sure to install the sphinx_rtd_theme python package.\n")
|
||||
sys.exit(1)
|
||||
|
||||
html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['sphinx-static']
|
||||
|
||||
html_context = {
|
||||
'current_version': current_version,
|
||||
}
|
||||
|
||||
# Add customm CSS and JS files
|
||||
html_css_files = ['theme_overrides.css']
|
||||
html_js_files = ['switchers.js']
|
||||
|
||||
# Hide 'Created using Sphinx' text
|
||||
html_show_sphinx = False
|
||||
|
||||
# Add 'Last updated' on each page
|
||||
html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# Remove the trailing 'dot' in section numbers
|
||||
html_secnumber_suffix = " "
|
||||
11803
documentation/dev-manual/dev-manual-common-tasks.rst
Normal file
11803
documentation/dev-manual/dev-manual-common-tasks.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='extendpoky'>
|
||||
|
||||
@@ -3189,7 +3190,7 @@
|
||||
building an image.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<filename>virtual/mesa</filename>:
|
||||
<filename>virtual/libgbm</filename>:
|
||||
Provides <filename>gbm.pc</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
@@ -8383,7 +8384,7 @@
|
||||
If you see the following error, you need to
|
||||
update or create a
|
||||
<filename>~/.mtoolsrc</filename> file and
|
||||
be sure to have the line “mtools_skip_check=1“
|
||||
be sure to have the line "mtools_skip_check=1"
|
||||
in the file.
|
||||
Then, run the Wic command again:
|
||||
<literallayout class='monospaced'>
|
||||
@@ -9057,6 +9058,9 @@
|
||||
<listitem><para>
|
||||
<link linkend='creating-node-package-manager-npm-packages'>Creating node package manager (NPM) packages</link>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<link linkend='adding-custom-metadata-to-packages'>Adding custom metadata to packages</link>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
@@ -9833,7 +9837,7 @@
|
||||
<listitem><para>
|
||||
Select the desired package format as follows:
|
||||
<literallayout class='monospaced'>
|
||||
PACKAGE_CLASSES ?= “package_<replaceable>packageformat</replaceable>”
|
||||
PACKAGE_CLASSES ?= "package_<replaceable>packageformat</replaceable>"
|
||||
</literallayout>
|
||||
where <replaceable>packageformat</replaceable>
|
||||
can be "ipk", "rpm", "deb", or "tar" which are the
|
||||
@@ -10761,6 +10765,61 @@
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id='adding-custom-metadata-to-packages'>
|
||||
<title>Adding custom metadata to packages</title>
|
||||
|
||||
<para>
|
||||
The variable <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ADD_METADATA'><filename>PACKAGE_ADD_METADATA</filename></ulink>
|
||||
can be used to add additional metadata to packages. This is
|
||||
reflected in the package control/spec file. To take the ipk
|
||||
format for example, the CONTROL file stored inside would
|
||||
contain the additional metadata as additional lines.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The variable can be used in multiple ways, including using
|
||||
suffixes to set it for a specific package type and/or package.
|
||||
Note that the order of precedence is the same as this list:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<filename>PACKAGE_ADD_METADATA_<PKGTYPE>_<PN></filename>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<filename>PACKAGE_ADD_METADATA_<PKGTYPE></filename>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<filename>PACKAGE_ADD_METADATA_<PN></filename>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<filename>PACKAGE_ADD_METADATA</filename>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<PKGTYPE> is a parameter and expected to be a
|
||||
distinct name of specific package type:
|
||||
<itemizedlist>
|
||||
<listitem><para>IPK for .ipk packages</para></listitem>
|
||||
<listitem><para>DEB for .deb packages</para></listitem>
|
||||
<listitem><para>RPM for .rpm packages</para></listitem>
|
||||
</itemizedlist>
|
||||
<PN> is a parameter and expected to be a package name.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The variable can contain multiple [one-line] metadata fields
|
||||
separated by the literal sequence '\n'. The separator can be
|
||||
redefined using the variable flag <filename>separator</filename>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following is an example that adds two custom fields for
|
||||
ipk packages:
|
||||
<literallayout class='monospaced'>
|
||||
PACKAGE_ADD_METADATA_IPK = "Vendor: CustomIpk\nGroup: Applications/Spreadsheets"
|
||||
</literallayout>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
||||
<section id='efficiently-fetching-source-files-during-a-build'>
|
||||
@@ -14134,7 +14193,7 @@
|
||||
<filename>local.conf</filename> file or in an image
|
||||
recipe:
|
||||
<literallayout class='monospaced'>
|
||||
IMAGE_INSTALL_append = “ gdbserver"
|
||||
IMAGE_INSTALL_append = " gdbserver"
|
||||
</literallayout>
|
||||
The change makes sure the <filename>gdbserver</filename>
|
||||
package is included.
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
61
documentation/dev-manual/dev-manual-intro.rst
Normal file
61
documentation/dev-manual/dev-manual-intro.rst
Normal file
@@ -0,0 +1,61 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
******************************************
|
||||
The Yocto Project Development Tasks Manual
|
||||
******************************************
|
||||
|
||||
.. _dev-welcome:
|
||||
|
||||
Welcome
|
||||
=======
|
||||
|
||||
Welcome to the Yocto Project Development Tasks Manual! This manual
|
||||
provides relevant procedures necessary for developing in the Yocto
|
||||
Project environment (i.e. developing embedded Linux images and
|
||||
user-space applications that run on targeted devices). The manual groups
|
||||
related procedures into higher-level sections. Procedures can consist of
|
||||
high-level steps or low-level steps depending on the topic.
|
||||
|
||||
This manual provides the following:
|
||||
|
||||
- Procedures that help you get going with the Yocto Project. For
|
||||
example, procedures that show you how to set up a build host and work
|
||||
with the Yocto Project source repositories.
|
||||
|
||||
- Procedures that show you how to submit changes to the Yocto Project.
|
||||
Changes can be improvements, new features, or bug fixes.
|
||||
|
||||
- Procedures related to "everyday" tasks you perform while developing
|
||||
images and applications using the Yocto Project. For example,
|
||||
procedures to create a layer, customize an image, write a new recipe,
|
||||
and so forth.
|
||||
|
||||
This manual does not provide the following:
|
||||
|
||||
- Redundant Step-by-step Instructions: For example, the
|
||||
:doc:`../sdk-manual/sdk-manual` manual contains detailed
|
||||
instructions on how to install an SDK, which is used to develop
|
||||
applications for target hardware.
|
||||
|
||||
- Reference or Conceptual Material: This type of material resides in an
|
||||
appropriate reference manual. For example, system variables are
|
||||
documented in the :doc`../ref-manual/ref-manual`.
|
||||
|
||||
- Detailed Public Information Not Specific to the Yocto Project: For
|
||||
example, exhaustive information on how to use the Source Control
|
||||
Manager Git is better covered with Internet searches and official Git
|
||||
Documentation than through the Yocto Project documentation.
|
||||
|
||||
Other Information
|
||||
=================
|
||||
|
||||
Because this manual presents information for many different topics,
|
||||
supplemental information is recommended for full comprehension. For
|
||||
introductory information on the Yocto Project, see the
|
||||
:yocto_home:`Yocto Project Website <>`. If you want to build an image with no
|
||||
knowledge of Yocto Project as a way of quickly testing it out, see the
|
||||
:doc:`../brief-yoctoprojectqs/brief-yoctoprojectqs` document.
|
||||
|
||||
For a comprehensive list of links and other documentation, see the
|
||||
":ref:`ref-manual/resources:links and related documentation`"
|
||||
section in the Yocto Project Reference Manual.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='dev-manual-intro'>
|
||||
|
||||
|
||||
470
documentation/dev-manual/dev-manual-qemu.rst
Normal file
470
documentation/dev-manual/dev-manual-qemu.rst
Normal file
@@ -0,0 +1,470 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*******************************
|
||||
Using the Quick EMUlator (QEMU)
|
||||
*******************************
|
||||
|
||||
The Yocto Project uses an implementation of the Quick EMUlator (QEMU)
|
||||
Open Source project as part of the Yocto Project development "tool set".
|
||||
This chapter provides both procedures that show you how to use the Quick
|
||||
EMUlator (QEMU) and other QEMU information helpful for development
|
||||
purposes.
|
||||
|
||||
.. _qemu-dev-overview:
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Within the context of the Yocto Project, QEMU is an emulator and
|
||||
virtualization machine that allows you to run a complete image you have
|
||||
built using the Yocto Project as just another task on your build system.
|
||||
QEMU is useful for running and testing images and applications on
|
||||
supported Yocto Project architectures without having actual hardware.
|
||||
Among other things, the Yocto Project uses QEMU to run automated Quality
|
||||
Assurance (QA) tests on final images shipped with each release.
|
||||
|
||||
.. note::
|
||||
|
||||
This implementation is not the same as QEMU in general.
|
||||
|
||||
This section provides a brief reference for the Yocto Project
|
||||
implementation of QEMU.
|
||||
|
||||
For official information and documentation on QEMU in general, see the
|
||||
following references:
|
||||
|
||||
- `QEMU Website <http://wiki.qemu.org/Main_Page>`__\ *:* The official
|
||||
website for the QEMU Open Source project.
|
||||
|
||||
- `Documentation <http://wiki.qemu.org/Manual>`__\ *:* The QEMU user
|
||||
manual.
|
||||
|
||||
.. _qemu-running-qemu:
|
||||
|
||||
Running QEMU
|
||||
============
|
||||
|
||||
To use QEMU, you need to have QEMU installed and initialized as well as
|
||||
have the proper artifacts (i.e. image files and root filesystems)
|
||||
available. Follow these general steps to run QEMU:
|
||||
|
||||
1. *Install QEMU:* QEMU is made available with the Yocto Project a
|
||||
number of ways. One method is to install a Software Development Kit
|
||||
(SDK). See ":ref:`sdk-manual/sdk-intro:the qemu emulator`" section in the
|
||||
Yocto Project Application Development and the Extensible Software
|
||||
Development Kit (eSDK) manual for information on how to install QEMU.
|
||||
|
||||
2. *Setting Up the Environment:* How you set up the QEMU environment
|
||||
depends on how you installed QEMU:
|
||||
|
||||
- If you cloned the ``poky`` repository or you downloaded and
|
||||
unpacked a Yocto Project release tarball, you can source the build
|
||||
environment script (i.e. :ref:`structure-core-script`):
|
||||
::
|
||||
|
||||
$ cd ~/poky
|
||||
$ source oe-init-build-env
|
||||
|
||||
- If you installed a cross-toolchain, you can run the script that
|
||||
initializes the toolchain. For example, the following commands run
|
||||
the initialization script from the default ``poky_sdk`` directory:
|
||||
::
|
||||
|
||||
. ~/poky_sdk/environment-setup-core2-64-poky-linux
|
||||
|
||||
3. *Ensure the Artifacts are in Place:* You need to be sure you have a
|
||||
pre-built kernel that will boot in QEMU. You also need the target
|
||||
root filesystem for your target machine's architecture:
|
||||
|
||||
- If you have previously built an image for QEMU (e.g. ``qemux86``,
|
||||
``qemuarm``, and so forth), then the artifacts are in place in
|
||||
your :term:`Build Directory`.
|
||||
|
||||
- If you have not built an image, you can go to the
|
||||
:yocto_dl:`machines/qemu </releases/yocto/yocto-3.1.2/machines/qemu/>` area and download a
|
||||
pre-built image that matches your architecture and can be run on
|
||||
QEMU.
|
||||
|
||||
See the ":ref:`sdk-manual/sdk-appendix-obtain:extracting the root filesystem`"
|
||||
section in the Yocto Project Application Development and the
|
||||
Extensible Software Development Kit (eSDK) manual for information on
|
||||
how to extract a root filesystem.
|
||||
|
||||
4. *Run QEMU:* The basic ``runqemu`` command syntax is as follows:
|
||||
::
|
||||
|
||||
$ runqemu [option ] [...]
|
||||
|
||||
Based on what you provide on the command
|
||||
line, ``runqemu`` does a good job of figuring out what you are trying
|
||||
to do. For example, by default, QEMU looks for the most recently
|
||||
built image according to the timestamp when it needs to look for an
|
||||
image. Minimally, through the use of options, you must provide either
|
||||
a machine name, a virtual machine image (``*wic.vmdk``), or a kernel
|
||||
image (``*.bin``).
|
||||
|
||||
Here are some additional examples to help illustrate further QEMU:
|
||||
|
||||
- This example starts QEMU with MACHINE set to "qemux86-64".
|
||||
Assuming a standard
|
||||
:term:`Build Directory`, ``runqemu``
|
||||
automatically finds the ``bzImage-qemux86-64.bin`` image file and
|
||||
the ``core-image-minimal-qemux86-64-20200218002850.rootfs.ext4``
|
||||
(assuming the current build created a ``core-image-minimal``
|
||||
image).
|
||||
|
||||
.. note::
|
||||
|
||||
When more than one image with the same name exists, QEMU finds
|
||||
and uses the most recently built image according to the
|
||||
timestamp.
|
||||
|
||||
::
|
||||
|
||||
$ runqemu qemux86-64
|
||||
|
||||
- This example produces the exact same results as the previous
|
||||
example. This command, however, specifically provides the image
|
||||
and root filesystem type.
|
||||
::
|
||||
|
||||
$ runqemu qemux86-64 core-image-minimal ext4
|
||||
|
||||
- This example specifies to boot an initial RAM disk image and to
|
||||
enable audio in QEMU. For this case, ``runqemu`` set the internal
|
||||
variable ``FSTYPE`` to "cpio.gz". Also, for audio to be enabled,
|
||||
an appropriate driver must be installed (see the previous
|
||||
description for the ``audio`` option for more information).
|
||||
::
|
||||
|
||||
$ runqemu qemux86-64 ramfs audio
|
||||
|
||||
- This example does not provide enough information for QEMU to
|
||||
launch. While the command does provide a root filesystem type, it
|
||||
must also minimally provide a MACHINE, KERNEL, or VM option.
|
||||
::
|
||||
|
||||
$ runqemu ext4
|
||||
|
||||
- This example specifies to boot a virtual machine image
|
||||
(``.wic.vmdk`` file). From the ``.wic.vmdk``, ``runqemu``
|
||||
determines the QEMU architecture (MACHINE) to be "qemux86-64" and
|
||||
the root filesystem type to be "vmdk".
|
||||
::
|
||||
|
||||
$ runqemu /home/scott-lenovo/vm/core-image-minimal-qemux86-64.wic.vmdk
|
||||
|
||||
Switching Between Consoles
|
||||
==========================
|
||||
|
||||
When booting or running QEMU, you can switch between supported consoles
|
||||
by using Ctrl+Alt+number. For example, Ctrl+Alt+3 switches you to the
|
||||
serial console as long as that console is enabled. Being able to switch
|
||||
consoles is helpful, for example, if the main QEMU console breaks for
|
||||
some reason.
|
||||
|
||||
.. note::
|
||||
|
||||
Usually, "2" gets you to the main console and "3" gets you to the
|
||||
serial console.
|
||||
|
||||
Removing the Splash Screen
|
||||
==========================
|
||||
|
||||
You can remove the splash screen when QEMU is booting by using Alt+left.
|
||||
Removing the splash screen allows you to see what is happening in the
|
||||
background.
|
||||
|
||||
Disabling the Cursor Grab
|
||||
=========================
|
||||
|
||||
The default QEMU integration captures the cursor within the main window.
|
||||
It does this since standard mouse devices only provide relative input
|
||||
and not absolute coordinates. You then have to break out of the grab
|
||||
using the "Ctrl+Alt" key combination. However, the Yocto Project's
|
||||
integration of QEMU enables the wacom USB touch pad driver by default to
|
||||
allow input of absolute coordinates. This default means that the mouse
|
||||
can enter and leave the main window without the grab taking effect
|
||||
leading to a better user experience.
|
||||
|
||||
.. _qemu-running-under-a-network-file-system-nfs-server:
|
||||
|
||||
Running Under a Network File System (NFS) Server
|
||||
================================================
|
||||
|
||||
One method for running QEMU is to run it on an NFS server. This is
|
||||
useful when you need to access the same file system from both the build
|
||||
and the emulated system at the same time. It is also worth noting that
|
||||
the system does not need root privileges to run. It uses a user space
|
||||
NFS server to avoid that. Follow these steps to set up for running QEMU
|
||||
using an NFS server.
|
||||
|
||||
1. *Extract a Root Filesystem:* Once you are able to run QEMU in your
|
||||
environment, you can use the ``runqemu-extract-sdk`` script, which is
|
||||
located in the ``scripts`` directory along with the ``runqemu``
|
||||
script.
|
||||
|
||||
The ``runqemu-extract-sdk`` takes a root filesystem tarball and
|
||||
extracts it into a location that you specify. Here is an example that
|
||||
takes a file system and extracts it to a directory named
|
||||
``test-nfs``:
|
||||
::
|
||||
|
||||
runqemu-extract-sdk ./tmp/deploy/images/qemux86-64/core-image-sato-qemux86-64.tar.bz2 test-nfs
|
||||
|
||||
2. *Start QEMU:* Once you have extracted the file system, you can run
|
||||
``runqemu`` normally with the additional location of the file system.
|
||||
You can then also make changes to the files within ``./test-nfs`` and
|
||||
see those changes appear in the image in real time. Here is an
|
||||
example using the ``qemux86`` image:
|
||||
::
|
||||
|
||||
runqemu qemux86-64 ./test-nfs
|
||||
|
||||
.. note::
|
||||
|
||||
Should you need to start, stop, or restart the NFS share, you can use
|
||||
the following commands:
|
||||
|
||||
- The following command starts the NFS share: runqemu-export-rootfs
|
||||
start file-system-location
|
||||
|
||||
- The following command stops the NFS share: runqemu-export-rootfs
|
||||
stop file-system-location
|
||||
|
||||
- The following command restarts the NFS share:
|
||||
runqemu-export-rootfs restart file-system-location
|
||||
|
||||
.. _qemu-kvm-cpu-compatibility:
|
||||
|
||||
QEMU CPU Compatibility Under KVM
|
||||
================================
|
||||
|
||||
By default, the QEMU build compiles for and targets 64-bit and x86 Intel
|
||||
Core2 Duo processors and 32-bit x86 Intel Pentium II processors. QEMU
|
||||
builds for and targets these CPU types because they display a broad
|
||||
range of CPU feature compatibility with many commonly used CPUs.
|
||||
|
||||
Despite this broad range of compatibility, the CPUs could support a
|
||||
feature that your host CPU does not support. Although this situation is
|
||||
not a problem when QEMU uses software emulation of the feature, it can
|
||||
be a problem when QEMU is running with KVM enabled. Specifically,
|
||||
software compiled with a certain CPU feature crashes when run on a CPU
|
||||
under KVM that does not support that feature. To work around this
|
||||
problem, you can override QEMU's runtime CPU setting by changing the
|
||||
``QB_CPU_KVM`` variable in ``qemuboot.conf`` in the
|
||||
:term:`Build Directory` ``deploy/image``
|
||||
directory. This setting specifies a ``-cpu`` option passed into QEMU in
|
||||
the ``runqemu`` script. Running ``qemu -cpu help`` returns a list of
|
||||
available supported CPU types.
|
||||
|
||||
.. _qemu-dev-performance:
|
||||
|
||||
QEMU Performance
|
||||
================
|
||||
|
||||
Using QEMU to emulate your hardware can result in speed issues depending
|
||||
on the target and host architecture mix. For example, using the
|
||||
``qemux86`` image in the emulator on an Intel-based 32-bit (x86) host
|
||||
machine is fast because the target and host architectures match. On the
|
||||
other hand, using the ``qemuarm`` image on the same Intel-based host can
|
||||
be slower. But, you still achieve faithful emulation of ARM-specific
|
||||
issues.
|
||||
|
||||
To speed things up, the QEMU images support using ``distcc`` to call a
|
||||
cross-compiler outside the emulated system. If you used ``runqemu`` to
|
||||
start QEMU, and the ``distccd`` application is present on the host
|
||||
system, any BitBake cross-compiling toolchain available from the build
|
||||
system is automatically used from within QEMU simply by calling
|
||||
``distcc``. You can accomplish this by defining the cross-compiler
|
||||
variable (e.g. ``export CC="distcc"``). Alternatively, if you are using
|
||||
a suitable SDK image or the appropriate stand-alone toolchain is
|
||||
present, the toolchain is also automatically used.
|
||||
|
||||
.. note::
|
||||
|
||||
Several mechanisms exist that let you connect to the system running
|
||||
on the QEMU emulator:
|
||||
|
||||
- QEMU provides a framebuffer interface that makes standard consoles
|
||||
available.
|
||||
|
||||
- Generally, headless embedded devices have a serial port. If so,
|
||||
you can configure the operating system of the running image to use
|
||||
that port to run a console. The connection uses standard IP
|
||||
networking.
|
||||
|
||||
- SSH servers exist in some QEMU images. The ``core-image-sato``
|
||||
QEMU image has a Dropbear secure shell (SSH) server that runs with
|
||||
the root password disabled. The ``core-image-full-cmdline`` and
|
||||
``core-image-lsb`` QEMU images have OpenSSH instead of Dropbear.
|
||||
Including these SSH servers allow you to use standard ``ssh`` and
|
||||
``scp`` commands. The ``core-image-minimal`` QEMU image, however,
|
||||
contains no SSH server.
|
||||
|
||||
- You can use a provided, user-space NFS server to boot the QEMU
|
||||
session using a local copy of the root filesystem on the host. In
|
||||
order to make this connection, you must extract a root filesystem
|
||||
tarball by using the ``runqemu-extract-sdk`` command. After
|
||||
running the command, you must then point the ``runqemu`` script to
|
||||
the extracted directory instead of a root filesystem image file.
|
||||
See the "`Running Under a Network File System (NFS)
|
||||
Server <#qemu-running-under-a-network-file-system-nfs-server>`__"
|
||||
section for more information.
|
||||
|
||||
.. _qemu-dev-command-line-syntax:
|
||||
|
||||
QEMU Command-Line Syntax
|
||||
========================
|
||||
|
||||
The basic ``runqemu`` command syntax is as follows:
|
||||
::
|
||||
|
||||
$ runqemu [option ] [...]
|
||||
|
||||
Based on what you provide on the command line, ``runqemu`` does a
|
||||
good job of figuring out what you are trying to do. For example, by
|
||||
default, QEMU looks for the most recently built image according to the
|
||||
timestamp when it needs to look for an image. Minimally, through the use
|
||||
of options, you must provide either a machine name, a virtual machine
|
||||
image (``*wic.vmdk``), or a kernel image (``*.bin``).
|
||||
|
||||
Following is the command-line help output for the ``runqemu`` command:
|
||||
::
|
||||
|
||||
$ runqemu --help
|
||||
|
||||
Usage: you can run this script with any valid combination
|
||||
of the following environment variables (in any order):
|
||||
KERNEL - the kernel image file to use
|
||||
ROOTFS - the rootfs image file or nfsroot directory to use
|
||||
MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
|
||||
Simplified QEMU command-line options can be passed with:
|
||||
nographic - disable video console
|
||||
serial - enable a serial console on /dev/ttyS0
|
||||
slirp - enable user networking, no root privileges is required
|
||||
kvm - enable KVM when running x86/x86_64 (VT-capable CPU required)
|
||||
kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
|
||||
publicvnc - enable a VNC server open to all hosts
|
||||
audio - enable audio
|
||||
[*/]ovmf* - OVMF firmware file or base name for booting with UEFI
|
||||
tcpserial=<port> - specify tcp serial port number
|
||||
biosdir=<dir> - specify custom bios dir
|
||||
biosfilename=<filename> - specify bios filename
|
||||
qemuparams=<xyz> - specify custom parameters to QEMU
|
||||
bootparams=<xyz> - specify custom kernel parameters during boot
|
||||
help, -h, --help: print this text
|
||||
|
||||
Examples:
|
||||
runqemu
|
||||
runqemu qemuarm
|
||||
runqemu tmp/deploy/images/qemuarm
|
||||
runqemu tmp/deploy/images/qemux86/<qemuboot.conf>
|
||||
runqemu qemux86-64 core-image-sato ext4
|
||||
runqemu qemux86-64 wic-image-minimal wic
|
||||
runqemu path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
|
||||
runqemu qemux86 iso/hddimg/wic.vmdk/wic.qcow2/wic.vdi/ramfs/cpio.gz...
|
||||
runqemu qemux86 qemuparams="-m 256"
|
||||
runqemu qemux86 bootparams="psplash=false"
|
||||
runqemu path/to/<image>-<machine>.wic
|
||||
runqemu path/to/<image>-<machine>.wic.vmdk
|
||||
|
||||
.. _qemu-dev-runqemu-command-line-options:
|
||||
|
||||
``runqemu`` Command-Line Options
|
||||
================================
|
||||
|
||||
Following is a description of ``runqemu`` options you can provide on the
|
||||
command line:
|
||||
|
||||
.. note::
|
||||
|
||||
If you do provide some "illegal" option combination or perhaps you do
|
||||
not provide enough in the way of options,
|
||||
runqemu
|
||||
provides appropriate error messaging to help you correct the problem.
|
||||
|
||||
- QEMUARCH: The QEMU machine architecture, which must be "qemuarm",
|
||||
"qemuarm64", "qemumips", "qemumips64", "qemuppc", "qemux86", or
|
||||
"qemux86-64".
|
||||
|
||||
- ``VM``: The virtual machine image, which must be a ``.wic.vmdk``
|
||||
file. Use this option when you want to boot a ``.wic.vmdk`` image.
|
||||
The image filename you provide must contain one of the following
|
||||
strings: "qemux86-64", "qemux86", "qemuarm", "qemumips64",
|
||||
"qemumips", "qemuppc", or "qemush4".
|
||||
|
||||
- ROOTFS: A root filesystem that has one of the following filetype
|
||||
extensions: "ext2", "ext3", "ext4", "jffs2", "nfs", or "btrfs". If
|
||||
the filename you provide for this option uses "nfs", it must provide
|
||||
an explicit root filesystem path.
|
||||
|
||||
- KERNEL: A kernel image, which is a ``.bin`` file. When you provide a
|
||||
``.bin`` file, ``runqemu`` detects it and assumes the file is a
|
||||
kernel image.
|
||||
|
||||
- MACHINE: The architecture of the QEMU machine, which must be one of
|
||||
the following: "qemux86", "qemux86-64", "qemuarm", "qemuarm64",
|
||||
"qemumips", "qemumips64", or "qemuppc". The MACHINE and QEMUARCH
|
||||
options are basically identical. If you do not provide a MACHINE
|
||||
option, ``runqemu`` tries to determine it based on other options.
|
||||
|
||||
- ``ramfs``: Indicates you are booting an initial RAM disk (initramfs)
|
||||
image, which means the ``FSTYPE`` is ``cpio.gz``.
|
||||
|
||||
- ``iso``: Indicates you are booting an ISO image, which means the
|
||||
``FSTYPE`` is ``.iso``.
|
||||
|
||||
- ``nographic``: Disables the video console, which sets the console to
|
||||
"ttys0". This option is useful when you have logged into a server and
|
||||
you do not want to disable forwarding from the X Window System (X11)
|
||||
to your workstation or laptop.
|
||||
|
||||
- ``serial``: Enables a serial console on ``/dev/ttyS0``.
|
||||
|
||||
- ``biosdir``: Establishes a custom directory for BIOS, VGA BIOS and
|
||||
keymaps.
|
||||
|
||||
- ``biosfilename``: Establishes a custom BIOS name.
|
||||
|
||||
- ``qemuparams=\"xyz\"``: Specifies custom QEMU parameters. Use this
|
||||
option to pass options other than the simple "kvm" and "serial"
|
||||
options.
|
||||
|
||||
- ``bootparams=\"xyz\"``: Specifies custom boot parameters for the
|
||||
kernel.
|
||||
|
||||
- ``audio``: Enables audio in QEMU. The MACHINE option must be either
|
||||
"qemux86" or "qemux86-64" in order for audio to be enabled.
|
||||
Additionally, the ``snd_intel8x0`` or ``snd_ens1370`` driver must be
|
||||
installed in linux guest.
|
||||
|
||||
- ``slirp``: Enables "slirp" networking, which is a different way of
|
||||
networking that does not need root access but also is not as easy to
|
||||
use or comprehensive as the default.
|
||||
|
||||
- ``kvm``: Enables KVM when running "qemux86" or "qemux86-64" QEMU
|
||||
architectures. For KVM to work, all the following conditions must be
|
||||
met:
|
||||
|
||||
- Your MACHINE must be either qemux86" or "qemux86-64".
|
||||
|
||||
- Your build host has to have the KVM modules installed, which are
|
||||
``/dev/kvm``.
|
||||
|
||||
- The build host ``/dev/kvm`` directory has to be both writable and
|
||||
readable.
|
||||
|
||||
- ``kvm-vhost``: Enables KVM with VHOST support when running "qemux86"
|
||||
or "qemux86-64" QEMU architectures. For KVM with VHOST to work, the
|
||||
following conditions must be met:
|
||||
|
||||
- `kvm <#kvm-cond>`__ option conditions must be met.
|
||||
|
||||
- Your build host has to have virtio net device, which are
|
||||
``/dev/vhost-net``.
|
||||
|
||||
- The build host ``/dev/vhost-net`` directory has to be either
|
||||
readable or writable and "slirp-enabled".
|
||||
|
||||
- ``publicvnc``: Enables a VNC server open to all hosts.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='dev-manual-qemu'>
|
||||
|
||||
@@ -105,7 +106,7 @@
|
||||
You need to be sure you have a pre-built kernel that
|
||||
will boot in QEMU.
|
||||
You also need the target root filesystem for your target
|
||||
machine’s architecture:
|
||||
machine's architecture:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
If you have previously built an image for QEMU
|
||||
@@ -552,7 +553,7 @@
|
||||
A root filesystem that has one of the following
|
||||
filetype extensions: "ext2", "ext3", "ext4", "jffs2",
|
||||
"nfs", or "btrfs".
|
||||
If the filename you provide for this option uses “nfs”, it
|
||||
If the filename you provide for this option uses "nfs", it
|
||||
must provide an explicit root filesystem path.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
@@ -566,7 +567,7 @@
|
||||
<replaceable>MACHINE</replaceable>:
|
||||
The architecture of the QEMU machine, which must be one
|
||||
of the following: "qemux86", "qemux86-64", "qemuarm",
|
||||
"qemuarm64", "qemumips", “qemumips64", or "qemuppc".
|
||||
"qemuarm64", "qemumips", "qemumips64", or "qemuppc".
|
||||
The <replaceable>MACHINE</replaceable> and
|
||||
<replaceable>QEMUARCH</replaceable> options are basically
|
||||
identical.
|
||||
@@ -673,7 +674,7 @@ qemux86" or "qemux86-64".
|
||||
<listitem><para>
|
||||
The build host <filename>/dev/vhost-net</filename>
|
||||
directory has to be either readable or writable
|
||||
and “slirp-enabled”.
|
||||
and "slirp-enabled".
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
|
||||
940
documentation/dev-manual/dev-manual-start.rst
Normal file
940
documentation/dev-manual/dev-manual-start.rst
Normal file
@@ -0,0 +1,940 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************************
|
||||
Setting Up to Use the Yocto Project
|
||||
***********************************
|
||||
|
||||
This chapter provides guidance on how to prepare to use the Yocto
|
||||
Project. You can learn about creating a team environment to develop
|
||||
using the Yocto Project, how to set up a :ref:`build
|
||||
host <dev-manual/dev-manual-start:preparing the build host>`, how to locate
|
||||
Yocto Project source repositories, and how to create local Git
|
||||
repositories.
|
||||
|
||||
.. _usingpoky-changes-collaborate:
|
||||
|
||||
Creating a Team Development Environment
|
||||
=======================================
|
||||
|
||||
It might not be immediately clear how you can use the Yocto Project in a
|
||||
team development environment, or how to scale it for a large team of
|
||||
developers. You can adapt the Yocto Project to many different use cases
|
||||
and scenarios; however, this flexibility could cause difficulties if you
|
||||
are trying to create a working setup that scales effectively.
|
||||
|
||||
To help you understand how to set up this type of environment, this
|
||||
section presents a procedure that gives you information that can help
|
||||
you get the results you want. The procedure is high-level and presents
|
||||
some of the project's most successful experiences, practices, solutions,
|
||||
and available technologies that have proved to work well in the past;
|
||||
however, keep in mind, the procedure here is simply a starting point.
|
||||
You can build off these steps and customize the procedure to fit any
|
||||
particular working environment and set of practices.
|
||||
|
||||
1. *Determine Who is Going to be Developing:* You first need to
|
||||
understand who is going to be doing anything related to the Yocto
|
||||
Project and determine their roles. Making this determination is
|
||||
essential to completing subsequent steps, which are to get your
|
||||
equipment together and set up your development environment's
|
||||
hardware topology.
|
||||
|
||||
The following roles exist:
|
||||
|
||||
- *Application Developer:* This type of developer does application
|
||||
level work on top of an existing software stack.
|
||||
|
||||
- *Core System Developer:* This type of developer works on the
|
||||
contents of the operating system image itself.
|
||||
|
||||
- *Build Engineer:* This type of developer manages Autobuilders and
|
||||
releases. Depending on the specifics of the environment, not all
|
||||
situations might need a Build Engineer.
|
||||
|
||||
- *Test Engineer:* This type of developer creates and manages
|
||||
automated tests that are used to ensure all application and core
|
||||
system development meets desired quality standards.
|
||||
|
||||
2. *Gather the Hardware:* Based on the size and make-up of the team,
|
||||
get the hardware together. Ideally, any development, build, or test
|
||||
engineer uses a system that runs a supported Linux distribution.
|
||||
These systems, in general, should be high performance (e.g. dual,
|
||||
six-core Xeons with 24 Gbytes of RAM and plenty of disk space). You
|
||||
can help ensure efficiency by having any machines used for testing
|
||||
or that run Autobuilders be as high performance as possible.
|
||||
|
||||
.. note::
|
||||
|
||||
Given sufficient processing power, you might also consider
|
||||
building Yocto Project development containers to be run under
|
||||
Docker, which is described later.
|
||||
|
||||
3. *Understand the Hardware Topology of the Environment:* Once you
|
||||
understand the hardware involved and the make-up of the team, you
|
||||
can understand the hardware topology of the development environment.
|
||||
You can get a visual idea of the machines and their roles across the
|
||||
development environment.
|
||||
|
||||
4. *Use Git as Your Source Control Manager (SCM):* Keeping your
|
||||
:term:`Metadata` (i.e. recipes,
|
||||
configuration files, classes, and so forth) and any software you are
|
||||
developing under the control of an SCM system that is compatible
|
||||
with the OpenEmbedded build system is advisable. Of all of the SCMs
|
||||
supported by BitBake, the Yocto Project team strongly recommends using
|
||||
:ref:`overview-manual/overview-manual-development-environment:git`.
|
||||
Git is a distributed system
|
||||
that is easy to back up, allows you to work remotely, and then
|
||||
connects back to the infrastructure.
|
||||
|
||||
.. note::
|
||||
|
||||
For information about BitBake, see the
|
||||
BitBake User Manual
|
||||
.
|
||||
|
||||
It is relatively easy to set up Git services and create
|
||||
infrastructure like
|
||||
:yocto_git:`http://git.yoctoproject.org <>`, which is based on
|
||||
server software called ``gitolite`` with ``cgit`` being used to
|
||||
generate the web interface that lets you view the repositories. The
|
||||
``gitolite`` software identifies users using SSH keys and allows
|
||||
branch-based access controls to repositories that you can control as
|
||||
little or as much as necessary.
|
||||
|
||||
.. note::
|
||||
|
||||
The setup of these services is beyond the scope of this manual.
|
||||
However, sites such as the following exist that describe how to
|
||||
perform setup:
|
||||
|
||||
- `Git documentation <http://git-scm.com/book/ch4-8.html>`__:
|
||||
Describes how to install ``gitolite`` on the server.
|
||||
|
||||
- `Gitolite <http://gitolite.com>`__: Information for
|
||||
``gitolite``.
|
||||
|
||||
- `Interfaces, frontends, and
|
||||
tools <https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools>`__:
|
||||
Documentation on how to create interfaces and frontends for
|
||||
Git.
|
||||
|
||||
5. *Set up the Application Development Machines:* As mentioned earlier,
|
||||
application developers are creating applications on top of existing
|
||||
software stacks. Following are some best practices for setting up
|
||||
machines used for application development:
|
||||
|
||||
- Use a pre-built toolchain that contains the software stack
|
||||
itself. Then, develop the application code on top of the stack.
|
||||
This method works well for small numbers of relatively isolated
|
||||
applications.
|
||||
|
||||
- Keep your cross-development toolchains updated. You can do this
|
||||
through provisioning either as new toolchain downloads or as
|
||||
updates through a package update mechanism using ``opkg`` to
|
||||
provide updates to an existing toolchain. The exact mechanics of
|
||||
how and when to do this depend on local policy.
|
||||
|
||||
- Use multiple toolchains installed locally into different
|
||||
locations to allow development across versions.
|
||||
|
||||
6. *Set up the Core Development Machines:* As mentioned earlier, core
|
||||
developers work on the contents of the operating system itself.
|
||||
Following are some best practices for setting up machines used for
|
||||
developing images:
|
||||
|
||||
- Have the :term:`OpenEmbedded Build System` available on
|
||||
the developer workstations so developers can run their own builds
|
||||
and directly rebuild the software stack.
|
||||
|
||||
- Keep the core system unchanged as much as possible and do your
|
||||
work in layers on top of the core system. Doing so gives you a
|
||||
greater level of portability when upgrading to new versions of
|
||||
the core system or Board Support Packages (BSPs).
|
||||
|
||||
- Share layers amongst the developers of a particular project and
|
||||
contain the policy configuration that defines the project.
|
||||
|
||||
7. *Set up an Autobuilder:* Autobuilders are often the core of the
|
||||
development environment. It is here that changes from individual
|
||||
developers are brought together and centrally tested. Based on this
|
||||
automated build and test environment, subsequent decisions about
|
||||
releases can be made. Autobuilders also allow for "continuous
|
||||
integration" style testing of software components and regression
|
||||
identification and tracking.
|
||||
|
||||
See "`Yocto Project
|
||||
Autobuilder <http://autobuilder.yoctoproject.org>`__" for more
|
||||
information and links to buildbot. The Yocto Project team has found
|
||||
this implementation works well in this role. A public example of
|
||||
this is the Yocto Project Autobuilders, which the Yocto Project team
|
||||
uses to test the overall health of the project.
|
||||
|
||||
The features of this system are:
|
||||
|
||||
- Highlights when commits break the build.
|
||||
|
||||
- Populates an :ref:`sstate
|
||||
cache <overview-manual/overview-manual-concepts:shared state cache>` from which
|
||||
developers can pull rather than requiring local builds.
|
||||
|
||||
- Allows commit hook triggers, which trigger builds when commits
|
||||
are made.
|
||||
|
||||
- Allows triggering of automated image booting and testing under
|
||||
the QuickEMUlator (QEMU).
|
||||
|
||||
- Supports incremental build testing and from-scratch builds.
|
||||
|
||||
- Shares output that allows developer testing and historical
|
||||
regression investigation.
|
||||
|
||||
- Creates output that can be used for releases.
|
||||
|
||||
- Allows scheduling of builds so that resources can be used
|
||||
efficiently.
|
||||
|
||||
8. *Set up Test Machines:* Use a small number of shared, high
|
||||
performance systems for testing purposes. Developers can use these
|
||||
systems for wider, more extensive testing while they continue to
|
||||
develop locally using their primary development system.
|
||||
|
||||
9. *Document Policies and Change Flow:* The Yocto Project uses a
|
||||
hierarchical structure and a pull model. Scripts exist to create and
|
||||
send pull requests (i.e. ``create-pull-request`` and
|
||||
``send-pull-request``). This model is in line with other open source
|
||||
projects where maintainers are responsible for specific areas of the
|
||||
project and a single maintainer handles the final "top-of-tree"
|
||||
merges.
|
||||
|
||||
.. note::
|
||||
|
||||
You can also use a more collective push model. The
|
||||
gitolite
|
||||
software supports both the push and pull models quite easily.
|
||||
|
||||
As with any development environment, it is important to document the
|
||||
policy used as well as any main project guidelines so they are
|
||||
understood by everyone. It is also a good idea to have
|
||||
well-structured commit messages, which are usually a part of a
|
||||
project's guidelines. Good commit messages are essential when
|
||||
looking back in time and trying to understand why changes were made.
|
||||
|
||||
If you discover that changes are needed to the core layer of the
|
||||
project, it is worth sharing those with the community as soon as
|
||||
possible. Chances are if you have discovered the need for changes,
|
||||
someone else in the community needs them also.
|
||||
|
||||
10. *Development Environment Summary:* Aside from the previous steps,
|
||||
some best practices exist within the Yocto Project development
|
||||
environment. Consider the following:
|
||||
|
||||
- Use :ref:`overview-manual/overview-manual-development-environment:git` as the source control
|
||||
system.
|
||||
|
||||
- Maintain your Metadata in layers that make sense for your
|
||||
situation. See the ":ref:`overview-manual/overview-manual-yp-intro:the yocto project layer model`"
|
||||
section in the Yocto Project Overview and Concepts Manual and the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
|
||||
section for more information on layers.
|
||||
|
||||
- Separate the project's Metadata and code by using separate Git
|
||||
repositories. See the ":ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`"
|
||||
section in the Yocto Project Overview and Concepts Manual for
|
||||
information on these repositories. See the "`Locating Yocto
|
||||
Project Source Files <#locating-yocto-project-source-files>`__"
|
||||
section for information on how to set up local Git repositories
|
||||
for related upstream Yocto Project Git repositories.
|
||||
|
||||
- Set up the directory for the shared state cache
|
||||
(:term:`SSTATE_DIR`) where
|
||||
it makes sense. For example, set up the sstate cache on a system
|
||||
used by developers in the same organization and share the same
|
||||
source directories on their machines.
|
||||
|
||||
- Set up an Autobuilder and have it populate the sstate cache and
|
||||
source directories.
|
||||
|
||||
- The Yocto Project community encourages you to send patches to the
|
||||
project to fix bugs or add features. If you do submit patches,
|
||||
follow the project commit guidelines for writing good commit
|
||||
messages. See the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
|
||||
section.
|
||||
|
||||
- Send changes to the core sooner than later as others are likely
|
||||
to run into the same issues. For some guidance on mailing lists
|
||||
to use, see the list in the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
|
||||
section. For a description
|
||||
of the available mailing lists, see the ":ref:`resources-mailinglist`" section in
|
||||
the Yocto Project Reference Manual.
|
||||
|
||||
.. _dev-preparing-the-build-host:
|
||||
|
||||
Preparing the Build Host
|
||||
========================
|
||||
|
||||
This section provides procedures to set up a system to be used as your
|
||||
:term:`Build Host` for
|
||||
development using the Yocto Project. Your build host can be a native
|
||||
Linux machine (recommended), it can be a machine (Linux, Mac, or
|
||||
Windows) that uses `CROPS <https://github.com/crops/poky-container>`__,
|
||||
which leverages `Docker Containers <https://www.docker.com/>`__ or it
|
||||
can be a Windows machine capable of running Windows Subsystem For Linux
|
||||
v2 (WSL).
|
||||
|
||||
.. note::
|
||||
|
||||
The Yocto Project is not compatible with
|
||||
Windows Subsystem for Linux v1
|
||||
. It is compatible but not officially supported nor validated with
|
||||
WSLv2. If you still decide to use WSL please upgrade to
|
||||
WSLv2
|
||||
.
|
||||
|
||||
Once your build host is set up to use the Yocto Project, further steps
|
||||
are necessary depending on what you want to accomplish. See the
|
||||
following references for information on how to prepare for Board Support
|
||||
Package (BSP) development and kernel development:
|
||||
|
||||
- *BSP Development:* See the ":ref:`bsp-guide/bsp:preparing your build host to work with bsp layers`"
|
||||
section in the Yocto Project Board Support Package (BSP) Developer's
|
||||
Guide.
|
||||
|
||||
- *Kernel Development:* See the ":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
|
||||
section in the Yocto Project Linux Kernel Development Manual.
|
||||
|
||||
Setting Up a Native Linux Host
|
||||
------------------------------
|
||||
|
||||
Follow these steps to prepare a native Linux machine as your Yocto
|
||||
Project Build Host:
|
||||
|
||||
1. *Use a Supported Linux Distribution:* You should have a reasonably
|
||||
current Linux-based host system. You will have the best results with
|
||||
a recent release of Fedora, openSUSE, Debian, Ubuntu, RHEL or CentOS
|
||||
as these releases are frequently tested against the Yocto Project and
|
||||
officially supported. For a list of the distributions under
|
||||
validation and their status, see the ":ref:`Supported Linux
|
||||
Distributions <detailed-supported-distros>`"
|
||||
section in the Yocto Project Reference Manual and the wiki page at
|
||||
:yocto_wiki:`Distribution Support </wiki/Distribution_Support>`.
|
||||
|
||||
2. *Have Enough Free Memory:* Your system should have at least 50 Gbytes
|
||||
of free disk space for building images.
|
||||
|
||||
3. *Meet Minimal Version Requirements:* The OpenEmbedded build system
|
||||
should be able to run on any modern distribution that has the
|
||||
following versions for Git, tar, Python and gcc.
|
||||
|
||||
- Git 1.8.3.1 or greater
|
||||
|
||||
- tar 1.28 or greater
|
||||
|
||||
- Python 3.5.0 or greater.
|
||||
|
||||
- gcc 5.0 or greater.
|
||||
|
||||
If your build host does not meet any of these three listed version
|
||||
requirements, you can take steps to prepare the system so that you
|
||||
can still use the Yocto Project. See the
|
||||
":ref:`ref-manual/ref-system-requirements:required git, tar, python and gcc versions`"
|
||||
section in the Yocto Project Reference Manual for information.
|
||||
|
||||
4. *Install Development Host Packages:* Required development host
|
||||
packages vary depending on your build host and what you want to do
|
||||
with the Yocto Project. Collectively, the number of required packages
|
||||
is large if you want to be able to cover all cases.
|
||||
|
||||
For lists of required packages for all scenarios, see the
|
||||
":ref:`ref-manual/ref-system-requirements:required packages for the build host`"
|
||||
section in the Yocto Project Reference Manual.
|
||||
|
||||
Once you have completed the previous steps, you are ready to continue
|
||||
using a given development path on your native Linux machine. If you are
|
||||
going to use BitBake, see the
|
||||
":ref:`dev-manual/dev-manual-start:cloning the \`\`poky\`\` repository`"
|
||||
section. If you are going
|
||||
to use the Extensible SDK, see the ":doc:`../sdk-manual/sdk-extensible`" Chapter in the Yocto
|
||||
Project Application Development and the Extensible Software Development
|
||||
Kit (eSDK) manual. If you want to work on the kernel, see the :doc:`../kernel-dev/kernel-dev`. If you are going to use
|
||||
Toaster, see the ":doc:`../toaster-manual/toaster-manual-setup-and-use`"
|
||||
section in the Toaster User Manual.
|
||||
|
||||
.. _setting-up-to-use-crops:
|
||||
|
||||
Setting Up to Use CROss PlatformS (CROPS)
|
||||
-----------------------------------------
|
||||
|
||||
With `CROPS <https://github.com/crops/poky-container>`__, which
|
||||
leverages `Docker Containers <https://www.docker.com/>`__, you can
|
||||
create a Yocto Project development environment that is operating system
|
||||
agnostic. You can set up a container in which you can develop using the
|
||||
Yocto Project on a Windows, Mac, or Linux machine.
|
||||
|
||||
Follow these general steps to prepare a Windows, Mac, or Linux machine
|
||||
as your Yocto Project build host:
|
||||
|
||||
1. *Determine What Your Build Host Needs:*
|
||||
`Docker <https://www.docker.com/what-docker>`__ is a software
|
||||
container platform that you need to install on the build host.
|
||||
Depending on your build host, you might have to install different
|
||||
software to support Docker containers. Go to the Docker installation
|
||||
page and read about the platform requirements in "`Supported
|
||||
Platforms <https://docs.docker.com/engine/install/#supported-platforms>`__"
|
||||
your build host needs to run containers.
|
||||
|
||||
2. *Choose What To Install:* Depending on whether or not your build host
|
||||
meets system requirements, you need to install "Docker CE Stable" or
|
||||
the "Docker Toolbox". Most situations call for Docker CE. However, if
|
||||
you have a build host that does not meet requirements (e.g.
|
||||
Pre-Windows 10 or Windows 10 "Home" version), you must install Docker
|
||||
Toolbox instead.
|
||||
|
||||
3. *Go to the Install Site for Your Platform:* Click the link for the
|
||||
Docker edition associated with your build host's native software. For
|
||||
example, if your build host is running Microsoft Windows Version 10
|
||||
and you want the Docker CE Stable edition, click that link under
|
||||
"Supported Platforms".
|
||||
|
||||
4. *Install the Software:* Once you have understood all the
|
||||
pre-requisites, you can download and install the appropriate
|
||||
software. Follow the instructions for your specific machine and the
|
||||
type of the software you need to install:
|
||||
|
||||
- Install `Docker CE for
|
||||
Windows <https://docs.docker.com/docker-for-windows/install/#install-docker-desktop-on-windows>`__
|
||||
for Windows build hosts that meet requirements.
|
||||
|
||||
- Install `Docker CE for
|
||||
MacOs <https://docs.docker.com/docker-for-mac/install/#install-and-run-docker-desktop-on-mac>`__
|
||||
for Mac build hosts that meet requirements.
|
||||
|
||||
- Install `Docker Toolbox for
|
||||
Windows <https://docs.docker.com/toolbox/toolbox_install_windows/>`__
|
||||
for Windows build hosts that do not meet Docker requirements.
|
||||
|
||||
- Install `Docker Toolbox for
|
||||
MacOS <https://docs.docker.com/toolbox/toolbox_install_mac/>`__
|
||||
for Mac build hosts that do not meet Docker requirements.
|
||||
|
||||
- Install `Docker CE for
|
||||
CentOS <https://docs.docker.com/install/linux/docker-ce/centos/>`__
|
||||
for Linux build hosts running the CentOS distribution.
|
||||
|
||||
- Install `Docker CE for
|
||||
Debian <https://docs.docker.com/install/linux/docker-ce/debian/>`__
|
||||
for Linux build hosts running the Debian distribution.
|
||||
|
||||
- Install `Docker CE for
|
||||
Fedora <https://docs.docker.com/install/linux/docker-ce/fedora/>`__
|
||||
for Linux build hosts running the Fedora distribution.
|
||||
|
||||
- Install `Docker CE for
|
||||
Ubuntu <https://docs.docker.com/install/linux/docker-ce/ubuntu/>`__
|
||||
for Linux build hosts running the Ubuntu distribution.
|
||||
|
||||
5. *Optionally Orient Yourself With Docker:* If you are unfamiliar with
|
||||
Docker and the container concept, you can learn more here -
|
||||
https://docs.docker.com/get-started/.
|
||||
|
||||
6. *Launch Docker or Docker Toolbox:* You should be able to launch
|
||||
Docker or the Docker Toolbox and have a terminal shell on your
|
||||
development host.
|
||||
|
||||
7. *Set Up the Containers to Use the Yocto Project:* Go to
|
||||
https://github.com/crops/docker-win-mac-docs/wiki and follow
|
||||
the directions for your particular build host (i.e. Linux, Mac, or
|
||||
Windows).
|
||||
|
||||
Once you complete the setup instructions for your machine, you have
|
||||
the Poky, Extensible SDK, and Toaster containers available. You can
|
||||
click those links from the page and learn more about using each of
|
||||
those containers.
|
||||
|
||||
Once you have a container set up, everything is in place to develop just
|
||||
as if you were running on a native Linux machine. If you are going to
|
||||
use the Poky container, see the "`Cloning the ``poky``
|
||||
Repository <#cloning-the-poky-repository>`__" section. If you are going
|
||||
to use the Extensible SDK container, see the
|
||||
":doc:`../sdk-manual/sdk-extensible`" Chapter in the Yocto
|
||||
Project Application Development and the Extensible Software Development
|
||||
Kit (eSDK) manual. If you are going to use the Toaster container, see
|
||||
the ":doc:`../toaster-manual/toaster-manual-setup-and-use`"
|
||||
section in the Toaster User Manual.
|
||||
|
||||
.. _setting-up-to-use-wsl:
|
||||
|
||||
Setting Up to Use Windows Subsystem For Linux (WSLv2)
|
||||
-----------------------------------------------------
|
||||
|
||||
With `Windows Subsystem for Linux
|
||||
(WSLv2) <https://docs.microsoft.com/en-us/windows/wsl/wsl2-about>`__,
|
||||
you can create a Yocto Project development environment that allows you
|
||||
to build on Windows. You can set up a Linux distribution inside Windows
|
||||
in which you can develop using the Yocto Project.
|
||||
|
||||
Follow these general steps to prepare a Windows machine using WSLv2 as
|
||||
your Yocto Project build host:
|
||||
|
||||
1. *Make sure your Windows 10 machine is capable of running WSLv2:*
|
||||
WSLv2 is only available for Windows 10 builds > 18917. To check which
|
||||
build version you are running, you may open a command prompt on
|
||||
Windows and execute the command "ver".
|
||||
::
|
||||
|
||||
C:\Users\myuser> ver
|
||||
|
||||
Microsoft Windows [Version 10.0.19041.153]
|
||||
|
||||
If your build is capable of running
|
||||
WSLv2 you may continue, for more information on this subject or
|
||||
instructions on how to upgrade to WSLv2 visit `Windows 10
|
||||
WSLv2 <https://docs.microsoft.com/en-us/windows/wsl/wsl2-install>`__
|
||||
|
||||
2. *Install the Linux distribution of your choice inside Windows 10:*
|
||||
Once you know your version of Windows 10 supports WSLv2, you can
|
||||
install the distribution of your choice from the Microsoft Store.
|
||||
Open the Microsoft Store and search for Linux. While there are
|
||||
several Linux distributions available, the assumption is that your
|
||||
pick will be one of the distributions supported by the Yocto Project
|
||||
as stated on the instructions for using a native Linux host. After
|
||||
making your selection, simply click "Get" to download and install the
|
||||
distribution.
|
||||
|
||||
3. *Check your Linux distribution is using WSLv2:* Open a Windows
|
||||
PowerShell and run:
|
||||
::
|
||||
|
||||
C:\WINDOWS\system32> wsl -l -v
|
||||
NAME STATE VERSION
|
||||
*Ubuntu Running 2
|
||||
|
||||
Note the version column which says the WSL version
|
||||
being used by your distribution, on compatible systems, this can be
|
||||
changed back at any point in time.
|
||||
|
||||
4. *Optionally Orient Yourself on WSL:* If you are unfamiliar with WSL,
|
||||
you can learn more here -
|
||||
https://docs.microsoft.com/en-us/windows/wsl/wsl2-about.
|
||||
|
||||
5. *Launch your WSL Distibution:* From the Windows start menu simply
|
||||
launch your WSL distribution just like any other application.
|
||||
|
||||
6. *Optimize your WSLv2 storage often:* Due to the way storage is
|
||||
handled on WSLv2, the storage space used by the undelying Linux
|
||||
distribution is not reflected immedately, and since bitbake heavily
|
||||
uses storage, after several builds, you may be unaware you are
|
||||
running out of space. WSLv2 uses a VHDX file for storage, this issue
|
||||
can be easily avoided by manually optimizing this file often, this
|
||||
can be done in the following way:
|
||||
|
||||
1. *Find the location of your VHDX file:* First you need to find the
|
||||
distro app package directory, to achieve this open a Windows
|
||||
Powershell as Administrator and run:
|
||||
::
|
||||
|
||||
C:\WINDOWS\system32> Get-AppxPackage -Name "*Ubuntu*" | Select PackageFamilyName
|
||||
PackageFamilyName
|
||||
-----------------
|
||||
CanonicalGroupLimited.UbuntuonWindows_79abcdefgh
|
||||
|
||||
|
||||
You should now
|
||||
replace the PackageFamilyName and your user on the following path
|
||||
to find your VHDX file:
|
||||
::
|
||||
|
||||
ls C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\
|
||||
Mode LastWriteTime Length Name
|
||||
-a---- 3/14/2020 9:52 PM 57418973184 ext4.vhdx
|
||||
|
||||
Your VHDX file path is:
|
||||
``C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx``
|
||||
|
||||
2. *Optimize your VHDX file:* Open a Windows Powershell as
|
||||
Administrator to optimize your VHDX file, shutting down WSL first:
|
||||
::
|
||||
|
||||
C:\WINDOWS\system32> wsl --shutdown
|
||||
C:\WINDOWS\system32> optimize-vhd -Path C:\Users\myuser\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79abcdefgh\LocalState\ext4.vhdx -Mode full
|
||||
|
||||
A progress bar should be shown while optimizing the
|
||||
VHDX file, and storage should now be reflected correctly on the
|
||||
Windows Explorer.
|
||||
|
||||
.. note::
|
||||
|
||||
The current implementation of WSLv2 does not have out-of-the-box
|
||||
access to external devices such as those connected through a USB
|
||||
port, but it automatically mounts your
|
||||
C:
|
||||
drive on
|
||||
/mnt/c/
|
||||
(and others), which you can use to share deploy artifacts to be later
|
||||
flashed on hardware through Windows, but your build directory should
|
||||
not reside inside this mountpoint.
|
||||
|
||||
Once you have WSLv2 set up, everything is in place to develop just as if
|
||||
you were running on a native Linux machine. If you are going to use the
|
||||
Extensible SDK container, see the ":doc:`../sdk-manual/sdk-extensible`" Chapter in the Yocto
|
||||
Project Application Development and the Extensible Software Development
|
||||
Kit (eSDK) manual. If you are going to use the Toaster container, see
|
||||
the ":doc:`../toaster-manual/toaster-manual-setup-and-use`"
|
||||
section in the Toaster User Manual.
|
||||
|
||||
Locating Yocto Project Source Files
|
||||
===================================
|
||||
|
||||
This section shows you how to locate, fetch and configure the source
|
||||
files you'll need to work with the Yocto Project.
|
||||
|
||||
.. note::
|
||||
|
||||
- For concepts and introductory information about Git as it is used
|
||||
in the Yocto Project, see the ":ref:`overview-manual/overview-manual-development-environment:git`"
|
||||
section in the Yocto Project Overview and Concepts Manual.
|
||||
|
||||
- For concepts on Yocto Project source repositories, see the
|
||||
":ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`"
|
||||
section in the Yocto Project Overview and Concepts Manual."
|
||||
|
||||
Accessing Source Repositories
|
||||
-----------------------------
|
||||
|
||||
Working from a copy of the upstream :ref:`dev-manual/dev-manual-start:accessing source repositories` is the
|
||||
preferred method for obtaining and using a Yocto Project release. You
|
||||
can view the Yocto Project Source Repositories at
|
||||
:yocto_git:`/`. In particular, you can find the ``poky``
|
||||
repository at :yocto_git:`/cgit.cgi/poky`.
|
||||
|
||||
Use the following procedure to locate the latest upstream copy of the
|
||||
``poky`` Git repository:
|
||||
|
||||
1. *Access Repositories:* Open a browser and go to
|
||||
:yocto_git:`/` to access the GUI-based interface into the
|
||||
Yocto Project source repositories.
|
||||
|
||||
2. *Select the Repository:* Click on the repository in which you are
|
||||
interested (e.g. ``poky``).
|
||||
|
||||
3. *Find the URL Used to Clone the Repository:* At the bottom of the
|
||||
page, note the URL used to clone that repository
|
||||
(e.g. :yocto_git:`/cgit.cgi/poky`).
|
||||
|
||||
.. note::
|
||||
|
||||
For information on cloning a repository, see the "
|
||||
Cloning the
|
||||
poky
|
||||
Repository
|
||||
" section.
|
||||
|
||||
Accessing Index of Releases
|
||||
---------------------------
|
||||
|
||||
Yocto Project maintains an Index of Releases area that contains related
|
||||
files that contribute to the Yocto Project. Rather than Git
|
||||
repositories, these files are tarballs that represent snapshots in time
|
||||
of a given component.
|
||||
|
||||
.. note::
|
||||
|
||||
The recommended method for accessing Yocto Project components is to
|
||||
use Git to clone the upstream repository and work from within that
|
||||
locally cloned repository. The procedure in this section exists
|
||||
should you desire a tarball snapshot of any given component.
|
||||
|
||||
Follow these steps to locate and download a particular tarball:
|
||||
|
||||
1. *Access the Index of Releases:* Open a browser and go to
|
||||
:yocto_dl:`Index of Releases </releases>`. The
|
||||
list represents released components (e.g. ``bitbake``, ``sato``, and
|
||||
so on).
|
||||
|
||||
.. note::
|
||||
|
||||
The
|
||||
yocto
|
||||
directory contains the full array of released Poky tarballs. The
|
||||
poky
|
||||
directory in the Index of Releases was historically used for very
|
||||
early releases and exists now only for retroactive completeness.
|
||||
|
||||
2. *Select a Component:* Click on any released component in which you
|
||||
are interested (e.g. ``yocto``).
|
||||
|
||||
3. *Find the Tarball:* Drill down to find the associated tarball. For
|
||||
example, click on ``yocto-&DISTRO;`` to view files associated with the
|
||||
Yocto Project &DISTRO; release (e.g.
|
||||
``&YOCTO_POKY;.tar.bz2``, which is the
|
||||
released Poky tarball).
|
||||
|
||||
4. *Download the Tarball:* Click the tarball to download and save a
|
||||
snapshot of the given component.
|
||||
|
||||
Using the Downloads Page
|
||||
------------------------
|
||||
|
||||
The :yocto_home:`Yocto Project Website <>` uses a "DOWNLOADS" page
|
||||
from which you can locate and download tarballs of any Yocto Project
|
||||
release. Rather than Git repositories, these files represent snapshot
|
||||
tarballs similar to the tarballs located in the Index of Releases
|
||||
described in the "`Accessing Index of
|
||||
Releases <#accessing-index-of-releases>`__" section.
|
||||
|
||||
.. note::
|
||||
|
||||
The recommended method for accessing Yocto Project components is to
|
||||
use Git to clone a repository and work from within that local
|
||||
repository. The procedure in this section exists should you desire a
|
||||
tarball snapshot of any given component.
|
||||
|
||||
1. *Go to the Yocto Project Website:* Open The
|
||||
:yocto_home:`Yocto Project Website <>` in your browser.
|
||||
|
||||
2. *Get to the Downloads Area:* Select the "DOWNLOADS" item from the
|
||||
pull-down "SOFTWARE" tab menu near the top of the page.
|
||||
|
||||
3. *Select a Yocto Project Release:* Use the menu next to "RELEASE" to
|
||||
display and choose a recent or past supported Yocto Project release
|
||||
(e.g. &DISTRO_NAME_NO_CAP;, &DISTRO_NAME_NO_CAP_MINUS_ONE;, and so forth).
|
||||
|
||||
.. note::
|
||||
|
||||
For a "map" of Yocto Project releases to version numbers, see the
|
||||
Releases
|
||||
wiki page.
|
||||
|
||||
You can use the "RELEASE ARCHIVE" link to reveal a menu of all Yocto
|
||||
Project releases.
|
||||
|
||||
4. *Download Tools or Board Support Packages (BSPs):* From the
|
||||
"DOWNLOADS" page, you can download tools or BSPs as well. Just scroll
|
||||
down the page and look for what you need.
|
||||
|
||||
Accessing Nightly Builds
|
||||
------------------------
|
||||
|
||||
Yocto Project maintains an area for nightly builds that contains tarball
|
||||
releases at https://autobuilder.yocto.io//pub/nightly/. These builds include Yocto
|
||||
Project releases ("poky"), toolchains, and builds for supported
|
||||
machines.
|
||||
|
||||
Should you ever want to access a nightly build of a particular Yocto
|
||||
Project component, use the following procedure:
|
||||
|
||||
1. *Locate the Index of Nightly Builds:* Open a browser and go to
|
||||
https://autobuilder.yocto.io//pub/nightly/ to access the Nightly Builds.
|
||||
|
||||
2. *Select a Date:* Click on the date in which you are interested. If
|
||||
you want the latest builds, use "CURRENT".
|
||||
|
||||
3. *Select a Build:* Choose the area in which you are interested. For
|
||||
example, if you are looking for the most recent toolchains, select
|
||||
the "toolchain" link.
|
||||
|
||||
4. *Find the Tarball:* Drill down to find the associated tarball.
|
||||
|
||||
5. *Download the Tarball:* Click the tarball to download and save a
|
||||
snapshot of the given component.
|
||||
|
||||
Cloning and Checking Out Branches
|
||||
=================================
|
||||
|
||||
To use the Yocto Project for development, you need a release locally
|
||||
installed on your development system. This locally installed set of
|
||||
files is referred to as the :term:`Source Directory`
|
||||
in the Yocto Project documentation.
|
||||
|
||||
The preferred method of creating your Source Directory is by using
|
||||
:ref:`overview-manual/overview-manual-development-environment:git` to clone a local copy of the upstream
|
||||
``poky`` repository. Working from a cloned copy of the upstream
|
||||
repository allows you to contribute back into the Yocto Project or to
|
||||
simply work with the latest software on a development branch. Because
|
||||
Git maintains and creates an upstream repository with a complete history
|
||||
of changes and you are working with a local clone of that repository,
|
||||
you have access to all the Yocto Project development branches and tag
|
||||
names used in the upstream repository.
|
||||
|
||||
Cloning the ``poky`` Repository
|
||||
-------------------------------
|
||||
|
||||
Follow these steps to create a local version of the upstream
|
||||
:term:`Poky` Git repository.
|
||||
|
||||
1. *Set Your Directory:* Change your working directory to where you want
|
||||
to create your local copy of ``poky``.
|
||||
|
||||
2. *Clone the Repository:* The following example command clones the
|
||||
``poky`` repository and uses the default name "poky" for your local
|
||||
repository:
|
||||
::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
Cloning into 'poky'...
|
||||
remote: Counting objects: 432160, done.
|
||||
remote: Compressing objects: 100% (102056/102056), done.
|
||||
remote: Total 432160 (delta 323116), reused 432037 (delta 323000)
|
||||
Receiving objects: 100% (432160/432160), 153.81 MiB | 8.54 MiB/s, done.
|
||||
Resolving deltas: 100% (323116/323116), done.
|
||||
Checking connectivity... done.
|
||||
|
||||
Unless you
|
||||
specify a specific development branch or tag name, Git clones the
|
||||
"master" branch, which results in a snapshot of the latest
|
||||
development changes for "master". For information on how to check out
|
||||
a specific development branch or on how to check out a local branch
|
||||
based on a tag name, see the "`Checking Out By Branch in
|
||||
Poky <#checking-out-by-branch-in-poky>`__" and `Checking Out By Tag
|
||||
in Poky <#checkout-out-by-tag-in-poky>`__" sections, respectively.
|
||||
|
||||
Once the local repository is created, you can change to that
|
||||
directory and check its status. Here, the single "master" branch
|
||||
exists on your system and by default, it is checked out:
|
||||
::
|
||||
|
||||
$ cd ~/poky
|
||||
$ git status
|
||||
On branch master
|
||||
Your branch is up-to-date with 'origin/master'.
|
||||
nothing to commit, working directory clean
|
||||
$ git branch
|
||||
* master
|
||||
|
||||
Your local repository of poky is identical to the
|
||||
upstream poky repository at the time from which it was cloned. As you
|
||||
work with the local branch, you can periodically use the
|
||||
``git pull --rebase`` command to be sure you are up-to-date
|
||||
with the upstream branch.
|
||||
|
||||
Checking Out by Branch in Poky
|
||||
------------------------------
|
||||
|
||||
When you clone the upstream poky repository, you have access to all its
|
||||
development branches. Each development branch in a repository is unique
|
||||
as it forks off the "master" branch. To see and use the files of a
|
||||
particular development branch locally, you need to know the branch name
|
||||
and then specifically check out that development branch.
|
||||
|
||||
.. note::
|
||||
|
||||
Checking out an active development branch by branch name gives you a
|
||||
snapshot of that particular branch at the time you check it out.
|
||||
Further development on top of the branch that occurs after check it
|
||||
out can occur.
|
||||
|
||||
1. *Switch to the Poky Directory:* If you have a local poky Git
|
||||
repository, switch to that directory. If you do not have the local
|
||||
copy of poky, see the "`Cloning the ``poky``
|
||||
Repository <#cloning-the-poky-repository>`__" section.
|
||||
|
||||
2. *Determine Existing Branch Names:*
|
||||
::
|
||||
|
||||
$ git branch -a
|
||||
* master
|
||||
remotes/origin/1.1_M1
|
||||
remotes/origin/1.1_M2
|
||||
remotes/origin/1.1_M3
|
||||
remotes/origin/1.1_M4
|
||||
remotes/origin/1.2_M1
|
||||
remotes/origin/1.2_M2
|
||||
remotes/origin/1.2_M3
|
||||
. . .
|
||||
remotes/origin/thud
|
||||
remotes/origin/thud-next
|
||||
remotes/origin/warrior
|
||||
remotes/origin/warrior-next
|
||||
remotes/origin/zeus
|
||||
remotes/origin/zeus-next
|
||||
... and so on ...
|
||||
|
||||
3. *Check out the Branch:* Check out the development branch in which you
|
||||
want to work. For example, to access the files for the Yocto Project
|
||||
&DISTRO; Release (&DISTRO_NAME;), use the following command:
|
||||
::
|
||||
|
||||
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
|
||||
Branch &DISTRO_NAME; set up to track remote branch &DISTRO_NAME; from origin.
|
||||
Switched to a new branch '&DISTRO_NAME;'
|
||||
|
||||
The previous command checks out the "&DISTRO_NAME;" development
|
||||
branch and reports that the branch is tracking the upstream
|
||||
"origin/&DISTRO_NAME;" branch.
|
||||
|
||||
The following command displays the branches that are now part of your
|
||||
local poky repository. The asterisk character indicates the branch
|
||||
that is currently checked out for work:
|
||||
::
|
||||
|
||||
$ git branch
|
||||
master *
|
||||
&DISTRO_NAME;
|
||||
|
||||
.. _checkout-out-by-tag-in-poky:
|
||||
|
||||
Checking Out by Tag in Poky
|
||||
---------------------------
|
||||
|
||||
Similar to branches, the upstream repository uses tags to mark specific
|
||||
commits associated with significant points in a development branch (i.e.
|
||||
a release point or stage of a release). You might want to set up a local
|
||||
branch based on one of those points in the repository. The process is
|
||||
similar to checking out by branch name except you use tag names.
|
||||
|
||||
.. note::
|
||||
|
||||
Checking out a branch based on a tag gives you a stable set of files
|
||||
not affected by development on the branch above the tag.
|
||||
|
||||
1. *Switch to the Poky Directory:* If you have a local poky Git
|
||||
repository, switch to that directory. If you do not have the local
|
||||
copy of poky, see the "`Cloning the ``poky``
|
||||
Repository <#cloning-the-poky-repository>`__" section.
|
||||
|
||||
2. *Fetch the Tag Names:* To checkout the branch based on a tag name,
|
||||
you need to fetch the upstream tags into your local repository:
|
||||
::
|
||||
|
||||
$ git fetch --tags
|
||||
$
|
||||
|
||||
3. *List the Tag Names:* You can list the tag names now:
|
||||
::
|
||||
|
||||
$ git tag
|
||||
1.1_M1.final
|
||||
1.1_M1.rc1
|
||||
1.1_M1.rc2
|
||||
1.1_M2.final
|
||||
1.1_M2.rc1
|
||||
.
|
||||
.
|
||||
.
|
||||
yocto-2.5
|
||||
yocto-2.5.1
|
||||
yocto-2.5.2
|
||||
yocto-2.5.3
|
||||
yocto-2.6
|
||||
yocto-2.6.1
|
||||
yocto-2.6.2
|
||||
yocto-2.7
|
||||
yocto_1.5_M5.rc8
|
||||
|
||||
|
||||
4. *Check out the Branch:*
|
||||
::
|
||||
|
||||
$ git checkout tags/yocto-&DISTRO; -b my_yocto_&DISTRO;
|
||||
Switched to a new branch 'my_yocto_&DISTRO;'
|
||||
$ git branch
|
||||
master
|
||||
* my_yocto_&DISTRO;
|
||||
|
||||
The previous command creates and
|
||||
checks out a local branch named "my_yocto_&DISTRO;", which is based on
|
||||
the commit in the upstream poky repository that has the same tag. In
|
||||
this example, the files you have available locally as a result of the
|
||||
``checkout`` command are a snapshot of the "&DISTRO_NAME_NO_CAP;"
|
||||
development branch at the point where Yocto Project &DISTRO; was
|
||||
released.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='dev-manual-start'>
|
||||
|
||||
|
||||
19
documentation/dev-manual/dev-manual.rst
Normal file
19
documentation/dev-manual/dev-manual.rst
Normal file
@@ -0,0 +1,19 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
======================================
|
||||
Yocto Project Development Tasks Manual
|
||||
======================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
dev-manual-intro
|
||||
dev-manual-start
|
||||
dev-manual-common-tasks
|
||||
dev-manual-qemu
|
||||
history
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='dev-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -117,28 +118,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
67
documentation/dev-manual/history.rst
Normal file
67
documentation/dev-manual/history.rst
Normal file
@@ -0,0 +1,67 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************
|
||||
Manual Revision History
|
||||
***********************
|
||||
|
||||
.. list-table::
|
||||
:widths: 10 15 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Revision
|
||||
- Date
|
||||
- Note
|
||||
* - 1.1
|
||||
- October 2011
|
||||
- The initial document released with the Yocto Project 1.1 Release
|
||||
* - 1.2
|
||||
- April 2012
|
||||
- Released with the Yocto Project 1.2 Release.
|
||||
* - 1.3
|
||||
- October 2012
|
||||
- Released with the Yocto Project 1.3 Release.
|
||||
* - 1.4
|
||||
- April 2013
|
||||
- Released with the Yocto Project 1.4 Release.
|
||||
* - 1.5
|
||||
- October 2013
|
||||
- Released with the Yocto Project 1.5 Release.
|
||||
* - 1.6
|
||||
- April 2014
|
||||
- Released with the Yocto Project 1.6 Release.
|
||||
* - 1.7
|
||||
- October 2014
|
||||
- Released with the Yocto Project 1.7 Release.
|
||||
* - 1.8
|
||||
- April 2015
|
||||
- Released with the Yocto Project 1.8 Release.
|
||||
* - 2.0
|
||||
- October 2015
|
||||
- Released with the Yocto Project 2.0 Release.
|
||||
* - 2.1
|
||||
- April 2016
|
||||
- Released with the Yocto Project 2.1 Release.
|
||||
* - 2.2
|
||||
- October 2016
|
||||
- Released with the Yocto Project 2.2 Release.
|
||||
* - 2.3
|
||||
- May 2017
|
||||
- Released with the Yocto Project 2.3 Release.
|
||||
* - 2.4
|
||||
- October 2017
|
||||
- Released with the Yocto Project 2.4 Release.
|
||||
* - 2.5
|
||||
- May 2018
|
||||
- Released with the Yocto Project 2.5 Release.
|
||||
* - 2.6
|
||||
- November 2018
|
||||
- Released with the Yocto Project 2.6 Release.
|
||||
* - 2.7
|
||||
- May 2019
|
||||
- Released with the Yocto Project 2.7 Release.
|
||||
* - 3.0
|
||||
- October 2019
|
||||
- Released with the Yocto Project 3.0 Release.
|
||||
* - 3.1
|
||||
- April 2020
|
||||
- Released with the Yocto Project 3.1 Release.
|
||||
BIN
documentation/figures/yp-how-it-works-new-diagram.png
Normal file
BIN
documentation/figures/yp-how-it-works-new-diagram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 244 KiB |
3
documentation/genindex.rst
Normal file
3
documentation/genindex.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
=====
|
||||
Index
|
||||
=====
|
||||
53
documentation/index.rst
Normal file
53
documentation/index.rst
Normal file
@@ -0,0 +1,53 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
.. The Yocto Project documentation master file, created by
|
||||
sphinx-quickstart on Mon Apr 13 09:38:33 2020.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to The Yocto Project's documentation!
|
||||
=============================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Introduction and Overview
|
||||
|
||||
Quick Build <brief-yoctoprojectqs/brief-yoctoprojectqs>
|
||||
what-i-wish-id-known
|
||||
transitioning-to-a-custom-environment
|
||||
Yocto Project Software Overview <https://www.yoctoproject.org/software-overview/>
|
||||
Tips and Tricks Wiki <https://wiki.yoctoproject.org/wiki/TipsAndTricks>
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Manuals
|
||||
|
||||
Overview and Concepts Manual <overview-manual/overview-manual>
|
||||
Reference Manual <ref-manual/ref-manual>
|
||||
Board Support Package (BSP) Developer's guide <bsp-guide/bsp-guide>
|
||||
Development Tasks Manual <dev-manual/dev-manual>
|
||||
Linux Kernel Development Manual <kernel-dev/kernel-dev>
|
||||
Profile and Tracing Manual <profile-manual/profile-manual>
|
||||
Application Development and the Extensible SDK (eSDK) <sdk-manual/sdk-manual>
|
||||
Toaster Manual <toaster-manual/toaster-manual>
|
||||
Test Environment Manual <test-manual/test-manual>
|
||||
Bitbake User Manual <https://docs.yoctoproject.org/bitbake>
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: 'Mega' Manual
|
||||
|
||||
All-in-one 'Mega' Manual <https://docs.yoctoproject.org/singleindex.html>
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Manuals/Variable Index
|
||||
|
||||
genindex
|
||||
Current/Previous Version Specific Manuals <releases>
|
||||
|
||||
|
||||
|
||||
58
documentation/kernel-dev/history.rst
Normal file
58
documentation/kernel-dev/history.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************
|
||||
Manual Revision History
|
||||
***********************
|
||||
|
||||
.. list-table::
|
||||
:widths: 10 15 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Revision
|
||||
- Date
|
||||
- Note
|
||||
* - 1.4
|
||||
- April 2013
|
||||
- The initial document released with the Yocto Project 1.4 Release
|
||||
* - 1.5
|
||||
- October 2013
|
||||
- Released with the Yocto Project 1.5 Release.
|
||||
* - 1.6
|
||||
- April 2014
|
||||
- Released with the Yocto Project 1.6 Release.
|
||||
* - 1.7
|
||||
- October 2014
|
||||
- Released with the Yocto Project 1.7 Release.
|
||||
* - 1.8
|
||||
- April 2015
|
||||
- Released with the Yocto Project 1.8 Release.
|
||||
* - 2.0
|
||||
- October 2015
|
||||
- Released with the Yocto Project 2.0 Release.
|
||||
* - 2.1
|
||||
- April 2016
|
||||
- Released with the Yocto Project 2.1 Release.
|
||||
* - 2.2
|
||||
- October 2016
|
||||
- Released with the Yocto Project 2.2 Release.
|
||||
* - 2.3
|
||||
- May 2017
|
||||
- Released with the Yocto Project 2.3 Release.
|
||||
* - 2.4
|
||||
- October 2017
|
||||
- Released with the Yocto Project 2.4 Release.
|
||||
* - 2.5
|
||||
- May 2018
|
||||
- Released with the Yocto Project 2.5 Release.
|
||||
* - 2.6
|
||||
- November 2018
|
||||
- Released with the Yocto Project 2.6 Release.
|
||||
* - 2.7
|
||||
- May 2019
|
||||
- Released with the Yocto Project 2.7 Release.
|
||||
* - 3.0
|
||||
- October 2019
|
||||
- Released with the Yocto Project 3.0 Release.
|
||||
* - 3.1
|
||||
- April 2020
|
||||
- Released with the Yocto Project 3.1 Release.
|
||||
983
documentation/kernel-dev/kernel-dev-advanced.rst
Normal file
983
documentation/kernel-dev/kernel-dev-advanced.rst
Normal file
@@ -0,0 +1,983 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*******************************************************
|
||||
Working with Advanced Metadata (``yocto-kernel-cache``)
|
||||
*******************************************************
|
||||
|
||||
.. _kernel-dev-advanced-overview:
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
In addition to supporting configuration fragments and patches, the Yocto
|
||||
Project kernel tools also support rich
|
||||
:term:`Metadata` that you can use to define
|
||||
complex policies and Board Support Package (BSP) support. The purpose of
|
||||
the Metadata and the tools that manage it is to help you manage the
|
||||
complexity of the configuration and sources used to support multiple
|
||||
BSPs and Linux kernel types.
|
||||
|
||||
Kernel Metadata exists in many places. One area in the
|
||||
:ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
|
||||
is the ``yocto-kernel-cache`` Git repository. You can find this repository
|
||||
grouped under the "Yocto Linux Kernel" heading in the
|
||||
:yocto_git:`Yocto Project Source Repositories <>`.
|
||||
|
||||
Kernel development tools ("kern-tools") exist also in the Yocto Project
|
||||
Source Repositories under the "Yocto Linux Kernel" heading in the
|
||||
``yocto-kernel-tools`` Git repository. The recipe that builds these
|
||||
tools is ``meta/recipes-kernel/kern-tools/kern-tools-native_git.bb`` in
|
||||
the :term:`Source Directory` (e.g.
|
||||
``poky``).
|
||||
|
||||
Using Kernel Metadata in a Recipe
|
||||
=================================
|
||||
|
||||
As mentioned in the introduction, the Yocto Project contains kernel
|
||||
Metadata, which is located in the ``yocto-kernel-cache`` Git repository.
|
||||
This Metadata defines Board Support Packages (BSPs) that correspond to
|
||||
definitions in linux-yocto recipes for corresponding BSPs. A BSP
|
||||
consists of an aggregation of kernel policy and enabled
|
||||
hardware-specific features. The BSP can be influenced from within the
|
||||
linux-yocto recipe.
|
||||
|
||||
.. note::
|
||||
|
||||
A Linux kernel recipe that contains kernel Metadata (e.g. inherits
|
||||
from the
|
||||
linux-yocto.inc
|
||||
file) is said to be a "linux-yocto style" recipe.
|
||||
|
||||
Every linux-yocto style recipe must define the
|
||||
:term:`KMACHINE` variable. This
|
||||
variable is typically set to the same value as the ``MACHINE`` variable,
|
||||
which is used by :term:`BitBake`.
|
||||
However, in some cases, the variable might instead refer to the
|
||||
underlying platform of the ``MACHINE``.
|
||||
|
||||
Multiple BSPs can reuse the same ``KMACHINE`` name if they are built
|
||||
using the same BSP description. Multiple Corei7-based BSPs could share
|
||||
the same "intel-corei7-64" value for ``KMACHINE``. It is important to
|
||||
realize that ``KMACHINE`` is just for kernel mapping, while ``MACHINE``
|
||||
is the machine type within a BSP Layer. Even with this distinction,
|
||||
however, these two variables can hold the same value. See the `BSP
|
||||
Descriptions <#bsp-descriptions>`__ section for more information.
|
||||
|
||||
Every linux-yocto style recipe must also indicate the Linux kernel
|
||||
source repository branch used to build the Linux kernel. The
|
||||
:term:`KBRANCH` variable must be set
|
||||
to indicate the branch.
|
||||
|
||||
.. note::
|
||||
|
||||
You can use the
|
||||
KBRANCH
|
||||
value to define an alternate branch typically with a machine override
|
||||
as shown here from the
|
||||
meta-yocto-bsp
|
||||
layer:
|
||||
::
|
||||
|
||||
KBRANCH_edgerouter = "standard/edgerouter"
|
||||
|
||||
|
||||
The linux-yocto style recipes can optionally define the following
|
||||
variables:
|
||||
|
||||
- :term:`KERNEL_FEATURES`
|
||||
|
||||
- :term:`LINUX_KERNEL_TYPE`
|
||||
|
||||
:term:`LINUX_KERNEL_TYPE`
|
||||
defines the kernel type to be used in assembling the configuration. If
|
||||
you do not specify a ``LINUX_KERNEL_TYPE``, it defaults to "standard".
|
||||
Together with ``KMACHINE``, ``LINUX_KERNEL_TYPE`` defines the search
|
||||
arguments used by the kernel tools to find the appropriate description
|
||||
within the kernel Metadata with which to build out the sources and
|
||||
configuration. The linux-yocto recipes define "standard", "tiny", and
|
||||
"preempt-rt" kernel types. See the "`Kernel Types <#kernel-types>`__"
|
||||
section for more information on kernel types.
|
||||
|
||||
During the build, the kern-tools search for the BSP description file
|
||||
that most closely matches the ``KMACHINE`` and ``LINUX_KERNEL_TYPE``
|
||||
variables passed in from the recipe. The tools use the first BSP
|
||||
description it finds that match both variables. If the tools cannot find
|
||||
a match, they issue a warning.
|
||||
|
||||
The tools first search for the ``KMACHINE`` and then for the
|
||||
``LINUX_KERNEL_TYPE``. If the tools cannot find a partial match, they
|
||||
will use the sources from the ``KBRANCH`` and any configuration
|
||||
specified in the :term:`SRC_URI`.
|
||||
|
||||
You can use the
|
||||
:term:`KERNEL_FEATURES`
|
||||
variable to include features (configuration fragments, patches, or both)
|
||||
that are not already included by the ``KMACHINE`` and
|
||||
``LINUX_KERNEL_TYPE`` variable combination. For example, to include a
|
||||
feature specified as "features/netfilter/netfilter.scc", specify:
|
||||
::
|
||||
|
||||
KERNEL_FEATURES += "features/netfilter/netfilter.scc"
|
||||
|
||||
To include a
|
||||
feature called "cfg/sound.scc" just for the ``qemux86`` machine,
|
||||
specify:
|
||||
::
|
||||
|
||||
KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc"
|
||||
|
||||
The value of
|
||||
the entries in ``KERNEL_FEATURES`` are dependent on their location
|
||||
within the kernel Metadata itself. The examples here are taken from the
|
||||
``yocto-kernel-cache`` repository. Each branch of this repository
|
||||
contains "features" and "cfg" subdirectories at the top-level. For more
|
||||
information, see the "`Kernel Metadata
|
||||
Syntax <#kernel-metadata-syntax>`__" section.
|
||||
|
||||
Kernel Metadata Syntax
|
||||
======================
|
||||
|
||||
The kernel Metadata consists of three primary types of files: ``scc``
|
||||
[1]_ description files, configuration fragments, and patches. The
|
||||
``scc`` files define variables and include or otherwise reference any of
|
||||
the three file types. The description files are used to aggregate all
|
||||
types of kernel Metadata into what ultimately describes the sources and
|
||||
the configuration required to build a Linux kernel tailored to a
|
||||
specific machine.
|
||||
|
||||
The ``scc`` description files are used to define two fundamental types
|
||||
of kernel Metadata:
|
||||
|
||||
- Features
|
||||
|
||||
- Board Support Packages (BSPs)
|
||||
|
||||
Features aggregate sources in the form of patches and configuration
|
||||
fragments into a modular reusable unit. You can use features to
|
||||
implement conceptually separate kernel Metadata descriptions such as
|
||||
pure configuration fragments, simple patches, complex features, and
|
||||
kernel types. `Kernel types <#kernel-types>`__ define general kernel
|
||||
features and policy to be reused in the BSPs.
|
||||
|
||||
BSPs define hardware-specific features and aggregate them with kernel
|
||||
types to form the final description of what will be assembled and built.
|
||||
|
||||
While the kernel Metadata syntax does not enforce any logical separation
|
||||
of configuration fragments, patches, features or kernel types, best
|
||||
practices dictate a logical separation of these types of Metadata. The
|
||||
following Metadata file hierarchy is recommended:
|
||||
::
|
||||
|
||||
base/
|
||||
bsp/
|
||||
cfg/
|
||||
features/
|
||||
ktypes/
|
||||
patches/
|
||||
|
||||
The ``bsp`` directory contains the `BSP
|
||||
descriptions <#bsp-descriptions>`__. The remaining directories all
|
||||
contain "features". Separating ``bsp`` from the rest of the structure
|
||||
aids conceptualizing intended usage.
|
||||
|
||||
Use these guidelines to help place your ``scc`` description files within
|
||||
the structure:
|
||||
|
||||
- If your file contains only configuration fragments, place the file in
|
||||
the ``cfg`` directory.
|
||||
|
||||
- If your file contains only source-code fixes, place the file in the
|
||||
``patches`` directory.
|
||||
|
||||
- If your file encapsulates a major feature, often combining sources
|
||||
and configurations, place the file in ``features`` directory.
|
||||
|
||||
- If your file aggregates non-hardware configuration and patches in
|
||||
order to define a base kernel policy or major kernel type to be
|
||||
reused across multiple BSPs, place the file in ``ktypes`` directory.
|
||||
|
||||
These distinctions can easily become blurred - especially as out-of-tree
|
||||
features slowly merge upstream over time. Also, remember that how the
|
||||
description files are placed is a purely logical organization and has no
|
||||
impact on the functionality of the kernel Metadata. There is no impact
|
||||
because all of ``cfg``, ``features``, ``patches``, and ``ktypes``,
|
||||
contain "features" as far as the kernel tools are concerned.
|
||||
|
||||
Paths used in kernel Metadata files are relative to base, which is
|
||||
either
|
||||
:term:`FILESEXTRAPATHS` if
|
||||
you are creating Metadata in `recipe-space <#recipe-space-metadata>`__,
|
||||
or the top level of
|
||||
:yocto_git:`yocto-kernel-cache </cgit/cgit.cgi/yocto-kernel-cache/tree/>`
|
||||
if you are creating `Metadata outside of the
|
||||
recipe-space <#metadata-outside-the-recipe-space>`__.
|
||||
|
||||
.. [1]
|
||||
``scc`` stands for Series Configuration Control, but the naming has
|
||||
less significance in the current implementation of the tooling than
|
||||
it had in the past. Consider ``scc`` files to be description files.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
The simplest unit of kernel Metadata is the configuration-only feature.
|
||||
This feature consists of one or more Linux kernel configuration
|
||||
parameters in a configuration fragment file (``.cfg``) and a ``.scc``
|
||||
file that describes the fragment.
|
||||
|
||||
As an example, consider the Symmetric Multi-Processing (SMP) fragment
|
||||
used with the ``linux-yocto-4.12`` kernel as defined outside of the
|
||||
recipe space (i.e. ``yocto-kernel-cache``). This Metadata consists of
|
||||
two files: ``smp.scc`` and ``smp.cfg``. You can find these files in the
|
||||
``cfg`` directory of the ``yocto-4.12`` branch in the
|
||||
``yocto-kernel-cache`` Git repository:
|
||||
::
|
||||
|
||||
cfg/smp.scc:
|
||||
define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds"
|
||||
define KFEATURE_COMPATIBILITY all
|
||||
|
||||
kconf hardware smp.cfg
|
||||
|
||||
cfg/smp.cfg:
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SCHED_SMT=y
|
||||
# Increase default NR_CPUS from 8 to 64 so that platform with
|
||||
# more than 8 processors can be all activated at boot time
|
||||
CONFIG_NR_CPUS=64
|
||||
# The following is needed when setting NR_CPUS to something
|
||||
# greater than 8 on x86 architectures, it should be automatically
|
||||
# disregarded by Kconfig when using a different arch
|
||||
CONFIG_X86_BIGSMP=y
|
||||
|
||||
You can find general information on configuration
|
||||
fragment files in the "`Creating Configuration
|
||||
Fragments <#creating-config-fragments>`__" section.
|
||||
|
||||
Within the ``smp.scc`` file, the
|
||||
:term:`KFEATURE_DESCRIPTION`
|
||||
statement provides a short description of the fragment. Higher level
|
||||
kernel tools use this description.
|
||||
|
||||
Also within the ``smp.scc`` file, the ``kconf`` command includes the
|
||||
actual configuration fragment in an ``.scc`` file, and the "hardware"
|
||||
keyword identifies the fragment as being hardware enabling, as opposed
|
||||
to general policy, which would use the "non-hardware" keyword. The
|
||||
distinction is made for the benefit of the configuration validation
|
||||
tools, which warn you if a hardware fragment overrides a policy set by a
|
||||
non-hardware fragment.
|
||||
|
||||
.. note::
|
||||
|
||||
The description file can include multiple
|
||||
kconf
|
||||
statements, one per fragment.
|
||||
|
||||
As described in the "`Validating
|
||||
Configuration <#validating-configuration>`__" section, you can use the
|
||||
following BitBake command to audit your configuration:
|
||||
::
|
||||
|
||||
$ bitbake linux-yocto -c kernel_configcheck -f
|
||||
|
||||
Patches
|
||||
-------
|
||||
|
||||
Patch descriptions are very similar to configuration fragment
|
||||
descriptions, which are described in the previous section. However,
|
||||
instead of a ``.cfg`` file, these descriptions work with source patches
|
||||
(i.e. ``.patch`` files).
|
||||
|
||||
A typical patch includes a description file and the patch itself. As an
|
||||
example, consider the build patches used with the ``linux-yocto-4.12``
|
||||
kernel as defined outside of the recipe space (i.e.
|
||||
``yocto-kernel-cache``). This Metadata consists of several files:
|
||||
``build.scc`` and a set of ``*.patch`` files. You can find these files
|
||||
in the ``patches/build`` directory of the ``yocto-4.12`` branch in the
|
||||
``yocto-kernel-cache`` Git repository.
|
||||
|
||||
The following listings show the ``build.scc`` file and part of the
|
||||
``modpost-mask-trivial-warnings.patch`` file:
|
||||
::
|
||||
|
||||
patches/build/build.scc:
|
||||
patch arm-serialize-build-targets.patch
|
||||
patch powerpc-serialize-image-targets.patch
|
||||
patch kbuild-exclude-meta-directory-from-distclean-processi.patch
|
||||
|
||||
# applied by kgit
|
||||
# patch kbuild-add-meta-files-to-the-ignore-li.patch
|
||||
|
||||
patch modpost-mask-trivial-warnings.patch
|
||||
patch menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch
|
||||
|
||||
patches/build/modpost-mask-trivial-warnings.patch:
|
||||
From bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gortmaker <paul.gortmaker@windriver.com>
|
||||
Date: Sun, 25 Jan 2009 17:58:09 -0500
|
||||
Subject: [PATCH] modpost: mask trivial warnings
|
||||
|
||||
Newer HOSTCC will complain about various stdio fcns because
|
||||
.
|
||||
.
|
||||
.
|
||||
char *dump_write = NULL, *files_source = NULL;
|
||||
int opt;
|
||||
--
|
||||
2.10.1
|
||||
|
||||
generated by cgit v0.10.2 at 2017-09-28 15:23:23 (GMT)
|
||||
|
||||
The description file can
|
||||
include multiple patch statements where each statement handles a single
|
||||
patch. In the example ``build.scc`` file, five patch statements exist
|
||||
for the five patches in the directory.
|
||||
|
||||
You can create a typical ``.patch`` file using ``diff -Nurp`` or
|
||||
``git format-patch`` commands. For information on how to create patches,
|
||||
see the "`Using ``devtool`` to Patch the
|
||||
Kernel <#using-devtool-to-patch-the-kernel>`__" and "`Using Traditional
|
||||
Kernel Development to Patch the
|
||||
Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
|
||||
sections.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
Features are complex kernel Metadata types that consist of configuration
|
||||
fragments, patches, and possibly other feature description files. As an
|
||||
example, consider the following generic listing:
|
||||
::
|
||||
|
||||
features/myfeature.scc
|
||||
define KFEATURE_DESCRIPTION "Enable myfeature"
|
||||
|
||||
patch 0001-myfeature-core.patch
|
||||
patch 0002-myfeature-interface.patch
|
||||
|
||||
include cfg/myfeature_dependency.scc
|
||||
kconf non-hardware myfeature.cfg
|
||||
|
||||
This example shows how the ``patch`` and ``kconf`` commands are used as well
|
||||
as how an additional feature description file is included with the
|
||||
``include`` command.
|
||||
|
||||
Typically, features are less granular than configuration fragments and
|
||||
are more likely than configuration fragments and patches to be the types
|
||||
of things you want to specify in the ``KERNEL_FEATURES`` variable of the
|
||||
Linux kernel recipe. See the "`Using Kernel Metadata in a
|
||||
Recipe <#using-kernel-metadata-in-a-recipe>`__" section earlier in the
|
||||
manual.
|
||||
|
||||
Kernel Types
|
||||
------------
|
||||
|
||||
A kernel type defines a high-level kernel policy by aggregating
|
||||
non-hardware configuration fragments with patches you want to use when
|
||||
building a Linux kernel of a specific type (e.g. a real-time kernel).
|
||||
Syntactically, kernel types are no different than features as described
|
||||
in the "`Features <#features>`__" section. The
|
||||
:term:`LINUX_KERNEL_TYPE`
|
||||
variable in the kernel recipe selects the kernel type. For example, in
|
||||
the ``linux-yocto_4.12.bb`` kernel recipe found in
|
||||
``poky/meta/recipes-kernel/linux``, a
|
||||
:ref:`require <bitbake:require-inclusion>` directive
|
||||
includes the ``poky/meta/recipes-kernel/linux/linux-yocto.inc`` file,
|
||||
which has the following statement that defines the default kernel type:
|
||||
::
|
||||
|
||||
LINUX_KERNEL_TYPE ??= "standard"
|
||||
|
||||
Another example would be the real-time kernel (i.e.
|
||||
``linux-yocto-rt_4.12.bb``). This kernel recipe directly sets the kernel
|
||||
type as follows:
|
||||
::
|
||||
|
||||
LINUX_KERNEL_TYPE = "preempt-rt"
|
||||
|
||||
.. note::
|
||||
|
||||
You can find kernel recipes in the
|
||||
meta/recipes-kernel/linux
|
||||
directory of the
|
||||
Source Directory
|
||||
(e.g.
|
||||
poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb
|
||||
). See the "
|
||||
Using Kernel Metadata in a Recipe
|
||||
" section for more information.
|
||||
|
||||
Three kernel types ("standard", "tiny", and "preempt-rt") are supported
|
||||
for Linux Yocto kernels:
|
||||
|
||||
- "standard": Includes the generic Linux kernel policy of the Yocto
|
||||
Project linux-yocto kernel recipes. This policy includes, among other
|
||||
things, which file systems, networking options, core kernel features,
|
||||
and debugging and tracing options are supported.
|
||||
|
||||
- "preempt-rt": Applies the ``PREEMPT_RT`` patches and the
|
||||
configuration options required to build a real-time Linux kernel.
|
||||
This kernel type inherits from the "standard" kernel type.
|
||||
|
||||
- "tiny": Defines a bare minimum configuration meant to serve as a base
|
||||
for very small Linux kernels. The "tiny" kernel type is independent
|
||||
from the "standard" configuration. Although the "tiny" kernel type
|
||||
does not currently include any source changes, it might in the
|
||||
future.
|
||||
|
||||
For any given kernel type, the Metadata is defined by the ``.scc`` (e.g.
|
||||
``standard.scc``). Here is a partial listing for the ``standard.scc``
|
||||
file, which is found in the ``ktypes/standard`` directory of the
|
||||
``yocto-kernel-cache`` Git repository:
|
||||
::
|
||||
|
||||
# Include this kernel type fragment to get the standard features and
|
||||
# configuration values.
|
||||
|
||||
# Note: if only the features are desired, but not the configuration
|
||||
# then this should be included as:
|
||||
# include ktypes/standard/standard.scc nocfg
|
||||
# if no chained configuration is desired, include it as:
|
||||
# include ktypes/standard/standard.scc nocfg inherit
|
||||
|
||||
|
||||
|
||||
include ktypes/base/base.scc
|
||||
branch standard
|
||||
|
||||
kconf non-hardware standard.cfg
|
||||
|
||||
include features/kgdb/kgdb.scc
|
||||
.
|
||||
.
|
||||
.
|
||||
|
||||
include cfg/net/ip6_nf.scc
|
||||
include cfg/net/bridge.scc
|
||||
|
||||
include cfg/systemd.scc
|
||||
|
||||
include features/rfkill/rfkill.scc
|
||||
|
||||
As with any ``.scc`` file, a kernel type definition can aggregate other
|
||||
``.scc`` files with ``include`` commands. These definitions can also
|
||||
directly pull in configuration fragments and patches with the ``kconf``
|
||||
and ``patch`` commands, respectively.
|
||||
|
||||
.. note::
|
||||
|
||||
It is not strictly necessary to create a kernel type
|
||||
.scc
|
||||
file. The Board Support Package (BSP) file can implicitly define the
|
||||
kernel type using a
|
||||
define
|
||||
KTYPE
|
||||
myktype
|
||||
line. See the "
|
||||
BSP Descriptions
|
||||
" section for more information.
|
||||
|
||||
BSP Descriptions
|
||||
----------------
|
||||
|
||||
BSP descriptions (i.e. ``*.scc`` files) combine kernel types with
|
||||
hardware-specific features. The hardware-specific Metadata is typically
|
||||
defined independently in the BSP layer, and then aggregated with each
|
||||
supported kernel type.
|
||||
|
||||
.. note::
|
||||
|
||||
For BSPs supported by the Yocto Project, the BSP description files
|
||||
are located in the
|
||||
bsp
|
||||
directory of the
|
||||
yocto-kernel-cache
|
||||
repository organized under the "Yocto Linux Kernel" heading in the
|
||||
Yocto Project Source Repositories
|
||||
.
|
||||
|
||||
This section overviews the BSP description structure, the aggregation
|
||||
concepts, and presents a detailed example using a BSP supported by the
|
||||
Yocto Project (i.e. BeagleBone Board). For complete information on BSP
|
||||
layer file hierarchy, see the :doc:`../bsp-guide/bsp-guide`.
|
||||
|
||||
.. _bsp-description-file-overview:
|
||||
|
||||
Description Overview
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For simplicity, consider the following root BSP layer description files
|
||||
for the BeagleBone board. These files employ both a structure and naming
|
||||
convention for consistency. The naming convention for the file is as
|
||||
follows:
|
||||
::
|
||||
|
||||
bsp_root_name-kernel_type.scc
|
||||
|
||||
Here are some example root layer
|
||||
BSP filenames for the BeagleBone Board BSP, which is supported by the
|
||||
Yocto Project:
|
||||
::
|
||||
|
||||
beaglebone-standard.scc
|
||||
beaglebone-preempt-rt.scc
|
||||
|
||||
Each file uses the root name (i.e "beaglebone") BSP name followed by the
|
||||
kernel type.
|
||||
|
||||
Examine the ``beaglebone-standard.scc`` file:
|
||||
::
|
||||
|
||||
define KMACHINE beaglebone
|
||||
define KTYPE standard
|
||||
define KARCH arm
|
||||
|
||||
include ktypes/standard/standard.scc
|
||||
branch beaglebone
|
||||
|
||||
include beaglebone.scc
|
||||
|
||||
# default policy for standard kernels
|
||||
include features/latencytop/latencytop.scc
|
||||
include features/profiling/profiling.scc
|
||||
|
||||
Every top-level BSP description file
|
||||
should define the :term:`KMACHINE`,
|
||||
:term:`KTYPE`, and
|
||||
:term:`KARCH` variables. These
|
||||
variables allow the OpenEmbedded build system to identify the
|
||||
description as meeting the criteria set by the recipe being built. This
|
||||
example supports the "beaglebone" machine for the "standard" kernel and
|
||||
the "arm" architecture.
|
||||
|
||||
Be aware that a hard link between the ``KTYPE`` variable and a kernel
|
||||
type description file does not exist. Thus, if you do not have the
|
||||
kernel type defined in your kernel Metadata as it is here, you only need
|
||||
to ensure that the
|
||||
:term:`LINUX_KERNEL_TYPE`
|
||||
variable in the kernel recipe and the ``KTYPE`` variable in the BSP
|
||||
description file match.
|
||||
|
||||
To separate your kernel policy from your hardware configuration, you
|
||||
include a kernel type (``ktype``), such as "standard". In the previous
|
||||
example, this is done using the following:
|
||||
::
|
||||
|
||||
include ktypes/standard/standard.scc
|
||||
|
||||
This file aggregates all the configuration
|
||||
fragments, patches, and features that make up your standard kernel
|
||||
policy. See the "`Kernel Types <#kernel-types>`__" section for more
|
||||
information.
|
||||
|
||||
To aggregate common configurations and features specific to the kernel
|
||||
for mybsp, use the following:
|
||||
::
|
||||
|
||||
include mybsp.scc
|
||||
|
||||
You can see that in the BeagleBone example with the following:
|
||||
::
|
||||
|
||||
include beaglebone.scc
|
||||
|
||||
For information on how to break a complete ``.config`` file into the various
|
||||
configuration fragments, see the "`Creating Configuration
|
||||
Fragments <#creating-config-fragments>`__" section.
|
||||
|
||||
Finally, if you have any configurations specific to the hardware that
|
||||
are not in a ``*.scc`` file, you can include them as follows:
|
||||
::
|
||||
|
||||
kconf hardware mybsp-extra.cfg
|
||||
|
||||
The BeagleBone example does not include these
|
||||
types of configurations. However, the Malta 32-bit board does
|
||||
("mti-malta32"). Here is the ``mti-malta32-le-standard.scc`` file:
|
||||
::
|
||||
|
||||
define KMACHINE mti-malta32-le
|
||||
define KMACHINE qemumipsel
|
||||
define KTYPE standard
|
||||
define KARCH mips
|
||||
|
||||
include ktypes/standard/standard.scc
|
||||
branch mti-malta32
|
||||
|
||||
include mti-malta32.scc
|
||||
kconf hardware mti-malta32-le.cfg
|
||||
|
||||
.. _bsp-description-file-example-minnow:
|
||||
|
||||
Example
|
||||
~~~~~~~
|
||||
|
||||
Many real-world examples are more complex. Like any other ``.scc`` file,
|
||||
BSP descriptions can aggregate features. Consider the Minnow BSP
|
||||
definition given the ``linux-yocto-4.4`` branch of the
|
||||
``yocto-kernel-cache`` (i.e.
|
||||
``yocto-kernel-cache/bsp/minnow/minnow.scc``):
|
||||
|
||||
.. note::
|
||||
|
||||
Although the Minnow Board BSP is unused, the Metadata remains and is
|
||||
being used here just as an example.
|
||||
|
||||
::
|
||||
|
||||
include cfg/x86.scc
|
||||
include features/eg20t/eg20t.scc
|
||||
include cfg/dmaengine.scc
|
||||
include features/power/intel.scc
|
||||
include cfg/efi.scc
|
||||
include features/usb/ehci-hcd.scc
|
||||
include features/usb/ohci-hcd.scc
|
||||
include features/usb/usb-gadgets.scc
|
||||
include features/usb/touchscreen-composite.scc
|
||||
include cfg/timer/hpet.scc
|
||||
include features/leds/leds.scc
|
||||
include features/spi/spidev.scc
|
||||
include features/i2c/i2cdev.scc
|
||||
include features/mei/mei-txe.scc
|
||||
|
||||
# Earlyprintk and port debug requires 8250
|
||||
kconf hardware cfg/8250.cfg
|
||||
|
||||
kconf hardware minnow.cfg
|
||||
kconf hardware minnow-dev.cfg
|
||||
|
||||
The ``minnow.scc`` description file includes a hardware configuration
|
||||
fragment (``minnow.cfg``) specific to the Minnow BSP as well as several
|
||||
more general configuration fragments and features enabling hardware
|
||||
found on the machine. This ``minnow.scc`` description file is then
|
||||
included in each of the three "minnow" description files for the
|
||||
supported kernel types (i.e. "standard", "preempt-rt", and "tiny").
|
||||
Consider the "minnow" description for the "standard" kernel type (i.e.
|
||||
``minnow-standard.scc``:
|
||||
::
|
||||
|
||||
define KMACHINE minnow
|
||||
define KTYPE standard
|
||||
define KARCH i386
|
||||
|
||||
include ktypes/standard
|
||||
|
||||
include minnow.scc
|
||||
|
||||
# Extra minnow configs above the minimal defined in minnow.scc
|
||||
include cfg/efi-ext.scc
|
||||
include features/media/media-all.scc
|
||||
include features/sound/snd_hda_intel.scc
|
||||
|
||||
# The following should really be in standard.scc
|
||||
# USB live-image support
|
||||
include cfg/usb-mass-storage.scc
|
||||
include cfg/boot-live.scc
|
||||
|
||||
# Basic profiling
|
||||
include features/latencytop/latencytop.scc
|
||||
include features/profiling/profiling.scc
|
||||
|
||||
# Requested drivers that don't have an existing scc
|
||||
kconf hardware minnow-drivers-extra.cfg
|
||||
|
||||
The ``include`` command midway through the file includes the ``minnow.scc`` description
|
||||
that defines all enabled hardware for the BSP that is common to all
|
||||
kernel types. Using this command significantly reduces duplication.
|
||||
|
||||
Now consider the "minnow" description for the "tiny" kernel type (i.e.
|
||||
``minnow-tiny.scc``):
|
||||
::
|
||||
|
||||
define KMACHINE minnow
|
||||
define KTYPE tiny
|
||||
define KARCH i386
|
||||
|
||||
include ktypes/tiny
|
||||
|
||||
include minnow.scc
|
||||
|
||||
As you might expect,
|
||||
the "tiny" description includes quite a bit less. In fact, it includes
|
||||
only the minimal policy defined by the "tiny" kernel type and the
|
||||
hardware-specific configuration required for booting the machine along
|
||||
with the most basic functionality of the system as defined in the base
|
||||
"minnow" description file.
|
||||
|
||||
Notice again the three critical variables:
|
||||
:term:`KMACHINE`,
|
||||
:term:`KTYPE`, and
|
||||
:term:`KARCH`. Of these variables, only
|
||||
``KTYPE`` has changed to specify the "tiny" kernel type.
|
||||
|
||||
Kernel Metadata Location
|
||||
========================
|
||||
|
||||
Kernel Metadata always exists outside of the kernel tree either defined
|
||||
in a kernel recipe (recipe-space) or outside of the recipe. Where you
|
||||
choose to define the Metadata depends on what you want to do and how you
|
||||
intend to work. Regardless of where you define the kernel Metadata, the
|
||||
syntax used applies equally.
|
||||
|
||||
If you are unfamiliar with the Linux kernel and only wish to apply a
|
||||
configuration and possibly a couple of patches provided to you by
|
||||
others, the recipe-space method is recommended. This method is also a
|
||||
good approach if you are working with Linux kernel sources you do not
|
||||
control or if you just do not want to maintain a Linux kernel Git
|
||||
repository on your own. For partial information on how you can define
|
||||
kernel Metadata in the recipe-space, see the "`Modifying an Existing
|
||||
Recipe <#modifying-an-existing-recipe>`__" section.
|
||||
|
||||
Conversely, if you are actively developing a kernel and are already
|
||||
maintaining a Linux kernel Git repository of your own, you might find it
|
||||
more convenient to work with kernel Metadata kept outside the
|
||||
recipe-space. Working with Metadata in this area can make iterative
|
||||
development of the Linux kernel more efficient outside of the BitBake
|
||||
environment.
|
||||
|
||||
Recipe-Space Metadata
|
||||
---------------------
|
||||
|
||||
When stored in recipe-space, the kernel Metadata files reside in a
|
||||
directory hierarchy below
|
||||
:term:`FILESEXTRAPATHS`. For
|
||||
a linux-yocto recipe or for a Linux kernel recipe derived by copying and
|
||||
modifying
|
||||
``oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb`` to
|
||||
a recipe in your layer, ``FILESEXTRAPATHS`` is typically set to
|
||||
``${``\ :term:`THISDIR`\ ``}/${``\ :term:`PN`\ ``}``.
|
||||
See the "`Modifying an Existing
|
||||
Recipe <#modifying-an-existing-recipe>`__" section for more information.
|
||||
|
||||
Here is an example that shows a trivial tree of kernel Metadata stored
|
||||
in recipe-space within a BSP layer:
|
||||
::
|
||||
|
||||
meta-my_bsp_layer/
|
||||
`-- recipes-kernel
|
||||
`-- linux
|
||||
`-- linux-yocto
|
||||
|-- bsp-standard.scc
|
||||
|-- bsp.cfg
|
||||
`-- standard.cfg
|
||||
|
||||
When the Metadata is stored in recipe-space, you must take steps to
|
||||
ensure BitBake has the necessary information to decide what files to
|
||||
fetch and when they need to be fetched again. It is only necessary to
|
||||
specify the ``.scc`` files on the
|
||||
:term:`SRC_URI`. BitBake parses them
|
||||
and fetches any files referenced in the ``.scc`` files by the
|
||||
``include``, ``patch``, or ``kconf`` commands. Because of this, it is
|
||||
necessary to bump the recipe :term:`PR`
|
||||
value when changing the content of files not explicitly listed in the
|
||||
``SRC_URI``.
|
||||
|
||||
If the BSP description is in recipe space, you cannot simply list the
|
||||
``*.scc`` in the ``SRC_URI`` statement. You need to use the following
|
||||
form from your kernel append file:
|
||||
::
|
||||
|
||||
SRC_URI_append_myplatform = " \
|
||||
file://myplatform;type=kmeta;destsuffix=myplatform \
|
||||
"
|
||||
|
||||
Metadata Outside the Recipe-Space
|
||||
---------------------------------
|
||||
|
||||
When stored outside of the recipe-space, the kernel Metadata files
|
||||
reside in a separate repository. The OpenEmbedded build system adds the
|
||||
Metadata to the build as a "type=kmeta" repository through the
|
||||
:term:`SRC_URI` variable. As an
|
||||
example, consider the following ``SRC_URI`` statement from the
|
||||
``linux-yocto_4.12.bb`` kernel recipe:
|
||||
::
|
||||
|
||||
SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \
|
||||
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
|
||||
|
||||
|
||||
``${KMETA}``, in this context, is simply used to name the directory into
|
||||
which the Git fetcher places the Metadata. This behavior is no different
|
||||
than any multi-repository ``SRC_URI`` statement used in a recipe (e.g.
|
||||
see the previous section).
|
||||
|
||||
You can keep kernel Metadata in a "kernel-cache", which is a directory
|
||||
containing configuration fragments. As with any Metadata kept outside
|
||||
the recipe-space, you simply need to use the ``SRC_URI`` statement with
|
||||
the "type=kmeta" attribute. Doing so makes the kernel Metadata available
|
||||
during the configuration phase.
|
||||
|
||||
If you modify the Metadata, you must not forget to update the ``SRCREV``
|
||||
statements in the kernel's recipe. In particular, you need to update the
|
||||
``SRCREV_meta`` variable to match the commit in the ``KMETA`` branch you
|
||||
wish to use. Changing the data in these branches and not updating the
|
||||
``SRCREV`` statements to match will cause the build to fetch an older
|
||||
commit.
|
||||
|
||||
Organizing Your Source
|
||||
======================
|
||||
|
||||
Many recipes based on the ``linux-yocto-custom.bb`` recipe use Linux
|
||||
kernel sources that have only a single branch - "master". This type of
|
||||
repository structure is fine for linear development supporting a single
|
||||
machine and architecture. However, if you work with multiple boards and
|
||||
architectures, a kernel source repository with multiple branches is more
|
||||
efficient. For example, suppose you need a series of patches for one
|
||||
board to boot. Sometimes, these patches are works-in-progress or
|
||||
fundamentally wrong, yet they are still necessary for specific boards.
|
||||
In these situations, you most likely do not want to include these
|
||||
patches in every kernel you build (i.e. have the patches as part of the
|
||||
lone "master" branch). It is situations like these that give rise to
|
||||
multiple branches used within a Linux kernel sources Git repository.
|
||||
|
||||
Repository organization strategies exist that maximize source reuse,
|
||||
remove redundancy, and logically order your changes. This section
|
||||
presents strategies for the following cases:
|
||||
|
||||
- Encapsulating patches in a feature description and only including the
|
||||
patches in the BSP descriptions of the applicable boards.
|
||||
|
||||
- Creating a machine branch in your kernel source repository and
|
||||
applying the patches on that branch only.
|
||||
|
||||
- Creating a feature branch in your kernel source repository and
|
||||
merging that branch into your BSP when needed.
|
||||
|
||||
The approach you take is entirely up to you and depends on what works
|
||||
best for your development model.
|
||||
|
||||
Encapsulating Patches
|
||||
---------------------
|
||||
|
||||
if you are reusing patches from an external tree and are not working on
|
||||
the patches, you might find the encapsulated feature to be appropriate.
|
||||
Given this scenario, you do not need to create any branches in the
|
||||
source repository. Rather, you just take the static patches you need and
|
||||
encapsulate them within a feature description. Once you have the feature
|
||||
description, you simply include that into the BSP description as
|
||||
described in the "`BSP Descriptions <#bsp-descriptions>`__" section.
|
||||
|
||||
You can find information on how to create patches and BSP descriptions
|
||||
in the "`Patches <#patches>`__" and "`BSP
|
||||
Descriptions <#bsp-descriptions>`__" sections.
|
||||
|
||||
Machine Branches
|
||||
----------------
|
||||
|
||||
When you have multiple machines and architectures to support, or you are
|
||||
actively working on board support, it is more efficient to create
|
||||
branches in the repository based on individual machines. Having machine
|
||||
branches allows common source to remain in the "master" branch with any
|
||||
features specific to a machine stored in the appropriate machine branch.
|
||||
This organization method frees you from continually reintegrating your
|
||||
patches into a feature.
|
||||
|
||||
Once you have a new branch, you can set up your kernel Metadata to use
|
||||
the branch a couple different ways. In the recipe, you can specify the
|
||||
new branch as the ``KBRANCH`` to use for the board as follows:
|
||||
::
|
||||
|
||||
KBRANCH = "mynewbranch"
|
||||
|
||||
Another method is to use the ``branch`` command in the BSP
|
||||
description:
|
||||
|
||||
mybsp.scc:
|
||||
define KMACHINE mybsp
|
||||
define KTYPE standard
|
||||
define KARCH i386
|
||||
include standard.scc
|
||||
|
||||
branch mynewbranch
|
||||
|
||||
include mybsp-hw.scc
|
||||
|
||||
If you find yourself with numerous branches, you might consider using a
|
||||
hierarchical branching system similar to what the Yocto Linux Kernel Git
|
||||
repositories use:
|
||||
::
|
||||
|
||||
common/kernel_type/machine
|
||||
|
||||
If you had two kernel types, "standard" and "small" for instance, three
|
||||
machines, and common as ``mydir``, the branches in your Git repository
|
||||
might look like this:
|
||||
:
|
||||
|
||||
mydir/base
|
||||
mydir/standard/base
|
||||
mydir/standard/machine_a
|
||||
mydir/standard/machine_b
|
||||
mydir/standard/machine_c
|
||||
mydir/small/base
|
||||
mydir/small/machine_a
|
||||
|
||||
This organization can help clarify the branch relationships. In this
|
||||
case, ``mydir/standard/machine_a`` includes everything in ``mydir/base``
|
||||
and ``mydir/standard/base``. The "standard" and "small" branches add
|
||||
sources specific to those kernel types that for whatever reason are not
|
||||
appropriate for the other branches.
|
||||
|
||||
.. note::
|
||||
|
||||
The "base" branches are an artifact of the way Git manages its data
|
||||
internally on the filesystem: Git will not allow you to use
|
||||
mydir/standard
|
||||
and
|
||||
mydir/standard/machine_a
|
||||
because it would have to create a file and a directory named
|
||||
"standard".
|
||||
|
||||
Feature Branches
|
||||
----------------
|
||||
|
||||
When you are actively developing new features, it can be more efficient
|
||||
to work with that feature as a branch, rather than as a set of patches
|
||||
that have to be regularly updated. The Yocto Project Linux kernel tools
|
||||
provide for this with the ``git merge`` command.
|
||||
|
||||
To merge a feature branch into a BSP, insert the ``git merge`` command
|
||||
after any ``branch`` commands:
|
||||
::
|
||||
|
||||
mybsp.scc:
|
||||
define KMACHINE mybsp
|
||||
define KTYPE standard
|
||||
define KARCH i386
|
||||
include standard.scc
|
||||
|
||||
branch mynewbranch
|
||||
git merge myfeature
|
||||
|
||||
include mybsp-hw.scc
|
||||
|
||||
.. _scc-reference:
|
||||
|
||||
SCC Description File Reference
|
||||
==============================
|
||||
|
||||
This section provides a brief reference for the commands you can use
|
||||
within an SCC description file (``.scc``):
|
||||
|
||||
- ``branch [ref]``: Creates a new branch relative to the current branch
|
||||
(typically ``${KTYPE}``) using the currently checked-out branch, or
|
||||
"ref" if specified.
|
||||
|
||||
- ``define``: Defines variables, such as
|
||||
:term:`KMACHINE`,
|
||||
:term:`KTYPE`,
|
||||
:term:`KARCH`, and
|
||||
:term:`KFEATURE_DESCRIPTION`.
|
||||
|
||||
- ``include SCC_FILE``: Includes an SCC file in the current file. The
|
||||
file is parsed as if you had inserted it inline.
|
||||
|
||||
- ``kconf [hardware|non-hardware] CFG_FILE``: Queues a configuration
|
||||
fragment for merging into the final Linux ``.config`` file.
|
||||
|
||||
- ``git merge GIT_BRANCH``: Merges the feature branch into the current
|
||||
branch.
|
||||
|
||||
- ``patch PATCH_FILE``: Applies the patch to the current Git branch.
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='kernel-dev-advanced'>
|
||||
<title>Working with Advanced Metadata (<filename>yocto-kernel-cache</filename>)</title>
|
||||
|
||||
2078
documentation/kernel-dev/kernel-dev-common.rst
Normal file
2078
documentation/kernel-dev/kernel-dev-common.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='kernel-dev-common'>
|
||||
<title>Common Tasks</title>
|
||||
|
||||
426
documentation/kernel-dev/kernel-dev-concepts-appx.rst
Normal file
426
documentation/kernel-dev/kernel-dev-concepts-appx.rst
Normal file
@@ -0,0 +1,426 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
************************
|
||||
Advanced Kernel Concepts
|
||||
************************
|
||||
|
||||
.. _kernel-big-picture:
|
||||
|
||||
Yocto Project Kernel Development and Maintenance
|
||||
================================================
|
||||
|
||||
Kernels available through the Yocto Project (Yocto Linux kernels), like
|
||||
other kernels, are based off the Linux kernel releases from
|
||||
http://www.kernel.org. At the beginning of a major Linux kernel
|
||||
development cycle, the Yocto Project team chooses a Linux kernel based
|
||||
on factors such as release timing, the anticipated release timing of
|
||||
final upstream ``kernel.org`` versions, and Yocto Project feature
|
||||
requirements. Typically, the Linux kernel chosen is in the final stages
|
||||
of development by the Linux community. In other words, the Linux kernel
|
||||
is in the release candidate or "rc" phase and has yet to reach final
|
||||
release. But, by being in the final stages of external development, the
|
||||
team knows that the ``kernel.org`` final release will clearly be within
|
||||
the early stages of the Yocto Project development window.
|
||||
|
||||
This balance allows the Yocto Project team to deliver the most
|
||||
up-to-date Yocto Linux kernel possible, while still ensuring that the
|
||||
team has a stable official release for the baseline Linux kernel
|
||||
version.
|
||||
|
||||
As implied earlier, the ultimate source for Yocto Linux kernels are
|
||||
released kernels from ``kernel.org``. In addition to a foundational
|
||||
kernel from ``kernel.org``, the available Yocto Linux kernels contain a
|
||||
mix of important new mainline developments, non-mainline developments
|
||||
(when no alternative exists), Board Support Package (BSP) developments,
|
||||
and custom features. These additions result in a commercially released
|
||||
Yocto Project Linux kernel that caters to specific embedded designer
|
||||
needs for targeted hardware.
|
||||
|
||||
You can find a web interface to the Yocto Linux kernels in the
|
||||
:ref:`overview-manual/overview-manual-development-environment:yocto project source repositories`
|
||||
at :yocto_git:`/`. If you look at the interface, you will see to
|
||||
the left a grouping of Git repositories titled "Yocto Linux Kernel".
|
||||
Within this group, you will find several Linux Yocto kernels developed
|
||||
and included with Yocto Project releases:
|
||||
|
||||
- *linux-yocto-4.1:* The stable Yocto Project kernel to use with
|
||||
the Yocto Project Release 2.0. This kernel is based on the Linux 4.1
|
||||
released kernel.
|
||||
|
||||
- *linux-yocto-4.4:* The stable Yocto Project kernel to use with
|
||||
the Yocto Project Release 2.1. This kernel is based on the Linux 4.4
|
||||
released kernel.
|
||||
|
||||
- *linux-yocto-4.6:* A temporary kernel that is not tied to any
|
||||
Yocto Project release.
|
||||
|
||||
- *linux-yocto-4.8:* The stable yocto Project kernel to use with
|
||||
the Yocto Project Release 2.2.
|
||||
|
||||
- *linux-yocto-4.9:* The stable Yocto Project kernel to use with
|
||||
the Yocto Project Release 2.3. This kernel is based on the Linux 4.9
|
||||
released kernel.
|
||||
|
||||
- *linux-yocto-4.10:* The default stable Yocto Project kernel to
|
||||
use with the Yocto Project Release 2.3. This kernel is based on the
|
||||
Linux 4.10 released kernel.
|
||||
|
||||
- *linux-yocto-4.12:* The default stable Yocto Project kernel to
|
||||
use with the Yocto Project Release 2.4. This kernel is based on the
|
||||
Linux 4.12 released kernel.
|
||||
|
||||
- *yocto-kernel-cache:* The ``linux-yocto-cache`` contains patches
|
||||
and configurations for the linux-yocto kernel tree. This repository
|
||||
is useful when working on the linux-yocto kernel. For more
|
||||
information on this "Advanced Kernel Metadata", see the
|
||||
":doc:`kernel-dev-advanced`" Chapter.
|
||||
|
||||
- *linux-yocto-dev:* A development kernel based on the latest
|
||||
upstream release candidate available.
|
||||
|
||||
.. note::
|
||||
|
||||
Long Term Support Initiative (LTSI) for Yocto Linux kernels is as
|
||||
follows:
|
||||
|
||||
- For Yocto Project releases 1.7, 1.8, and 2.0, the LTSI kernel is
|
||||
``linux-yocto-3.14``.
|
||||
|
||||
- For Yocto Project releases 2.1, 2.2, and 2.3, the LTSI kernel is
|
||||
``linux-yocto-4.1``.
|
||||
|
||||
- For Yocto Project release 2.4, the LTSI kernel is
|
||||
``linux-yocto-4.9``
|
||||
|
||||
- ``linux-yocto-4.4`` is an LTS kernel.
|
||||
|
||||
Once a Yocto Linux kernel is officially released, the Yocto Project team
|
||||
goes into their next development cycle, or upward revision (uprev)
|
||||
cycle, while still continuing maintenance on the released kernel. It is
|
||||
important to note that the most sustainable and stable way to include
|
||||
feature development upstream is through a kernel uprev process.
|
||||
Back-porting hundreds of individual fixes and minor features from
|
||||
various kernel versions is not sustainable and can easily compromise
|
||||
quality.
|
||||
|
||||
During the uprev cycle, the Yocto Project team uses an ongoing analysis
|
||||
of Linux kernel development, BSP support, and release timing to select
|
||||
the best possible ``kernel.org`` Linux kernel version on which to base
|
||||
subsequent Yocto Linux kernel development. The team continually monitors
|
||||
Linux community kernel development to look for significant features of
|
||||
interest. The team does consider back-porting large features if they
|
||||
have a significant advantage. User or community demand can also trigger
|
||||
a back-port or creation of new functionality in the Yocto Project
|
||||
baseline kernel during the uprev cycle.
|
||||
|
||||
Generally speaking, every new Linux kernel both adds features and
|
||||
introduces new bugs. These consequences are the basic properties of
|
||||
upstream Linux kernel development and are managed by the Yocto Project
|
||||
team's Yocto Linux kernel development strategy. It is the Yocto Project
|
||||
team's policy to not back-port minor features to the released Yocto
|
||||
Linux kernel. They only consider back-porting significant technological
|
||||
jumps DASH and, that is done after a complete gap analysis. The reason
|
||||
for this policy is that back-porting any small to medium sized change
|
||||
from an evolving Linux kernel can easily create mismatches,
|
||||
incompatibilities and very subtle errors.
|
||||
|
||||
The policies described in this section result in both a stable and a
|
||||
cutting edge Yocto Linux kernel that mixes forward ports of existing
|
||||
Linux kernel features and significant and critical new functionality.
|
||||
Forward porting Linux kernel functionality into the Yocto Linux kernels
|
||||
available through the Yocto Project can be thought of as a "micro
|
||||
uprev." The many "micro uprevs" produce a Yocto Linux kernel version
|
||||
with a mix of important new mainline, non-mainline, BSP developments and
|
||||
feature integrations. This Yocto Linux kernel gives insight into new
|
||||
features and allows focused amounts of testing to be done on the kernel,
|
||||
which prevents surprises when selecting the next major uprev. The
|
||||
quality of these cutting edge Yocto Linux kernels is evolving and the
|
||||
kernels are used in leading edge feature and BSP development.
|
||||
|
||||
Yocto Linux Kernel Architecture and Branching Strategies
|
||||
========================================================
|
||||
|
||||
As mentioned earlier, a key goal of the Yocto Project is to present the
|
||||
developer with a kernel that has a clear and continuous history that is
|
||||
visible to the user. The architecture and mechanisms, in particular the
|
||||
branching strategies, used achieve that goal in a manner similar to
|
||||
upstream Linux kernel development in ``kernel.org``.
|
||||
|
||||
You can think of a Yocto Linux kernel as consisting of a baseline Linux
|
||||
kernel with added features logically structured on top of the baseline.
|
||||
The features are tagged and organized by way of a branching strategy
|
||||
implemented by the Yocto Project team using the Source Code Manager
|
||||
(SCM) Git.
|
||||
|
||||
.. note::
|
||||
|
||||
- Git is the obvious SCM for meeting the Yocto Linux kernel
|
||||
organizational and structural goals described in this section. Not
|
||||
only is Git the SCM for Linux kernel development in ``kernel.org``
|
||||
but, Git continues to grow in popularity and supports many
|
||||
different work flows, front-ends and management techniques.
|
||||
|
||||
- You can find documentation on Git at
|
||||
http://git-scm.com/documentation. You can also get an
|
||||
introduction to Git as it applies to the Yocto Project in the
|
||||
":ref:`overview-manual/overview-manual-development-environment:git`" section in the Yocto Project
|
||||
Overview and Concepts Manual. The latter reference provides an
|
||||
overview of Git and presents a minimal set of Git commands that
|
||||
allows you to be functional using Git. You can use as much, or as
|
||||
little, of what Git has to offer to accomplish what you need for
|
||||
your project. You do not have to be a "Git Expert" in order to use
|
||||
it with the Yocto Project.
|
||||
|
||||
Using Git's tagging and branching features, the Yocto Project team
|
||||
creates kernel branches at points where functionality is no longer
|
||||
shared and thus, needs to be isolated. For example, board-specific
|
||||
incompatibilities would require different functionality and would
|
||||
require a branch to separate the features. Likewise, for specific kernel
|
||||
features, the same branching strategy is used.
|
||||
|
||||
This "tree-like" architecture results in a structure that has features
|
||||
organized to be specific for particular functionality, single kernel
|
||||
types, or a subset of kernel types. Thus, the user has the ability to
|
||||
see the added features and the commits that make up those features. In
|
||||
addition to being able to see added features, the user can also view the
|
||||
history of what made up the baseline Linux kernel.
|
||||
|
||||
Another consequence of this strategy results in not having to store the
|
||||
same feature twice internally in the tree. Rather, the kernel team
|
||||
stores the unique differences required to apply the feature onto the
|
||||
kernel type in question.
|
||||
|
||||
.. note::
|
||||
|
||||
The Yocto Project team strives to place features in the tree such
|
||||
that features can be shared by all boards and kernel types where
|
||||
possible. However, during development cycles or when large features
|
||||
are merged, the team cannot always follow this practice. In those
|
||||
cases, the team uses isolated branches to merge features.
|
||||
|
||||
BSP-specific code additions are handled in a similar manner to
|
||||
kernel-specific additions. Some BSPs only make sense given certain
|
||||
kernel types. So, for these types, the team creates branches off the end
|
||||
of that kernel type for all of the BSPs that are supported on that
|
||||
kernel type. From the perspective of the tools that create the BSP
|
||||
branch, the BSP is really no different than a feature. Consequently, the
|
||||
same branching strategy applies to BSPs as it does to kernel features.
|
||||
So again, rather than store the BSP twice, the team only stores the
|
||||
unique differences for the BSP across the supported multiple kernels.
|
||||
|
||||
While this strategy can result in a tree with a significant number of
|
||||
branches, it is important to realize that from the developer's point of
|
||||
view, there is a linear path that travels from the baseline
|
||||
``kernel.org``, through a select group of features and ends with their
|
||||
BSP-specific commits. In other words, the divisions of the kernel are
|
||||
transparent and are not relevant to the developer on a day-to-day basis.
|
||||
From the developer's perspective, this path is the "master" branch in
|
||||
Git terms. The developer does not need to be aware of the existence of
|
||||
any other branches at all. Of course, value exists in the having these
|
||||
branches in the tree, should a person decide to explore them. For
|
||||
example, a comparison between two BSPs at either the commit level or at
|
||||
the line-by-line code ``diff`` level is now a trivial operation.
|
||||
|
||||
The following illustration shows the conceptual Yocto Linux kernel.
|
||||
|
||||
.. image:: figures/kernel-architecture-overview.png
|
||||
:align: center
|
||||
|
||||
In the illustration, the "Kernel.org Branch Point" marks the specific
|
||||
spot (or Linux kernel release) from which the Yocto Linux kernel is
|
||||
created. From this point forward in the tree, features and differences
|
||||
are organized and tagged.
|
||||
|
||||
The "Yocto Project Baseline Kernel" contains functionality that is
|
||||
common to every kernel type and BSP that is organized further along in
|
||||
the tree. Placing these common features in the tree this way means
|
||||
features do not have to be duplicated along individual branches of the
|
||||
tree structure.
|
||||
|
||||
From the "Yocto Project Baseline Kernel", branch points represent
|
||||
specific functionality for individual Board Support Packages (BSPs) as
|
||||
well as real-time kernels. The illustration represents this through
|
||||
three BSP-specific branches and a real-time kernel branch. Each branch
|
||||
represents some unique functionality for the BSP or for a real-time
|
||||
Yocto Linux kernel.
|
||||
|
||||
In this example structure, the "Real-time (rt) Kernel" branch has common
|
||||
features for all real-time Yocto Linux kernels and contains more
|
||||
branches for individual BSP-specific real-time kernels. The illustration
|
||||
shows three branches as an example. Each branch points the way to
|
||||
specific, unique features for a respective real-time kernel as they
|
||||
apply to a given BSP.
|
||||
|
||||
The resulting tree structure presents a clear path of markers (or
|
||||
branches) to the developer that, for all practical purposes, is the
|
||||
Yocto Linux kernel needed for any given set of requirements.
|
||||
|
||||
.. note::
|
||||
|
||||
Keep in mind the figure does not take into account all the supported
|
||||
Yocto Linux kernels, but rather shows a single generic kernel just
|
||||
for conceptual purposes. Also keep in mind that this structure
|
||||
represents the Yocto Project
|
||||
Source Repositories
|
||||
that are either pulled from during the build or established on the
|
||||
host development system prior to the build by either cloning a
|
||||
particular kernel's Git repository or by downloading and unpacking a
|
||||
tarball.
|
||||
|
||||
Working with the kernel as a structured tree follows recognized
|
||||
community best practices. In particular, the kernel as shipped with the
|
||||
product, should be considered an "upstream source" and viewed as a
|
||||
series of historical and documented modifications (commits). These
|
||||
modifications represent the development and stabilization done by the
|
||||
Yocto Project kernel development team.
|
||||
|
||||
Because commits only change at significant release points in the product
|
||||
life cycle, developers can work on a branch created from the last
|
||||
relevant commit in the shipped Yocto Project Linux kernel. As mentioned
|
||||
previously, the structure is transparent to the developer because the
|
||||
kernel tree is left in this state after cloning and building the kernel.
|
||||
|
||||
Kernel Build File Hierarchy
|
||||
===========================
|
||||
|
||||
Upstream storage of all the available kernel source code is one thing,
|
||||
while representing and using the code on your host development system is
|
||||
another. Conceptually, you can think of the kernel source repositories
|
||||
as all the source files necessary for all the supported Yocto Linux
|
||||
kernels. As a developer, you are just interested in the source files for
|
||||
the kernel on which you are working. And, furthermore, you need them
|
||||
available on your host system.
|
||||
|
||||
Kernel source code is available on your host system several different
|
||||
ways:
|
||||
|
||||
- *Files Accessed While using devtool:* ``devtool``, which is
|
||||
available with the Yocto Project, is the preferred method by which to
|
||||
modify the kernel. See the ":ref:`kernel-dev/kernel-dev-intro:kernel modification workflow`" section.
|
||||
|
||||
- *Cloned Repository:* If you are working in the kernel all the time,
|
||||
you probably would want to set up your own local Git repository of
|
||||
the Yocto Linux kernel tree. For information on how to clone a Yocto
|
||||
Linux kernel Git repository, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
|
||||
section.
|
||||
|
||||
- *Temporary Source Files from a Build:* If you just need to make some
|
||||
patches to the kernel using a traditional BitBake workflow (i.e. not
|
||||
using the ``devtool``), you can access temporary kernel source files
|
||||
that were extracted and used during a kernel build.
|
||||
|
||||
The temporary kernel source files resulting from a build using BitBake
|
||||
have a particular hierarchy. When you build the kernel on your
|
||||
development system, all files needed for the build are taken from the
|
||||
source repositories pointed to by the
|
||||
:term:`SRC_URI` variable and gathered
|
||||
in a temporary work area where they are subsequently used to create the
|
||||
unique kernel. Thus, in a sense, the process constructs a local source
|
||||
tree specific to your kernel from which to generate the new kernel
|
||||
image.
|
||||
|
||||
The following figure shows the temporary file structure created on your
|
||||
host system when you build the kernel using Bitbake. This
|
||||
:term:`Build Directory` contains all the
|
||||
source files used during the build.
|
||||
|
||||
.. image:: figures/kernel-overview-2-generic.png
|
||||
:align: center
|
||||
|
||||
Again, for additional information on the Yocto Project kernel's
|
||||
architecture and its branching strategy, see the
|
||||
":ref:`kernel-dev/kernel-dev-concepts-appx:yocto linux kernel architecture and branching strategies`"
|
||||
section. You can also reference the
|
||||
":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
|
||||
and
|
||||
":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
|
||||
sections for detailed example that modifies the kernel.
|
||||
|
||||
Determining Hardware and Non-Hardware Features for the Kernel Configuration Audit Phase
|
||||
=======================================================================================
|
||||
|
||||
This section describes part of the kernel configuration audit phase that
|
||||
most developers can ignore. For general information on kernel
|
||||
configuration including ``menuconfig``, ``defconfig`` files, and
|
||||
configuration fragments, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:configuring the kernel`" section.
|
||||
|
||||
During this part of the audit phase, the contents of the final
|
||||
``.config`` file are compared against the fragments specified by the
|
||||
system. These fragments can be system fragments, distro fragments, or
|
||||
user-specified configuration elements. Regardless of their origin, the
|
||||
OpenEmbedded build system warns the user if a specific option is not
|
||||
included in the final kernel configuration.
|
||||
|
||||
By default, in order to not overwhelm the user with configuration
|
||||
warnings, the system only reports missing "hardware" options as they
|
||||
could result in a boot failure or indicate that important hardware is
|
||||
not available.
|
||||
|
||||
To determine whether or not a given option is "hardware" or
|
||||
"non-hardware", the kernel Metadata in ``yocto-kernel-cache`` contains
|
||||
files that classify individual or groups of options as either hardware
|
||||
or non-hardware. To better show this, consider a situation where the
|
||||
``yocto-kernel-cache`` contains the following files:
|
||||
::
|
||||
|
||||
yocto-kernel-cache/features/drm-psb/hardware.cfg
|
||||
yocto-kernel-cache/features/kgdb/hardware.cfg
|
||||
yocto-kernel-cache/ktypes/base/hardware.cfg
|
||||
yocto-kernel-cache/bsp/mti-malta32/hardware.cfg
|
||||
yocto-kernel-cache/bsp/qemu-ppc32/hardware.cfg
|
||||
yocto-kernel-cache/bsp/qemuarma9/hardware.cfg
|
||||
yocto-kernel-cache/bsp/mti-malta64/hardware.cfg
|
||||
yocto-kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg
|
||||
yocto-kernel-cache/bsp/common-pc/hardware.cfg
|
||||
yocto-kernel-cache/bsp/common-pc-64/hardware.cfg
|
||||
yocto-kernel-cache/features/rfkill/non-hardware.cfg
|
||||
yocto-kernel-cache/ktypes/base/non-hardware.cfg
|
||||
yocto-kernel-cache/features/aufs/non-hardware.kcf
|
||||
yocto-kernel-cache/features/ocf/non-hardware.kcf
|
||||
yocto-kernel-cache/ktypes/base/non-hardware.kcf
|
||||
yocto-kernel-cache/ktypes/base/hardware.kcf
|
||||
yocto-kernel-cache/bsp/qemu-ppc32/hardware.kcf
|
||||
|
||||
The following list
|
||||
provides explanations for the various files:
|
||||
|
||||
- ``hardware.kcf``: Specifies a list of kernel Kconfig files that
|
||||
contain hardware options only.
|
||||
|
||||
- ``non-hardware.kcf``: Specifies a list of kernel Kconfig files that
|
||||
contain non-hardware options only.
|
||||
|
||||
- ``hardware.cfg``: Specifies a list of kernel ``CONFIG_`` options that
|
||||
are hardware, regardless of whether or not they are within a Kconfig
|
||||
file specified by a hardware or non-hardware Kconfig file (i.e.
|
||||
``hardware.kcf`` or ``non-hardware.kcf``).
|
||||
|
||||
- ``non-hardware.cfg``: Specifies a list of kernel ``CONFIG_`` options
|
||||
that are not hardware, regardless of whether or not they are within a
|
||||
Kconfig file specified by a hardware or non-hardware Kconfig file
|
||||
(i.e. ``hardware.kcf`` or ``non-hardware.kcf``).
|
||||
|
||||
Here is a specific example using the
|
||||
``kernel-cache/bsp/mti-malta32/hardware.cfg``:
|
||||
::
|
||||
|
||||
CONFIG_SERIAL_8250
|
||||
CONFIG_SERIAL_8250_CONSOLE
|
||||
CONFIG_SERIAL_8250_NR_UARTS
|
||||
CONFIG_SERIAL_8250_PCI
|
||||
CONFIG_SERIAL_CORE
|
||||
CONFIG_SERIAL_CORE_CONSOLE
|
||||
CONFIG_VGA_ARB
|
||||
|
||||
The kernel configuration audit automatically detects
|
||||
these files (hence the names must be exactly the ones discussed here),
|
||||
and uses them as inputs when generating warnings about the final
|
||||
``.config`` file.
|
||||
|
||||
A user-specified kernel Metadata repository, or recipe space feature,
|
||||
can use these same files to classify options that are found within its
|
||||
``.cfg`` files as hardware or non-hardware, to prevent the OpenEmbedded
|
||||
build system from producing an error or warning when an option is not in
|
||||
the final ``.config`` file.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<appendix id='kernel-dev-concepts-appx'>
|
||||
<title>Advanced Kernel Concepts</title>
|
||||
@@ -191,7 +192,7 @@
|
||||
Forward porting Linux kernel functionality into the Yocto Linux
|
||||
kernels available through the Yocto Project can be thought of as
|
||||
a "micro uprev."
|
||||
The many “micro uprevs” produce a Yocto Linux kernel version with
|
||||
The many "micro uprevs" produce a Yocto Linux kernel version with
|
||||
a mix of important new mainline, non-mainline, BSP developments
|
||||
and feature integrations.
|
||||
This Yocto Linux kernel gives insight into new features and
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
81
documentation/kernel-dev/kernel-dev-faq.rst
Normal file
81
documentation/kernel-dev/kernel-dev-faq.rst
Normal file
@@ -0,0 +1,81 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
**********************
|
||||
Kernel Development FAQ
|
||||
**********************
|
||||
|
||||
.. _kernel-dev-faq-section:
|
||||
|
||||
Common Questions and Solutions
|
||||
==============================
|
||||
|
||||
The following lists some solutions for common questions.
|
||||
|
||||
How do I use my own Linux kernel ``.config`` file?
|
||||
--------------------------------------------------
|
||||
|
||||
Refer to the
|
||||
":ref:`kernel-dev/kernel-dev-common:changing the configuration`"
|
||||
section for information.
|
||||
|
||||
How do I create configuration fragments?
|
||||
----------------------------------------
|
||||
|
||||
A: Refer to the
|
||||
":ref:`kernel-dev/kernel-dev-common:creating configuration fragments`"
|
||||
section for information.
|
||||
|
||||
How do I use my own Linux kernel sources?
|
||||
-----------------------------------------
|
||||
|
||||
Refer to the
|
||||
":ref:`kernel-dev/kernel-dev-common:working with your own sources`"
|
||||
section for information.
|
||||
|
||||
How do I install/not-install the kernel image on the rootfs?
|
||||
------------------------------------------------------------
|
||||
|
||||
The kernel image (e.g. ``vmlinuz``) is provided by the
|
||||
``kernel-image`` package. Image recipes depend on ``kernel-base``. To
|
||||
specify whether or not the kernel image is installed in the generated
|
||||
root filesystem, override ``RDEPENDS_kernel-base`` to include or not
|
||||
include "kernel-image". See the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:using .bbappend files in your layer`"
|
||||
section in the
|
||||
Yocto Project Development Tasks Manual for information on how to use an
|
||||
append file to override metadata.
|
||||
|
||||
How do I install a specific kernel module?
|
||||
------------------------------------------
|
||||
|
||||
Linux kernel modules are packaged individually. To ensure a
|
||||
specific kernel module is included in an image, include it in the
|
||||
appropriate machine
|
||||
:term:`RRECOMMENDS` variable.
|
||||
These other variables are useful for installing specific modules:
|
||||
:term:`MACHINE_ESSENTIAL_EXTRA_RDEPENDS`
|
||||
:term:`MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS`
|
||||
:term:`MACHINE_EXTRA_RDEPENDS`
|
||||
:term:`MACHINE_EXTRA_RRECOMMENDS`
|
||||
For example, set the following in the ``qemux86.conf`` file to include
|
||||
the ``ab123`` kernel modules with images built for the ``qemux86``
|
||||
machine:
|
||||
::
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123"
|
||||
|
||||
For more
|
||||
information, see the "`Incorporating Out-of-Tree
|
||||
Modules <#incorporating-out-of-tree-modules>`__" section.
|
||||
|
||||
How do I change the Linux kernel command line?
|
||||
----------------------------------------------
|
||||
|
||||
The Linux kernel command line is
|
||||
typically specified in the machine config using the ``APPEND`` variable.
|
||||
For example, you can add some helpful debug information doing the
|
||||
following:
|
||||
::
|
||||
|
||||
APPEND += "printk.time=y initcall_debug debug"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<appendix id='kernel-dev-faq'>
|
||||
<title>Kernel Development FAQ</title>
|
||||
|
||||
183
documentation/kernel-dev/kernel-dev-intro.rst
Normal file
183
documentation/kernel-dev/kernel-dev-intro.rst
Normal file
@@ -0,0 +1,183 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
************
|
||||
Introduction
|
||||
************
|
||||
|
||||
.. _kernel-dev-overview:
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Regardless of how you intend to make use of the Yocto Project, chances
|
||||
are you will work with the Linux kernel. This manual describes how to
|
||||
set up your build host to support kernel development, introduces the
|
||||
kernel development process, provides background information on the Yocto
|
||||
Linux kernel :term:`Metadata`, describes
|
||||
common tasks you can perform using the kernel tools, shows you how to
|
||||
use the kernel Metadata needed to work with the kernel inside the Yocto
|
||||
Project, and provides insight into how the Yocto Project team develops
|
||||
and maintains Yocto Linux kernel Git repositories and Metadata.
|
||||
|
||||
Each Yocto Project release has a set of Yocto Linux kernel recipes,
|
||||
whose Git repositories you can view in the Yocto
|
||||
:yocto_git:`Source Repositories <>` under the "Yocto Linux Kernel"
|
||||
heading. New recipes for the release track the latest Linux kernel
|
||||
upstream developments from http://www.kernel.org> and introduce
|
||||
newly-supported platforms. Previous recipes in the release are refreshed
|
||||
and supported for at least one additional Yocto Project release. As they
|
||||
align, these previous releases are updated to include the latest from
|
||||
the Long Term Support Initiative (LTSI) project. You can learn more
|
||||
about Yocto Linux kernels and LTSI in the ":ref:`Yocto Project Kernel
|
||||
Development and Maintenance <kernel-big-picture>`" section.
|
||||
|
||||
Also included is a Yocto Linux kernel development recipe
|
||||
(``linux-yocto-dev.bb``) should you want to work with the very latest in
|
||||
upstream Yocto Linux kernel development and kernel Metadata development.
|
||||
|
||||
.. note::
|
||||
|
||||
For more on Yocto Linux kernels, see the "
|
||||
Yocto Project Kernel Development and Maintenance
|
||||
section.
|
||||
|
||||
The Yocto Project also provides a powerful set of kernel tools for
|
||||
managing Yocto Linux kernel sources and configuration data. You can use
|
||||
these tools to make a single configuration change, apply multiple
|
||||
patches, or work with your own kernel sources.
|
||||
|
||||
In particular, the kernel tools allow you to generate configuration
|
||||
fragments that specify only what you must, and nothing more.
|
||||
Configuration fragments only need to contain the highest level visible
|
||||
``CONFIG`` options as presented by the Yocto Linux kernel ``menuconfig``
|
||||
system. Contrast this against a complete Yocto Linux kernel ``.config``
|
||||
file, which includes all the automatically selected ``CONFIG`` options.
|
||||
This efficiency reduces your maintenance effort and allows you to
|
||||
further separate your configuration in ways that make sense for your
|
||||
project. A common split separates policy and hardware. For example, all
|
||||
your kernels might support the ``proc`` and ``sys`` filesystems, but
|
||||
only specific boards require sound, USB, or specific drivers. Specifying
|
||||
these configurations individually allows you to aggregate them together
|
||||
as needed, but maintains them in only one place. Similar logic applies
|
||||
to separating source changes.
|
||||
|
||||
If you do not maintain your own kernel sources and need to make only
|
||||
minimal changes to the sources, the released recipes provide a vetted
|
||||
base upon which to layer your changes. Doing so allows you to benefit
|
||||
from the continual kernel integration and testing performed during
|
||||
development of the Yocto Project.
|
||||
|
||||
If, instead, you have a very specific Linux kernel source tree and are
|
||||
unable to align with one of the official Yocto Linux kernel recipes, an
|
||||
alternative exists by which you can use the Yocto Project Linux kernel
|
||||
tools with your own kernel sources.
|
||||
|
||||
The remainder of this manual provides instructions for completing
|
||||
specific Linux kernel development tasks. These instructions assume you
|
||||
are comfortable working with
|
||||
`BitBake <http://openembedded.org/wiki/Bitbake>`__ recipes and basic
|
||||
open-source development tools. Understanding these concepts will
|
||||
facilitate the process of working with the kernel recipes. If you find
|
||||
you need some additional background, please be sure to review and
|
||||
understand the following documentation:
|
||||
|
||||
- :doc:`../brief-yoctoprojectqs/brief-yoctoprojectqs` document.
|
||||
|
||||
- :doc:`../overview-manual/overview-manual`.
|
||||
|
||||
- :ref:`devtool
|
||||
workflow <sdk-manual/sdk-extensible:using \`\`devtool\`\` in your sdk workflow>`
|
||||
as described in the Yocto Project Application Development and the
|
||||
Extensible Software Development Kit (eSDK) manual.
|
||||
|
||||
- The ":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- The "`Kernel Modification
|
||||
Workflow <#kernel-modification-workflow>`__" section.
|
||||
|
||||
Kernel Modification Workflow
|
||||
============================
|
||||
|
||||
Kernel modification involves changing the Yocto Project kernel, which
|
||||
could involve changing configuration options as well as adding new
|
||||
kernel recipes. Configuration changes can be added in the form of
|
||||
configuration fragments, while recipe modification comes through the
|
||||
kernel's ``recipes-kernel`` area in a kernel layer you create.
|
||||
|
||||
This section presents a high-level overview of the Yocto Project kernel
|
||||
modification workflow. The illustration and accompanying list provide
|
||||
general information and references for further information.
|
||||
|
||||
.. image:: figures/kernel-dev-flow.png
|
||||
:align: center
|
||||
|
||||
1. *Set up Your Host Development System to Support Development Using the
|
||||
Yocto Project*: See the ":doc:`../dev-manual/dev-manual-start`" section in
|
||||
the Yocto Project Development Tasks Manual for options on how to get
|
||||
a build host ready to use the Yocto Project.
|
||||
|
||||
2. *Set Up Your Host Development System for Kernel Development:* It is
|
||||
recommended that you use ``devtool`` and an extensible SDK for kernel
|
||||
development. Alternatively, you can use traditional kernel
|
||||
development methods with the Yocto Project. Either way, there are
|
||||
steps you need to take to get the development environment ready.
|
||||
|
||||
Using ``devtool`` and the eSDK requires that you have a clean build
|
||||
of the image and that you are set up with the appropriate eSDK. For
|
||||
more information, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:getting ready to develop using \`\`devtool\`\``"
|
||||
section.
|
||||
|
||||
Using traditional kernel development requires that you have the
|
||||
kernel source available in an isolated local Git repository. For more
|
||||
information, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:getting ready for traditional kernel development`"
|
||||
section.
|
||||
|
||||
3. *Make Changes to the Kernel Source Code if applicable:* Modifying the
|
||||
kernel does not always mean directly changing source files. However,
|
||||
if you have to do this, you make the changes to the files in the
|
||||
eSDK's Build Directory if you are using ``devtool``. For more
|
||||
information, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:using \`\`devtool\`\` to patch the kernel`"
|
||||
section.
|
||||
|
||||
If you are using traditional kernel development, you edit the source
|
||||
files in the kernel's local Git repository. For more information, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:using traditional kernel development to patch the kernel`"
|
||||
section.
|
||||
|
||||
4. *Make Kernel Configuration Changes if Applicable:* If your situation
|
||||
calls for changing the kernel's configuration, you can use
|
||||
:ref:`menuconfig <kernel-dev/kernel-dev-common:using \`\`menuconfig\`\`>`,
|
||||
which allows you to
|
||||
interactively develop and test the configuration changes you are
|
||||
making to the kernel. Saving changes you make with ``menuconfig``
|
||||
updates the kernel's ``.config`` file.
|
||||
|
||||
.. note::
|
||||
|
||||
Try to resist the temptation to directly edit an existing
|
||||
.config
|
||||
file, which is found in the Build Directory among the source code
|
||||
used for the build. Doing so, can produce unexpected results when
|
||||
the OpenEmbedded build system regenerates the configuration file.
|
||||
|
||||
Once you are satisfied with the configuration changes made using
|
||||
``menuconfig`` and you have saved them, you can directly compare the
|
||||
resulting ``.config`` file against an existing original and gather
|
||||
those changes into a `configuration fragment
|
||||
file <#creating-config-fragments>`__ to be referenced from within the
|
||||
kernel's ``.bbappend`` file.
|
||||
|
||||
Additionally, if you are working in a BSP layer and need to modify
|
||||
the BSP's kernel's configuration, you can use ``menuconfig``.
|
||||
|
||||
5. *Rebuild the Kernel Image With Your Changes:* Rebuilding the kernel
|
||||
image applies your changes. Depending on your target hardware, you
|
||||
can verify your changes on actual hardware or perhaps QEMU.
|
||||
|
||||
The remainder of this developer's guide covers common tasks typically
|
||||
used during kernel development, advanced Metadata usage, and Yocto Linux
|
||||
kernel maintenance concepts.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='kernel-dev-intro'>
|
||||
<title>Introduction</title>
|
||||
|
||||
239
documentation/kernel-dev/kernel-dev-maint-appx.rst
Normal file
239
documentation/kernel-dev/kernel-dev-maint-appx.rst
Normal file
@@ -0,0 +1,239 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
******************
|
||||
Kernel Maintenance
|
||||
******************
|
||||
|
||||
Tree Construction
|
||||
=================
|
||||
|
||||
This section describes construction of the Yocto Project kernel source
|
||||
repositories as accomplished by the Yocto Project team to create Yocto
|
||||
Linux kernel repositories. These kernel repositories are found under the
|
||||
heading "Yocto Linux Kernel" at :yocto_git:`/` and
|
||||
are shipped as part of a Yocto Project release. The team creates these
|
||||
repositories by compiling and executing the set of feature descriptions
|
||||
for every BSP and feature in the product. Those feature descriptions
|
||||
list all necessary patches, configurations, branches, tags, and feature
|
||||
divisions found in a Yocto Linux kernel. Thus, the Yocto Project Linux
|
||||
kernel repository (or tree) and accompanying Metadata in the
|
||||
``yocto-kernel-cache`` are built.
|
||||
|
||||
The existence of these repositories allow you to access and clone a
|
||||
particular Yocto Project Linux kernel repository and use it to build
|
||||
images based on their configurations and features.
|
||||
|
||||
You can find the files used to describe all the valid features and BSPs
|
||||
in the Yocto Project Linux kernel in any clone of the Yocto Project
|
||||
Linux kernel source repository and ``yocto-kernel-cache`` Git trees. For
|
||||
example, the following commands clone the Yocto Project baseline Linux
|
||||
kernel that branches off ``linux.org`` version 4.12 and the
|
||||
``yocto-kernel-cache``, which contains stores of kernel Metadata:
|
||||
::
|
||||
|
||||
$ git clone git://git.yoctoproject.org/linux-yocto-4.12
|
||||
$ git clone git://git.yoctoproject.org/linux-kernel-cache
|
||||
|
||||
For more information on
|
||||
how to set up a local Git repository of the Yocto Project Linux kernel
|
||||
files, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
|
||||
section.
|
||||
|
||||
Once you have cloned the kernel Git repository and the cache of Metadata
|
||||
on your local machine, you can discover the branches that are available
|
||||
in the repository using the following Git command: $ git branch -a
|
||||
Checking out a branch allows you to work with a particular Yocto Linux
|
||||
kernel. For example, the following commands check out the
|
||||
"standard/beagleboard" branch of the Yocto Linux kernel repository and
|
||||
the "yocto-4.12" branch of the ``yocto-kernel-cache`` repository:
|
||||
::
|
||||
|
||||
$ cd ~/linux-yocto-4.12
|
||||
$ git checkout -b my-kernel-4.12 remotes/origin/standard/beagleboard
|
||||
$ cd ~/linux-kernel-cache
|
||||
$ git checkout -b my-4.12-metadata remotes/origin/yocto-4.12
|
||||
|
||||
.. note::
|
||||
|
||||
Branches in the
|
||||
yocto-kernel-cache
|
||||
repository correspond to Yocto Linux kernel versions (e.g.
|
||||
"yocto-4.12", "yocto-4.10", "yocto-4.9", and so forth).
|
||||
|
||||
Once you have checked out and switched to appropriate branches, you can
|
||||
see a snapshot of all the kernel source files used to used to build that
|
||||
particular Yocto Linux kernel for a particular board.
|
||||
|
||||
To see the features and configurations for a particular Yocto Linux
|
||||
kernel, you need to examine the ``yocto-kernel-cache`` Git repository.
|
||||
As mentioned, branches in the ``yocto-kernel-cache`` repository
|
||||
correspond to Yocto Linux kernel versions (e.g. ``yocto-4.12``).
|
||||
Branches contain descriptions in the form of ``.scc`` and ``.cfg``
|
||||
files.
|
||||
|
||||
You should realize, however, that browsing your local
|
||||
``yocto-kernel-cache`` repository for feature descriptions and patches
|
||||
is not an effective way to determine what is in a particular kernel
|
||||
branch. Instead, you should use Git directly to discover the changes in
|
||||
a branch. Using Git is an efficient and flexible way to inspect changes
|
||||
to the kernel.
|
||||
|
||||
.. note::
|
||||
|
||||
Ground up reconstruction of the complete kernel tree is an action
|
||||
only taken by the Yocto Project team during an active development
|
||||
cycle. When you create a clone of the kernel Git repository, you are
|
||||
simply making it efficiently available for building and development.
|
||||
|
||||
The following steps describe what happens when the Yocto Project Team
|
||||
constructs the Yocto Project kernel source Git repository (or tree)
|
||||
found at :yocto_git:`/` given the introduction of a new
|
||||
top-level kernel feature or BSP. The following actions effectively
|
||||
provide the Metadata and create the tree that includes the new feature,
|
||||
patch, or BSP:
|
||||
|
||||
1. *Pass Feature to the OpenEmbedded Build System:* A top-level kernel
|
||||
feature is passed to the kernel build subsystem. Normally, this
|
||||
feature is a BSP for a particular kernel type.
|
||||
|
||||
2. *Locate Feature:* The file that describes the top-level feature is
|
||||
located by searching these system directories:
|
||||
|
||||
- The in-tree kernel-cache directories, which are located in the
|
||||
:yocto_git:`yocto-kernel-cache </cgit/cgit.cgi/yocto-kernel-cache/tree/bsp>`
|
||||
repository organized under the "Yocto Linux Kernel" heading in the
|
||||
:yocto_git:`Yocto Project Source Repositories <>`.
|
||||
|
||||
- Areas pointed to by ``SRC_URI`` statements found in kernel recipes
|
||||
|
||||
For a typical build, the target of the search is a feature
|
||||
description in an ``.scc`` file whose name follows this format (e.g.
|
||||
``beaglebone-standard.scc`` and ``beaglebone-preempt-rt.scc``):
|
||||
::
|
||||
|
||||
bsp_root_name-kernel_type.scc
|
||||
|
||||
3. *Expand Feature:* Once located, the feature description is either
|
||||
expanded into a simple script of actions, or into an existing
|
||||
equivalent script that is already part of the shipped kernel.
|
||||
|
||||
4. *Append Extra Features:* Extra features are appended to the top-level
|
||||
feature description. These features can come from the
|
||||
:term:`KERNEL_FEATURES`
|
||||
variable in recipes.
|
||||
|
||||
5. *Locate, Expand, and Append Each Feature:* Each extra feature is
|
||||
located, expanded and appended to the script as described in step
|
||||
three.
|
||||
|
||||
6. *Execute the Script:* The script is executed to produce files
|
||||
``.scc`` and ``.cfg`` files in appropriate directories of the
|
||||
``yocto-kernel-cache`` repository. These files are descriptions of
|
||||
all the branches, tags, patches and configurations that need to be
|
||||
applied to the base Git repository to completely create the source
|
||||
(build) branch for the new BSP or feature.
|
||||
|
||||
7. *Clone Base Repository:* The base repository is cloned, and the
|
||||
actions listed in the ``yocto-kernel-cache`` directories are applied
|
||||
to the tree.
|
||||
|
||||
8. *Perform Cleanup:* The Git repositories are left with the desired
|
||||
branches checked out and any required branching, patching and tagging
|
||||
has been performed.
|
||||
|
||||
The kernel tree and cache are ready for developer consumption to be
|
||||
locally cloned, configured, and built into a Yocto Project kernel
|
||||
specific to some target hardware.
|
||||
|
||||
.. note::
|
||||
|
||||
- The generated ``yocto-kernel-cache`` repository adds to the kernel
|
||||
as shipped with the Yocto Project release. Any add-ons and
|
||||
configuration data are applied to the end of an existing branch.
|
||||
The full repository generation that is found in the official Yocto
|
||||
Project kernel repositories at :yocto_git:`/` is the
|
||||
combination of all supported boards and configurations.
|
||||
|
||||
- The technique the Yocto Project team uses is flexible and allows
|
||||
for seamless blending of an immutable history with additional
|
||||
patches specific to a deployment. Any additions to the kernel
|
||||
become an integrated part of the branches.
|
||||
|
||||
- The full kernel tree that you see on :yocto_git:`/` is
|
||||
generated through repeating the above steps for all valid BSPs.
|
||||
The end result is a branched, clean history tree that makes up the
|
||||
kernel for a given release. You can see the script (``kgit-scc``)
|
||||
responsible for this in the
|
||||
:yocto_git:`yocto-kernel-tools </cgit.cgi/yocto-kernel-tools/tree/tools>`
|
||||
repository.
|
||||
|
||||
- The steps used to construct the full kernel tree are the same
|
||||
steps that BitBake uses when it builds a kernel image.
|
||||
|
||||
Build Strategy
|
||||
==============
|
||||
|
||||
Once you have cloned a Yocto Linux kernel repository and the cache
|
||||
repository (``yocto-kernel-cache``) onto your development system, you
|
||||
can consider the compilation phase of kernel development, which is
|
||||
building a kernel image. Some prerequisites exist that are validated by
|
||||
the build process before compilation starts:
|
||||
|
||||
- The :term:`SRC_URI` points to the
|
||||
kernel Git repository.
|
||||
|
||||
- A BSP build branch with Metadata exists in the ``yocto-kernel-cache``
|
||||
repository. The branch is based on the Yocto Linux kernel version and
|
||||
has configurations and features grouped under the
|
||||
``yocto-kernel-cache/bsp`` directory. For example, features and
|
||||
configurations for the BeagleBone Board assuming a
|
||||
``linux-yocto_4.12`` kernel reside in the following area of the
|
||||
``yocto-kernel-cache`` repository: yocto-kernel-cache/bsp/beaglebone
|
||||
|
||||
.. note::
|
||||
|
||||
In the previous example, the "yocto-4.12" branch is checked out in
|
||||
the
|
||||
yocto-kernel-cache
|
||||
repository.
|
||||
|
||||
The OpenEmbedded build system makes sure these conditions exist before
|
||||
attempting compilation. Other means, however, do exist, such as as
|
||||
bootstrapping a BSP.
|
||||
|
||||
Before building a kernel, the build process verifies the tree and
|
||||
configures the kernel by processing all of the configuration "fragments"
|
||||
specified by feature descriptions in the ``.scc`` files. As the features
|
||||
are compiled, associated kernel configuration fragments are noted and
|
||||
recorded in the series of directories in their compilation order. The
|
||||
fragments are migrated, pre-processed and passed to the Linux Kernel
|
||||
Configuration subsystem (``lkc``) as raw input in the form of a
|
||||
``.config`` file. The ``lkc`` uses its own internal dependency
|
||||
constraints to do the final processing of that information and generates
|
||||
the final ``.config`` file that is used during compilation.
|
||||
|
||||
Using the board's architecture and other relevant values from the
|
||||
board's template, kernel compilation is started and a kernel image is
|
||||
produced.
|
||||
|
||||
The other thing that you notice once you configure a kernel is that the
|
||||
build process generates a build tree that is separate from your kernel's
|
||||
local Git source repository tree. This build tree has a name that uses
|
||||
the following form, where ``${MACHINE}`` is the metadata name of the
|
||||
machine (BSP) and "kernel_type" is one of the Yocto Project supported
|
||||
kernel types (e.g. "standard"):
|
||||
::
|
||||
|
||||
linux-${MACHINE}-kernel_type-build
|
||||
|
||||
The existing support in the ``kernel.org`` tree achieves this default
|
||||
functionality.
|
||||
|
||||
This behavior means that all the generated files for a particular
|
||||
machine or BSP are now in the build tree directory. The files include
|
||||
the final ``.config`` file, all the ``.o`` files, the ``.a`` files, and
|
||||
so forth. Since each machine or BSP has its own separate
|
||||
:term:`Build Directory` in its own separate
|
||||
branch of the Git repository, you can easily switch between different
|
||||
builds.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<appendix id='kernel-dev-maint-appx'>
|
||||
<title>Kernel Maintenance</title>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
21
documentation/kernel-dev/kernel-dev.rst
Normal file
21
documentation/kernel-dev/kernel-dev.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
=============================================
|
||||
Yocto Project Linux Kernel Development Manual
|
||||
=============================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
kernel-dev-intro
|
||||
kernel-dev-common
|
||||
kernel-dev-advanced
|
||||
kernel-dev-concepts-appx
|
||||
kernel-dev-maint-appx
|
||||
kernel-dev-faq
|
||||
history
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='kernel-dev' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -102,28 +103,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='mega-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -93,28 +93,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
28
documentation/overview-manual/history.rst
Normal file
28
documentation/overview-manual/history.rst
Normal file
@@ -0,0 +1,28 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************
|
||||
Manual Revision History
|
||||
***********************
|
||||
|
||||
.. list-table::
|
||||
:widths: 10 15 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Revision
|
||||
- Date
|
||||
- Note
|
||||
* - 2.5
|
||||
- May 2018
|
||||
- The initial document released with the Yocto Project 2.5 Release
|
||||
* - 2.6
|
||||
- November 2018
|
||||
- Released with the Yocto Project 2.6 Release.
|
||||
* - 2.7
|
||||
- May 2019
|
||||
- Released with the Yocto Project 2.7 Release.
|
||||
* - 3.0
|
||||
- October 2019
|
||||
- Released with the Yocto Project 3.0 Release.
|
||||
* - 3.1
|
||||
- April 2020
|
||||
- Released with the Yocto Project 3.1 Release.
|
||||
2185
documentation/overview-manual/overview-manual-concepts.rst
Normal file
2185
documentation/overview-manual/overview-manual-concepts.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id=' overview-manual-concepts'>
|
||||
<title>Yocto Project Concepts</title>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
@@ -0,0 +1,672 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*****************************************
|
||||
The Yocto Project Development Environment
|
||||
*****************************************
|
||||
|
||||
This chapter takes a look at the Yocto Project development environment.
|
||||
The chapter provides Yocto Project Development environment concepts that
|
||||
help you understand how work is accomplished in an open source
|
||||
environment, which is very different as compared to work accomplished in
|
||||
a closed, proprietary environment.
|
||||
|
||||
Specifically, this chapter addresses open source philosophy, source
|
||||
repositories, workflows, Git, and licensing.
|
||||
|
||||
Open Source Philosophy
|
||||
======================
|
||||
|
||||
Open source philosophy is characterized by software development directed
|
||||
by peer production and collaboration through an active community of
|
||||
developers. Contrast this to the more standard centralized development
|
||||
models used by commercial software companies where a finite set of
|
||||
developers produces a product for sale using a defined set of procedures
|
||||
that ultimately result in an end product whose architecture and source
|
||||
material are closed to the public.
|
||||
|
||||
Open source projects conceptually have differing concurrent agendas,
|
||||
approaches, and production. These facets of the development process can
|
||||
come from anyone in the public (community) who has a stake in the
|
||||
software project. The open source environment contains new copyright,
|
||||
licensing, domain, and consumer issues that differ from the more
|
||||
traditional development environment. In an open source environment, the
|
||||
end product, source material, and documentation are all available to the
|
||||
public at no cost.
|
||||
|
||||
A benchmark example of an open source project is the Linux kernel, which
|
||||
was initially conceived and created by Finnish computer science student
|
||||
Linus Torvalds in 1991. Conversely, a good example of a non-open source
|
||||
project is the Windows family of operating systems developed by
|
||||
Microsoft Corporation.
|
||||
|
||||
Wikipedia has a good historical description of the Open Source
|
||||
Philosophy `here <http://en.wikipedia.org/wiki/Open_source>`__. You can
|
||||
also find helpful information on how to participate in the Linux
|
||||
Community
|
||||
`here <https://www.kernel.org/doc/html/latest/process/index.html>`__.
|
||||
|
||||
.. _gs-the-development-host:
|
||||
|
||||
The Development Host
|
||||
====================
|
||||
|
||||
A development host or :term:`Build Host` is key to
|
||||
using the Yocto Project. Because the goal of the Yocto Project is to
|
||||
develop images or applications that run on embedded hardware,
|
||||
development of those images and applications generally takes place on a
|
||||
system not intended to run the software - the development host.
|
||||
|
||||
You need to set up a development host in order to use it with the Yocto
|
||||
Project. Most find that it is best to have a native Linux machine
|
||||
function as the development host. However, it is possible to use a
|
||||
system that does not run Linux as its operating system as your
|
||||
development host. When you have a Mac or Windows-based system, you can
|
||||
set it up as the development host by using
|
||||
`CROPS <https://github.com/crops/poky-container>`__, which leverages
|
||||
`Docker Containers <https://www.docker.com/>`__. Once you take the steps
|
||||
to set up a CROPS machine, you effectively have access to a shell
|
||||
environment that is similar to what you see when using a Linux-based
|
||||
development host. For the steps needed to set up a system using CROPS,
|
||||
see the
|
||||
":ref:`dev-manual/dev-manual-start:setting up to use cross platforms (crops)`"
|
||||
section in
|
||||
the Yocto Project Development Tasks Manual.
|
||||
|
||||
If your development host is going to be a system that runs a Linux
|
||||
distribution, steps still exist that you must take to prepare the system
|
||||
for use with the Yocto Project. You need to be sure that the Linux
|
||||
distribution on the system is one that supports the Yocto Project. You
|
||||
also need to be sure that the correct set of host packages are installed
|
||||
that allow development using the Yocto Project. For the steps needed to
|
||||
set up a development host that runs Linux, see the
|
||||
":ref:`dev-manual/dev-manual-start:setting up a native linux host`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Once your development host is set up to use the Yocto Project, several
|
||||
methods exist for you to do work in the Yocto Project environment:
|
||||
|
||||
- *Command Lines, BitBake, and Shells:* Traditional development in the
|
||||
Yocto Project involves using the :term:`OpenEmbedded Build System`,
|
||||
which uses
|
||||
BitBake, in a command-line environment from a shell on your
|
||||
development host. You can accomplish this from a host that is a
|
||||
native Linux machine or from a host that has been set up with CROPS.
|
||||
Either way, you create, modify, and build images and applications all
|
||||
within a shell-based environment using components and tools available
|
||||
through your Linux distribution and the Yocto Project.
|
||||
|
||||
For a general flow of the build procedures, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:building a simple image`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *Board Support Package (BSP) Development:* Development of BSPs
|
||||
involves using the Yocto Project to create and test layers that allow
|
||||
easy development of images and applications targeted for specific
|
||||
hardware. To development BSPs, you need to take some additional steps
|
||||
beyond what was described in setting up a development host.
|
||||
|
||||
The :doc:`../bsp-guide/bsp-guide` provides BSP-related development
|
||||
information. For specifics on development host preparation, see the
|
||||
":ref:`bsp-guide/bsp:preparing your build host to work with bsp layers`"
|
||||
section in the Yocto Project Board Support Package (BSP) Developer's
|
||||
Guide.
|
||||
|
||||
- *Kernel Development:* If you are going to be developing kernels using
|
||||
the Yocto Project you likely will be using ``devtool``. A workflow
|
||||
using ``devtool`` makes kernel development quicker by reducing
|
||||
iteration cycle times.
|
||||
|
||||
The :doc:`../kernel-dev/kernel-dev` provides kernel-related
|
||||
development information. For specifics on development host
|
||||
preparation, see the
|
||||
":ref:`kernel-dev/kernel-dev-common:preparing the build host to work on the kernel`"
|
||||
section in the Yocto Project Linux Kernel Development Manual.
|
||||
|
||||
- *Using Toaster:* The other Yocto Project development method that
|
||||
involves an interface that effectively puts the Yocto Project into
|
||||
the background is Toaster. Toaster provides an interface to the
|
||||
OpenEmbedded build system. The interface enables you to configure and
|
||||
run your builds. Information about builds is collected and stored in
|
||||
a database. You can use Toaster to configure and start builds on
|
||||
multiple remote build servers.
|
||||
|
||||
For steps that show you how to set up your development host to use
|
||||
Toaster and on how to use Toaster in general, see the
|
||||
:doc:`../toaster-manual/toaster-manual`.
|
||||
|
||||
.. _yocto-project-repositories:
|
||||
|
||||
Yocto Project Source Repositories
|
||||
=================================
|
||||
|
||||
The Yocto Project team maintains complete source repositories for all
|
||||
Yocto Project files at :yocto_git:`/`. This web-based source
|
||||
code browser is organized into categories by function such as IDE
|
||||
Plugins, Matchbox, Poky, Yocto Linux Kernel, and so forth. From the
|
||||
interface, you can click on any particular item in the "Name" column and
|
||||
see the URL at the bottom of the page that you need to clone a Git
|
||||
repository for that particular item. Having a local Git repository of
|
||||
the :term:`Source Directory`, which
|
||||
is usually named "poky", allows you to make changes, contribute to the
|
||||
history, and ultimately enhance the Yocto Project's tools, Board Support
|
||||
Packages, and so forth.
|
||||
|
||||
For any supported release of Yocto Project, you can also go to the
|
||||
:yocto_home:`Yocto Project Website <>` and select the "DOWNLOADS"
|
||||
item from the "SOFTWARE" menu and get a released tarball of the ``poky``
|
||||
repository, any supported BSP tarball, or Yocto Project tools. Unpacking
|
||||
these tarballs gives you a snapshot of the released files.
|
||||
|
||||
.. note::
|
||||
|
||||
- The recommended method for setting up the Yocto Project
|
||||
:term:`Source Directory` and the files
|
||||
for supported BSPs (e.g., ``meta-intel``) is to use `Git <#git>`__
|
||||
to create a local copy of the upstream repositories.
|
||||
|
||||
- Be sure to always work in matching branches for both the selected
|
||||
BSP repository and the Source Directory (i.e. ``poky``)
|
||||
repository. For example, if you have checked out the "master"
|
||||
branch of ``poky`` and you are going to use ``meta-intel``, be
|
||||
sure to checkout the "master" branch of ``meta-intel``.
|
||||
|
||||
In summary, here is where you can get the project files needed for
|
||||
development:
|
||||
|
||||
- :yocto_git:`Source Repositories: <>` This area contains IDE
|
||||
Plugins, Matchbox, Poky, Poky Support, Tools, Yocto Linux Kernel, and
|
||||
Yocto Metadata Layers. You can create local copies of Git
|
||||
repositories for each of these areas.
|
||||
|
||||
.. image:: figures/source-repos.png
|
||||
:align: center
|
||||
|
||||
For steps on how to view and access these upstream Git repositories,
|
||||
see the ":ref:`dev-manual/dev-manual-start:accessing source repositories`"
|
||||
Section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- :yocto_dl:`Index of /releases: </releases>` This is an index
|
||||
of releases such as Poky, Pseudo, installers for cross-development
|
||||
toolchains, miscellaneous support and all released versions of Yocto
|
||||
Project in the form of images or tarballs. Downloading and extracting
|
||||
these files does not produce a local copy of the Git repository but
|
||||
rather a snapshot of a particular release or image.
|
||||
|
||||
.. image:: figures/index-downloads.png
|
||||
:align: center
|
||||
|
||||
For steps on how to view and access these files, see the
|
||||
":ref:`dev-manual/dev-manual-start:accessing index of releases`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *"DOWNLOADS" page for the* :yocto_home:`Yocto Project Website <>` *:*
|
||||
|
||||
The Yocto Project website includes a "DOWNLOADS" page accessible
|
||||
through the "SOFTWARE" menu that allows you to download any Yocto
|
||||
Project release, tool, and Board Support Package (BSP) in tarball
|
||||
form. The tarballs are similar to those found in the
|
||||
:yocto_dl:`Index of /releases: </releases>` area.
|
||||
|
||||
.. image:: figures/yp-download.png
|
||||
:align: center
|
||||
|
||||
For steps on how to use the "DOWNLOADS" page, see the
|
||||
":ref:`dev-manual/dev-manual-start:using the downloads page`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
.. _gs-git-workflows-and-the-yocto-project:
|
||||
|
||||
Git Workflows and the Yocto Project
|
||||
===================================
|
||||
|
||||
Developing using the Yocto Project likely requires the use of
|
||||
`Git <#git>`__. Git is a free, open source distributed version control
|
||||
system used as part of many collaborative design environments. This
|
||||
section provides workflow concepts using the Yocto Project and Git. In
|
||||
particular, the information covers basic practices that describe roles
|
||||
and actions in a collaborative development environment.
|
||||
|
||||
.. note::
|
||||
|
||||
If you are familiar with this type of development environment, you
|
||||
might not want to read this section.
|
||||
|
||||
The Yocto Project files are maintained using Git in "branches" whose Git
|
||||
histories track every change and whose structures provide branches for
|
||||
all diverging functionality. Although there is no need to use Git, many
|
||||
open source projects do so.
|
||||
|
||||
For the Yocto Project, a key individual called the "maintainer" is
|
||||
responsible for the integrity of the "master" branch of a given Git
|
||||
repository. The "master" branch is the "upstream" repository from which
|
||||
final or most recent builds of a project occur. The maintainer is
|
||||
responsible for accepting changes from other developers and for
|
||||
organizing the underlying branch structure to reflect release strategies
|
||||
and so forth.
|
||||
|
||||
.. note::
|
||||
|
||||
For information on finding out who is responsible for (maintains) a
|
||||
particular area of code in the Yocto Project, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
|
||||
section of the Yocto Project Development Tasks Manual.
|
||||
|
||||
The Yocto Project ``poky`` Git repository also has an upstream
|
||||
contribution Git repository named ``poky-contrib``. You can see all the
|
||||
branches in this repository using the web interface of the
|
||||
:yocto_git:`Source Repositories <>` organized within the "Poky Support"
|
||||
area. These branches hold changes (commits) to the project that have
|
||||
been submitted or committed by the Yocto Project development team and by
|
||||
community members who contribute to the project. The maintainer
|
||||
determines if the changes are qualified to be moved from the "contrib"
|
||||
branches into the "master" branch of the Git repository.
|
||||
|
||||
Developers (including contributing community members) create and
|
||||
maintain cloned repositories of upstream branches. The cloned
|
||||
repositories are local to their development platforms and are used to
|
||||
develop changes. When a developer is satisfied with a particular feature
|
||||
or change, they "push" the change to the appropriate "contrib"
|
||||
repository.
|
||||
|
||||
Developers are responsible for keeping their local repository up-to-date
|
||||
with whatever upstream branch they are working against. They are also
|
||||
responsible for straightening out any conflicts that might arise within
|
||||
files that are being worked on simultaneously by more than one person.
|
||||
All this work is done locally on the development host before anything is
|
||||
pushed to a "contrib" area and examined at the maintainer's level.
|
||||
|
||||
A somewhat formal method exists by which developers commit changes and
|
||||
push them into the "contrib" area and subsequently request that the
|
||||
maintainer include them into an upstream branch. This process is called
|
||||
"submitting a patch" or "submitting a change." For information on
|
||||
submitting patches and changes, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
In summary, a single point of entry exists for changes into a "master"
|
||||
or development branch of the Git repository, which is controlled by the
|
||||
project's maintainer. And, a set of developers exist who independently
|
||||
develop, test, and submit changes to "contrib" areas for the maintainer
|
||||
to examine. The maintainer then chooses which changes are going to
|
||||
become a permanent part of the project.
|
||||
|
||||
.. image:: figures/git-workflow.png
|
||||
:align: center
|
||||
|
||||
While each development environment is unique, there are some best
|
||||
practices or methods that help development run smoothly. The following
|
||||
list describes some of these practices. For more information about Git
|
||||
workflows, see the workflow topics in the `Git Community
|
||||
Book <http://book.git-scm.com>`__.
|
||||
|
||||
- *Make Small Changes:* It is best to keep the changes you commit small
|
||||
as compared to bundling many disparate changes into a single commit.
|
||||
This practice not only keeps things manageable but also allows the
|
||||
maintainer to more easily include or refuse changes.
|
||||
|
||||
- *Make Complete Changes:* It is also good practice to leave the
|
||||
repository in a state that allows you to still successfully build
|
||||
your project. In other words, do not commit half of a feature, then
|
||||
add the other half as a separate, later commit. Each commit should
|
||||
take you from one buildable project state to another buildable state.
|
||||
|
||||
- *Use Branches Liberally:* It is very easy to create, use, and delete
|
||||
local branches in your working Git repository on the development
|
||||
host. You can name these branches anything you like. It is helpful to
|
||||
give them names associated with the particular feature or change on
|
||||
which you are working. Once you are done with a feature or change and
|
||||
have merged it into your local master branch, simply discard the
|
||||
temporary branch.
|
||||
|
||||
- *Merge Changes:* The ``git merge`` command allows you to take the
|
||||
changes from one branch and fold them into another branch. This
|
||||
process is especially helpful when more than a single developer might
|
||||
be working on different parts of the same feature. Merging changes
|
||||
also automatically identifies any collisions or "conflicts" that
|
||||
might happen as a result of the same lines of code being altered by
|
||||
two different developers.
|
||||
|
||||
- *Manage Branches:* Because branches are easy to use, you should use a
|
||||
system where branches indicate varying levels of code readiness. For
|
||||
example, you can have a "work" branch to develop in, a "test" branch
|
||||
where the code or change is tested, a "stage" branch where changes
|
||||
are ready to be committed, and so forth. As your project develops,
|
||||
you can merge code across the branches to reflect ever-increasing
|
||||
stable states of the development.
|
||||
|
||||
- *Use Push and Pull:* The push-pull workflow is based on the concept
|
||||
of developers "pushing" local commits to a remote repository, which
|
||||
is usually a contribution repository. This workflow is also based on
|
||||
developers "pulling" known states of the project down into their
|
||||
local development repositories. The workflow easily allows you to
|
||||
pull changes submitted by other developers from the upstream
|
||||
repository into your work area ensuring that you have the most recent
|
||||
software on which to develop. The Yocto Project has two scripts named
|
||||
``create-pull-request`` and ``send-pull-request`` that ship with the
|
||||
release to facilitate this workflow. You can find these scripts in
|
||||
the ``scripts`` folder of the
|
||||
:term:`Source Directory`. For information
|
||||
on how to use these scripts, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:using scripts to push a change upstream and request a pull`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *Patch Workflow:* This workflow allows you to notify the maintainer
|
||||
through an email that you have a change (or patch) you would like
|
||||
considered for the "master" branch of the Git repository. To send
|
||||
this type of change, you format the patch and then send the email
|
||||
using the Git commands ``git format-patch`` and ``git send-email``.
|
||||
For information on how to use these scripts, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:submitting a change to the yocto project`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Git
|
||||
===
|
||||
|
||||
The Yocto Project makes extensive use of Git, which is a free, open
|
||||
source distributed version control system. Git supports distributed
|
||||
development, non-linear development, and can handle large projects. It
|
||||
is best that you have some fundamental understanding of how Git tracks
|
||||
projects and how to work with Git if you are going to use the Yocto
|
||||
Project for development. This section provides a quick overview of how
|
||||
Git works and provides you with a summary of some essential Git
|
||||
commands.
|
||||
|
||||
.. note::
|
||||
|
||||
- For more information on Git, see
|
||||
http://git-scm.com/documentation.
|
||||
|
||||
- If you need to download Git, it is recommended that you add Git to
|
||||
your system through your distribution's "software store" (e.g. for
|
||||
Ubuntu, use the Ubuntu Software feature). For the Git download
|
||||
page, see http://git-scm.com/download.
|
||||
|
||||
- For information beyond the introductory nature in this section,
|
||||
see the ":ref:`dev-manual/dev-manual-start:locating yocto project source files`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Repositories, Tags, and Branches
|
||||
--------------------------------
|
||||
|
||||
As mentioned briefly in the previous section and also in the "`Git
|
||||
Workflows and the Yocto
|
||||
Project <#gs-git-workflows-and-the-yocto-project>`__" section, the Yocto
|
||||
Project maintains source repositories at :yocto_git:`/`. If you
|
||||
look at this web-interface of the repositories, each item is a separate
|
||||
Git repository.
|
||||
|
||||
Git repositories use branching techniques that track content change (not
|
||||
files) within a project (e.g. a new feature or updated documentation).
|
||||
Creating a tree-like structure based on project divergence allows for
|
||||
excellent historical information over the life of a project. This
|
||||
methodology also allows for an environment from which you can do lots of
|
||||
local experimentation on projects as you develop changes or new
|
||||
features.
|
||||
|
||||
A Git repository represents all development efforts for a given project.
|
||||
For example, the Git repository ``poky`` contains all changes and
|
||||
developments for that repository over the course of its entire life.
|
||||
That means that all changes that make up all releases are captured. The
|
||||
repository maintains a complete history of changes.
|
||||
|
||||
You can create a local copy of any repository by "cloning" it with the
|
||||
``git clone`` command. When you clone a Git repository, you end up with
|
||||
an identical copy of the repository on your development system. Once you
|
||||
have a local copy of a repository, you can take steps to develop
|
||||
locally. For examples on how to clone Git repositories, see the
|
||||
":ref:`dev-manual/dev-manual-start:locating yocto project source files`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
It is important to understand that Git tracks content change and not
|
||||
files. Git uses "branches" to organize different development efforts.
|
||||
For example, the ``poky`` repository has several branches that include
|
||||
the current "&DISTRO_NAME_NO_CAP;" branch, the "master" branch, and many
|
||||
branches for past Yocto Project releases. You can see all the branches
|
||||
by going to https://git.yoctoproject.org/cgit.cgi/poky/ and clicking on the
|
||||
``[...]`` link beneath the "Branch" heading.
|
||||
|
||||
Each of these branches represents a specific area of development. The
|
||||
"master" branch represents the current or most recent development. All
|
||||
other branches represent offshoots of the "master" branch.
|
||||
|
||||
When you create a local copy of a Git repository, the copy has the same
|
||||
set of branches as the original. This means you can use Git to create a
|
||||
local working area (also called a branch) that tracks a specific
|
||||
development branch from the upstream source Git repository. in other
|
||||
words, you can define your local Git environment to work on any
|
||||
development branch in the repository. To help illustrate, consider the
|
||||
following example Git commands:
|
||||
::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
$ cd poky
|
||||
$ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
|
||||
|
||||
In the previous example
|
||||
after moving to the home directory, the ``git clone`` command creates a
|
||||
local copy of the upstream ``poky`` Git repository. By default, Git
|
||||
checks out the "master" branch for your work. After changing the working
|
||||
directory to the new local repository (i.e. ``poky``), the
|
||||
``git checkout`` command creates and checks out a local branch named
|
||||
"&DISTRO_NAME_NO_CAP;", which tracks the upstream
|
||||
"origin/&DISTRO_NAME_NO_CAP;" branch. Changes you make while in this
|
||||
branch would ultimately affect the upstream "&DISTRO_NAME_NO_CAP;" branch
|
||||
of the ``poky`` repository.
|
||||
|
||||
It is important to understand that when you create and checkout a local
|
||||
working branch based on a branch name, your local environment matches
|
||||
the "tip" of that particular development branch at the time you created
|
||||
your local branch, which could be different from the files in the
|
||||
"master" branch of the upstream repository. In other words, creating and
|
||||
checking out a local branch based on the "&DISTRO_NAME_NO_CAP;" branch
|
||||
name is not the same as checking out the "master" branch in the
|
||||
repository. Keep reading to see how you create a local snapshot of a
|
||||
Yocto Project Release.
|
||||
|
||||
Git uses "tags" to mark specific changes in a repository branch
|
||||
structure. Typically, a tag is used to mark a special point such as the
|
||||
final change (or commit) before a project is released. You can see the
|
||||
tags used with the ``poky`` Git repository by going to
|
||||
https://git.yoctoproject.org/cgit.cgi/poky/ and clicking on the ``[...]`` link
|
||||
beneath the "Tag" heading.
|
||||
|
||||
Some key tags for the ``poky`` repository are ``jethro-14.0.3``,
|
||||
``morty-16.0.1``, ``pyro-17.0.0``, and
|
||||
``&DISTRO_NAME_NO_CAP;-&POKYVERSION;``. These tags represent Yocto Project
|
||||
releases.
|
||||
|
||||
When you create a local copy of the Git repository, you also have access
|
||||
to all the tags in the upstream repository. Similar to branches, you can
|
||||
create and checkout a local working Git branch based on a tag name. When
|
||||
you do this, you get a snapshot of the Git repository that reflects the
|
||||
state of the files when the change was made associated with that tag.
|
||||
The most common use is to checkout a working branch that matches a
|
||||
specific Yocto Project release. Here is an example:
|
||||
::
|
||||
|
||||
$ cd ~
|
||||
$ git clone git://git.yoctoproject.org/poky
|
||||
$ cd poky
|
||||
$ git fetch --tags
|
||||
$ git checkout tags/rocko-18.0.0 -b my_rocko-18.0.0
|
||||
|
||||
In this example, the name
|
||||
of the top-level directory of your local Yocto Project repository is
|
||||
``poky``. After moving to the ``poky`` directory, the ``git fetch``
|
||||
command makes all the upstream tags available locally in your
|
||||
repository. Finally, the ``git checkout`` command creates and checks out
|
||||
a branch named "my-rocko-18.0.0" that is based on the upstream branch
|
||||
whose "HEAD" matches the commit in the repository associated with the
|
||||
"rocko-18.0.0" tag. The files in your repository now exactly match that
|
||||
particular Yocto Project release as it is tagged in the upstream Git
|
||||
repository. It is important to understand that when you create and
|
||||
checkout a local working branch based on a tag, your environment matches
|
||||
a specific point in time and not the entire development branch (i.e.
|
||||
from the "tip" of the branch backwards).
|
||||
|
||||
Basic Commands
|
||||
--------------
|
||||
|
||||
Git has an extensive set of commands that lets you manage changes and
|
||||
perform collaboration over the life of a project. Conveniently though,
|
||||
you can manage with a small set of basic operations and workflows once
|
||||
you understand the basic philosophy behind Git. You do not have to be an
|
||||
expert in Git to be functional. A good place to look for instruction on
|
||||
a minimal set of Git commands is
|
||||
`here <http://git-scm.com/documentation>`__.
|
||||
|
||||
The following list of Git commands briefly describes some basic Git
|
||||
operations as a way to get started. As with any set of commands, this
|
||||
list (in most cases) simply shows the base command and omits the many
|
||||
arguments it supports. See the Git documentation for complete
|
||||
descriptions and strategies on how to use these commands:
|
||||
|
||||
- *git init:* Initializes an empty Git repository. You cannot use
|
||||
Git commands unless you have a ``.git`` repository.
|
||||
|
||||
- *git clone:* Creates a local clone of a Git repository that is on
|
||||
equal footing with a fellow developer's Git repository or an upstream
|
||||
repository.
|
||||
|
||||
- *git add:* Locally stages updated file contents to the index that
|
||||
Git uses to track changes. You must stage all files that have changed
|
||||
before you can commit them.
|
||||
|
||||
- *git commit:* Creates a local "commit" that documents the changes
|
||||
you made. Only changes that have been staged can be committed.
|
||||
Commits are used for historical purposes, for determining if a
|
||||
maintainer of a project will allow the change, and for ultimately
|
||||
pushing the change from your local Git repository into the project's
|
||||
upstream repository.
|
||||
|
||||
- *git status:* Reports any modified files that possibly need to be
|
||||
staged and gives you a status of where you stand regarding local
|
||||
commits as compared to the upstream repository.
|
||||
|
||||
- *git checkout branch-name:* Changes your local working branch and
|
||||
in this form assumes the local branch already exists. This command is
|
||||
analogous to "cd".
|
||||
|
||||
- *git checkout –b working-branch upstream-branch:* Creates and
|
||||
checks out a working branch on your local machine. The local branch
|
||||
tracks the upstream branch. You can use your local branch to isolate
|
||||
your work. It is a good idea to use local branches when adding
|
||||
specific features or changes. Using isolated branches facilitates
|
||||
easy removal of changes if they do not work out.
|
||||
|
||||
- *git branch:* Displays the existing local branches associated
|
||||
with your local repository. The branch that you have currently
|
||||
checked out is noted with an asterisk character.
|
||||
|
||||
- *git branch -D branch-name:* Deletes an existing local branch.
|
||||
You need to be in a local branch other than the one you are deleting
|
||||
in order to delete branch-name.
|
||||
|
||||
- *git pull --rebase:* Retrieves information from an upstream Git
|
||||
repository and places it in your local Git repository. You use this
|
||||
command to make sure you are synchronized with the repository from
|
||||
which you are basing changes (.e.g. the "master" branch). The
|
||||
"--rebase" option ensures that any local commits you have in your
|
||||
branch are preserved at the top of your local branch.
|
||||
|
||||
- *git push repo-name local-branch:upstream-branch:* Sends
|
||||
all your committed local changes to the upstream Git repository that
|
||||
your local repository is tracking (e.g. a contribution repository).
|
||||
The maintainer of the project draws from these repositories to merge
|
||||
changes (commits) into the appropriate branch of project's upstream
|
||||
repository.
|
||||
|
||||
- *git merge:* Combines or adds changes from one local branch of
|
||||
your repository with another branch. When you create a local Git
|
||||
repository, the default branch is named "master". A typical workflow
|
||||
is to create a temporary branch that is based off "master" that you
|
||||
would use for isolated work. You would make your changes in that
|
||||
isolated branch, stage and commit them locally, switch to the
|
||||
"master" branch, and then use the ``git merge`` command to apply the
|
||||
changes from your isolated branch into the currently checked out
|
||||
branch (e.g. "master"). After the merge is complete and if you are
|
||||
done with working in that isolated branch, you can safely delete the
|
||||
isolated branch.
|
||||
|
||||
- *git cherry-pick commits:* Choose and apply specific commits from
|
||||
one branch into another branch. There are times when you might not be
|
||||
able to merge all the changes in one branch with another but need to
|
||||
pick out certain ones.
|
||||
|
||||
- *gitk:* Provides a GUI view of the branches and changes in your
|
||||
local Git repository. This command is a good way to graphically see
|
||||
where things have diverged in your local repository.
|
||||
|
||||
.. note::
|
||||
|
||||
You need to install the
|
||||
gitk
|
||||
package on your development system to use this command.
|
||||
|
||||
- *git log:* Reports a history of your commits to the repository.
|
||||
This report lists all commits regardless of whether you have pushed
|
||||
them upstream or not.
|
||||
|
||||
- *git diff:* Displays line-by-line differences between a local
|
||||
working file and the same file as understood by Git. This command is
|
||||
useful to see what you have changed in any given file.
|
||||
|
||||
Licensing
|
||||
=========
|
||||
|
||||
Because open source projects are open to the public, they have different
|
||||
licensing structures in place. License evolution for both Open Source
|
||||
and Free Software has an interesting history. If you are interested in
|
||||
this history, you can find basic information here:
|
||||
|
||||
- `Open source license
|
||||
history <http://en.wikipedia.org/wiki/Open-source_license>`__
|
||||
|
||||
- `Free software license
|
||||
history <http://en.wikipedia.org/wiki/Free_software_license>`__
|
||||
|
||||
In general, the Yocto Project is broadly licensed under the
|
||||
Massachusetts Institute of Technology (MIT) License. MIT licensing
|
||||
permits the reuse of software within proprietary software as long as the
|
||||
license is distributed with that software. MIT is also compatible with
|
||||
the GNU General Public License (GPL). Patches to the Yocto Project
|
||||
follow the upstream licensing scheme. You can find information on the
|
||||
MIT license
|
||||
`here <http://www.opensource.org/licenses/mit-license.php>`__. You can
|
||||
find information on the GNU GPL
|
||||
`here <http://www.opensource.org/licenses/LGPL-3.0>`__.
|
||||
|
||||
When you build an image using the Yocto Project, the build process uses
|
||||
a known list of licenses to ensure compliance. You can find this list in
|
||||
the :term:`Source Directory` at
|
||||
``meta/files/common-licenses``. Once the build completes, the list of
|
||||
all licenses found and used during that build are kept in the
|
||||
:term:`Build Directory` at
|
||||
``tmp/deploy/licenses``.
|
||||
|
||||
If a module requires a license that is not in the base list, the build
|
||||
process generates a warning during the build. These tools make it easier
|
||||
for a developer to be certain of the licenses with which their shipped
|
||||
products must comply. However, even with these tools it is still up to
|
||||
the developer to resolve potential licensing issues.
|
||||
|
||||
The base list of licenses used by the build process is a combination of
|
||||
the Software Package Data Exchange (SPDX) list and the Open Source
|
||||
Initiative (OSI) projects. `SPDX Group <http://spdx.org>`__ is a working
|
||||
group of the Linux Foundation that maintains a specification for a
|
||||
standard format for communicating the components, licenses, and
|
||||
copyrights associated with a software package.
|
||||
`OSI <http://opensource.org>`__ is a corporation dedicated to the Open
|
||||
Source Definition and the effort for reviewing and approving licenses
|
||||
that conform to the Open Source Definition (OSD).
|
||||
|
||||
You can find a list of the combined SPDX and OSI licenses that the Yocto
|
||||
Project uses in the ``meta/files/common-licenses`` directory in your
|
||||
:term:`Source Directory`.
|
||||
|
||||
For information that can help you maintain compliance with various open
|
||||
source licensing during the lifecycle of a product created using the
|
||||
Yocto Project, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:maintaining open source license compliance during your product's lifecycle`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='overview-development-environment'>
|
||||
<title>The Yocto Project Development Environment</title>
|
||||
@@ -326,7 +327,7 @@
|
||||
For the Yocto Project, a key individual called the "maintainer" is
|
||||
responsible for the integrity of the "master" branch of a given Git
|
||||
repository.
|
||||
The "master" branch is the “upstream” repository from which final or
|
||||
The "master" branch is the "upstream" repository from which final or
|
||||
most recent builds of a project occur.
|
||||
The maintainer is responsible for accepting changes from other
|
||||
developers and for organizing the underlying branch structure to
|
||||
@@ -371,7 +372,7 @@
|
||||
might arise within files that are being worked on simultaneously by
|
||||
more than one person.
|
||||
All this work is done locally on the development host before
|
||||
anything is pushed to a "contrib" area and examined at the maintainer’s
|
||||
anything is pushed to a "contrib" area and examined at the maintainer's
|
||||
level.
|
||||
</para>
|
||||
|
||||
@@ -379,7 +380,7 @@
|
||||
A somewhat formal method exists by which developers commit changes
|
||||
and push them into the "contrib" area and subsequently request that
|
||||
the maintainer include them into an upstream branch.
|
||||
This process is called “submitting a patch” or "submitting a change."
|
||||
This process is called "submitting a patch" or "submitting a change."
|
||||
For information on submitting patches and changes, see the
|
||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
@@ -388,7 +389,7 @@
|
||||
<para>
|
||||
In summary, a single point of entry
|
||||
exists for changes into a "master" or development branch of the
|
||||
Git repository, which is controlled by the project’s maintainer.
|
||||
Git repository, which is controlled by the project's maintainer.
|
||||
And, a set of developers exist who independently develop, test, and
|
||||
submit changes to "contrib" areas for the maintainer to examine.
|
||||
The maintainer then chooses which changes are going to become a
|
||||
@@ -733,7 +734,7 @@
|
||||
<listitem><para id='git-commands-clone'>
|
||||
<emphasis><filename>git clone</filename>:</emphasis>
|
||||
Creates a local clone of a Git repository that is on
|
||||
equal footing with a fellow developer’s Git repository
|
||||
equal footing with a fellow developer's Git repository
|
||||
or an upstream repository.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
@@ -751,7 +752,7 @@
|
||||
Commits are used for historical purposes, for determining
|
||||
if a maintainer of a project will allow the change,
|
||||
and for ultimately pushing the change from your local
|
||||
Git repository into the project’s upstream repository.
|
||||
Git repository into the project's upstream repository.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<emphasis><filename>git status</filename>:</emphasis>
|
||||
|
||||
74
documentation/overview-manual/overview-manual-intro.rst
Normal file
74
documentation/overview-manual/overview-manual-intro.rst
Normal file
@@ -0,0 +1,74 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
**********************************************
|
||||
The Yocto Project Overview and Concepts Manual
|
||||
**********************************************
|
||||
|
||||
.. _overview-manual-welcome:
|
||||
|
||||
Welcome
|
||||
=======
|
||||
|
||||
Welcome to the Yocto Project Overview and Concepts Manual! This manual
|
||||
introduces the Yocto Project by providing concepts, software overviews,
|
||||
best-known-methods (BKMs), and any other high-level introductory
|
||||
information suitable for a new Yocto Project user.
|
||||
|
||||
The following list describes what you can get from this manual:
|
||||
|
||||
- `Introducing the Yocto Project <#overview-yp>`__\ *:* This chapter
|
||||
provides an introduction to the Yocto Project. You will learn about
|
||||
features and challenges of the Yocto Project, the layer model,
|
||||
components and tools, development methods, the
|
||||
:term:`Poky` reference distribution, the
|
||||
OpenEmbedded build system workflow, and some basic Yocto terms.
|
||||
|
||||
- `The Yocto Project Development
|
||||
Environment <#overview-development-environment>`__\ *:* This chapter
|
||||
helps you get started understanding the Yocto Project development
|
||||
environment. You will learn about open source, development hosts,
|
||||
Yocto Project source repositories, workflows using Git and the Yocto
|
||||
Project, a Git primer, and information about licensing.
|
||||
|
||||
- :doc:`overview-manual-concepts` *:* This
|
||||
chapter presents various concepts regarding the Yocto Project. You
|
||||
can find conceptual information about components, development,
|
||||
cross-toolchains, and so forth.
|
||||
|
||||
This manual does not give you the following:
|
||||
|
||||
- *Step-by-step Instructions for Development Tasks:* Instructional
|
||||
procedures reside in other manuals within the Yocto Project
|
||||
documentation set. For example, the :doc:`../dev-manual/dev-manual`
|
||||
provides examples on how to perform
|
||||
various development tasks. As another example, the
|
||||
:doc:`../sdk-manual/sdk-manual` manual contains detailed
|
||||
instructions on how to install an SDK, which is used to develop
|
||||
applications for target hardware.
|
||||
|
||||
- *Reference Material:* This type of material resides in an appropriate
|
||||
reference manual. For example, system variables are documented in the
|
||||
:doc:`../ref-manual/ref-manual`. As another
|
||||
example, the :doc:`../bsp-guide/bsp-guide` contains reference information on
|
||||
BSPs.
|
||||
|
||||
- *Detailed Public Information Not Specific to the Yocto Project:* For
|
||||
example, exhaustive information on how to use the Source Control
|
||||
Manager Git is better covered with Internet searches and official Git
|
||||
Documentation than through the Yocto Project documentation.
|
||||
|
||||
.. _overview-manual-other-information:
|
||||
|
||||
Other Information
|
||||
=================
|
||||
|
||||
Because this manual presents information for many different topics,
|
||||
supplemental information is recommended for full comprehension. For
|
||||
additional introductory information on the Yocto Project, see the
|
||||
:yocto_home:`Yocto Project Website <>`. If you want to build an image
|
||||
with no knowledge of Yocto Project as a way of quickly testing it out,
|
||||
see the :doc:`../brief-yoctoprojectqs/brief-yoctoprojectqs` document.
|
||||
For a comprehensive list of links and other documentation, see the
|
||||
":ref:`Links and Related
|
||||
Documentation <resources-links-and-related-documentation>`"
|
||||
section in the Yocto Project Reference Manual.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='overview-manual-intro'>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
941
documentation/overview-manual/overview-manual-yp-intro.rst
Normal file
941
documentation/overview-manual/overview-manual-yp-intro.rst
Normal file
@@ -0,0 +1,941 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*****************************
|
||||
Introducing the Yocto Project
|
||||
*****************************
|
||||
|
||||
What is the Yocto Project?
|
||||
==========================
|
||||
|
||||
The Yocto Project is an open source collaboration project that helps
|
||||
developers create custom Linux-based systems that are designed for
|
||||
embedded products regardless of the product's hardware architecture.
|
||||
Yocto Project provides a flexible toolset and a development environment
|
||||
that allows embedded device developers across the world to collaborate
|
||||
through shared technologies, software stacks, configurations, and best
|
||||
practices used to create these tailored Linux images.
|
||||
|
||||
Thousands of developers worldwide have discovered that Yocto Project
|
||||
provides advantages in both systems and applications development,
|
||||
archival and management benefits, and customizations used for speed,
|
||||
footprint, and memory utilization. The project is a standard when it
|
||||
comes to delivering embedded software stacks. The project allows
|
||||
software customizations and build interchange for multiple hardware
|
||||
platforms as well as software stacks that can be maintained and scaled.
|
||||
|
||||
.. image:: figures/key-dev-elements.png
|
||||
:align: center
|
||||
|
||||
For further introductory information on the Yocto Project, you might be
|
||||
interested in this
|
||||
`article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__
|
||||
by Drew Moseley and in this short introductory
|
||||
`video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__.
|
||||
|
||||
The remainder of this section overviews advantages and challenges tied
|
||||
to the Yocto Project.
|
||||
|
||||
.. _gs-features:
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
The following list describes features and advantages of the Yocto
|
||||
Project:
|
||||
|
||||
- *Widely Adopted Across the Industry:* Semiconductor, operating
|
||||
system, software, and service vendors exist whose products and
|
||||
services adopt and support the Yocto Project. For a look at the Yocto
|
||||
Project community and the companies involved with the Yocto Project,
|
||||
see the "COMMUNITY" and "ECOSYSTEM" tabs on the
|
||||
:yocto_home:`Yocto Project <>` home page.
|
||||
|
||||
- *Architecture Agnostic:* Yocto Project supports Intel, ARM, MIPS,
|
||||
AMD, PPC and other architectures. Most ODMs, OSVs, and chip vendors
|
||||
create and supply BSPs that support their hardware. If you have
|
||||
custom silicon, you can create a BSP that supports that architecture.
|
||||
|
||||
Aside from lots of architecture support, the Yocto Project fully
|
||||
supports a wide range of device emulation through the Quick EMUlator
|
||||
(QEMU).
|
||||
|
||||
- *Images and Code Transfer Easily:* Yocto Project output can easily
|
||||
move between architectures without moving to new development
|
||||
environments. Additionally, if you have used the Yocto Project to
|
||||
create an image or application and you find yourself not able to
|
||||
support it, commercial Linux vendors such as Wind River, Mentor
|
||||
Graphics, Timesys, and ENEA could take it and provide ongoing
|
||||
support. These vendors have offerings that are built using the Yocto
|
||||
Project.
|
||||
|
||||
- *Flexibility:* Corporations use the Yocto Project many different
|
||||
ways. One example is to create an internal Linux distribution as a
|
||||
code base the corporation can use across multiple product groups.
|
||||
Through customization and layering, a project group can leverage the
|
||||
base Linux distribution to create a distribution that works for their
|
||||
product needs.
|
||||
|
||||
- *Ideal for Constrained Embedded and IoT devices:* Unlike a full Linux
|
||||
distribution, you can use the Yocto Project to create exactly what
|
||||
you need for embedded devices. You only add the feature support or
|
||||
packages that you absolutely need for the device. For devices that
|
||||
have display hardware, you can use available system components such
|
||||
as X11, GTK+, Qt, Clutter, and SDL (among others) to create a rich
|
||||
user experience. For devices that do not have a display or where you
|
||||
want to use alternative UI frameworks, you can choose to not install
|
||||
these components.
|
||||
|
||||
- *Comprehensive Toolchain Capabilities:* Toolchains for supported
|
||||
architectures satisfy most use cases. However, if your hardware
|
||||
supports features that are not part of a standard toolchain, you can
|
||||
easily customize that toolchain through specification of
|
||||
platform-specific tuning parameters. And, should you need to use a
|
||||
third-party toolchain, mechanisms built into the Yocto Project allow
|
||||
for that.
|
||||
|
||||
- *Mechanism Rules Over Policy:* Focusing on mechanism rather than
|
||||
policy ensures that you are free to set policies based on the needs
|
||||
of your design instead of adopting decisions enforced by some system
|
||||
software provider.
|
||||
|
||||
- *Uses a Layer Model:* The Yocto Project `layer
|
||||
infrastructure <#the-yocto-project-layer-model>`__ groups related
|
||||
functionality into separate bundles. You can incrementally add these
|
||||
grouped functionalities to your project as needed. Using layers to
|
||||
isolate and group functionality reduces project complexity and
|
||||
redundancy, allows you to easily extend the system, make
|
||||
customizations, and keep functionality organized.
|
||||
|
||||
- *Supports Partial Builds:* You can build and rebuild individual
|
||||
packages as needed. Yocto Project accomplishes this through its
|
||||
`shared-state cache <#shared-state-cache>`__ (sstate) scheme. Being
|
||||
able to build and debug components individually eases project
|
||||
development.
|
||||
|
||||
- *Releases According to a Strict Schedule:* Major releases occur on a
|
||||
:doc:`six-month cycle <../ref-manual/ref-release-process>`
|
||||
predictably in October and April. The most recent two releases
|
||||
support point releases to address common vulnerabilities and
|
||||
exposures. This predictability is crucial for projects based on the
|
||||
Yocto Project and allows development teams to plan activities.
|
||||
|
||||
- *Rich Ecosystem of Individuals and Organizations:* For open source
|
||||
projects, the value of community is very important. Support forums,
|
||||
expertise, and active developers who continue to push the Yocto
|
||||
Project forward are readily available.
|
||||
|
||||
- *Binary Reproducibility:* The Yocto Project allows you to be very
|
||||
specific about dependencies and achieves very high percentages of
|
||||
binary reproducibility (e.g. 99.8% for ``core-image-minimal``). When
|
||||
distributions are not specific about which packages are pulled in and
|
||||
in what order to support dependencies, other build systems can
|
||||
arbitrarily include packages.
|
||||
|
||||
- *License Manifest:* The Yocto Project provides a :ref:`license
|
||||
manifest <dev-manual/dev-manual-common-tasks:maintaining open source license compliance during your product's lifecycle>`
|
||||
for review by people who need to track the use of open source
|
||||
licenses (e.g. legal teams).
|
||||
|
||||
.. _gs-challenges:
|
||||
|
||||
Challenges
|
||||
----------
|
||||
|
||||
The following list presents challenges you might encounter when
|
||||
developing using the Yocto Project:
|
||||
|
||||
- *Steep Learning Curve:* The Yocto Project has a steep learning curve
|
||||
and has many different ways to accomplish similar tasks. It can be
|
||||
difficult to choose how to proceed when varying methods exist by
|
||||
which to accomplish a given task.
|
||||
|
||||
- *Understanding What Changes You Need to Make For Your Design Requires
|
||||
Some Research:* Beyond the simple tutorial stage, understanding what
|
||||
changes need to be made for your particular design can require a
|
||||
significant amount of research and investigation. For information
|
||||
that helps you transition from trying out the Yocto Project to using
|
||||
it for your project, see the ":ref:`what-i-wish-id-known:what i wish i'd known about yocto project`" and
|
||||
":ref:`transitioning-to-a-custom-environment:transitioning to a custom environment for systems development`"
|
||||
documents on the Yocto Project website.
|
||||
|
||||
- *Project Workflow Could Be Confusing:* The `Yocto Project
|
||||
workflow <#overview-development-environment>`__ could be confusing if
|
||||
you are used to traditional desktop and server software development.
|
||||
In a desktop development environment, mechanisms exist to easily pull
|
||||
and install new packages, which are typically pre-compiled binaries
|
||||
from servers accessible over the Internet. Using the Yocto Project,
|
||||
you must modify your configuration and rebuild to add additional
|
||||
packages.
|
||||
|
||||
- *Working in a Cross-Build Environment Can Feel Unfamiliar:* When
|
||||
developing code to run on a target, compilation, execution, and
|
||||
testing done on the actual target can be faster than running a
|
||||
BitBake build on a development host and then deploying binaries to
|
||||
the target for test. While the Yocto Project does support development
|
||||
tools on the target, the additional step of integrating your changes
|
||||
back into the Yocto Project build environment would be required.
|
||||
Yocto Project supports an intermediate approach that involves making
|
||||
changes on the development system within the BitBake environment and
|
||||
then deploying only the updated packages to the target.
|
||||
|
||||
The Yocto Project :term:`OpenEmbedded Build System`
|
||||
produces packages
|
||||
in standard formats (i.e. RPM, DEB, IPK, and TAR). You can deploy
|
||||
these packages into the running system on the target by using
|
||||
utilities on the target such as ``rpm`` or ``ipk``.
|
||||
|
||||
- *Initial Build Times Can be Significant:* Long initial build times
|
||||
are unfortunately unavoidable due to the large number of packages
|
||||
initially built from scratch for a fully functioning Linux system.
|
||||
Once that initial build is completed, however, the shared-state
|
||||
(sstate) cache mechanism Yocto Project uses keeps the system from
|
||||
rebuilding packages that have not been "touched" since the last
|
||||
build. The sstate mechanism significantly reduces times for
|
||||
successive builds.
|
||||
|
||||
The Yocto Project Layer Model
|
||||
=============================
|
||||
|
||||
The Yocto Project's "Layer Model" is a development model for embedded
|
||||
and IoT Linux creation that distinguishes the Yocto Project from other
|
||||
simple build systems. The Layer Model simultaneously supports
|
||||
collaboration and customization. Layers are repositories that contain
|
||||
related sets of instructions that tell the :term:`OpenEmbedded Build System`
|
||||
what to do. You can
|
||||
collaborate, share, and reuse layers.
|
||||
|
||||
Layers can contain changes to previous instructions or settings at any
|
||||
time. This powerful override capability is what allows you to customize
|
||||
previously supplied collaborative or community layers to suit your
|
||||
product requirements.
|
||||
|
||||
You use different layers to logically separate information in your
|
||||
build. As an example, you could have BSP, GUI, distro configuration,
|
||||
middleware, or application layers. Putting your entire build into one
|
||||
layer limits and complicates future customization and reuse. Isolating
|
||||
information into layers, on the other hand, helps simplify future
|
||||
customizations and reuse. You might find it tempting to keep everything
|
||||
in one layer when working on a single project. However, the more modular
|
||||
your Metadata, the easier it is to cope with future changes.
|
||||
|
||||
.. note::
|
||||
|
||||
- Use Board Support Package (BSP) layers from silicon vendors when
|
||||
possible.
|
||||
|
||||
- Familiarize yourself with the `Yocto Project curated layer
|
||||
index <https://www.yoctoproject.org/software-overview/layers/>`__
|
||||
or the `OpenEmbedded layer
|
||||
index <http://layers.openembedded.org/layerindex/branch/master/layers/>`__.
|
||||
The latter contains more layers but they are less universally
|
||||
validated.
|
||||
|
||||
- Layers support the inclusion of technologies, hardware components,
|
||||
and software components. The :ref:`Yocto Project
|
||||
Compatible <dev-manual/dev-manual-common-tasks:making sure your layer is compatible with yocto project>`
|
||||
designation provides a minimum level of standardization that
|
||||
contributes to a strong ecosystem. "YP Compatible" is applied to
|
||||
appropriate products and software components such as BSPs, other
|
||||
OE-compatible layers, and related open-source projects, allowing
|
||||
the producer to use Yocto Project badges and branding assets.
|
||||
|
||||
To illustrate how layers are used to keep things modular, consider
|
||||
machine customizations. These types of customizations typically reside
|
||||
in a special layer, rather than a general layer, called a BSP Layer.
|
||||
Furthermore, the machine customizations should be isolated from recipes
|
||||
and Metadata that support a new GUI environment, for example. This
|
||||
situation gives you a couple of layers: one for the machine
|
||||
configurations, and one for the GUI environment. It is important to
|
||||
understand, however, that the BSP layer can still make machine-specific
|
||||
additions to recipes within the GUI environment layer without polluting
|
||||
the GUI layer itself with those machine-specific changes. You can
|
||||
accomplish this through a recipe that is a BitBake append
|
||||
(``.bbappend``) file, which is described later in this section.
|
||||
|
||||
.. note::
|
||||
|
||||
For general information on BSP layer structure, see the
|
||||
:doc:`../bsp-guide/bsp-guide`
|
||||
.
|
||||
|
||||
The :term:`Source Directory`
|
||||
contains both general layers and BSP layers right out of the box. You
|
||||
can easily identify layers that ship with a Yocto Project release in the
|
||||
Source Directory by their names. Layers typically have names that begin
|
||||
with the string ``meta-``.
|
||||
|
||||
.. note::
|
||||
|
||||
It is not a requirement that a layer name begin with the prefix
|
||||
meta-
|
||||
, but it is a commonly accepted standard in the Yocto Project
|
||||
community.
|
||||
|
||||
For example, if you were to examine the `tree
|
||||
view <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/>`__ of the
|
||||
``poky`` repository, you will see several layers: ``meta``,
|
||||
``meta-skeleton``, ``meta-selftest``, ``meta-poky``, and
|
||||
``meta-yocto-bsp``. Each of these repositories represents a distinct
|
||||
layer.
|
||||
|
||||
For procedures on how to create layers, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
Components and Tools
|
||||
====================
|
||||
|
||||
The Yocto Project employs a collection of components and tools used by
|
||||
the project itself, by project developers, and by those using the Yocto
|
||||
Project. These components and tools are open source projects and
|
||||
metadata that are separate from the reference distribution
|
||||
(:term:`Poky`) and the
|
||||
:term:`OpenEmbedded Build System`. Most of the
|
||||
components and tools are downloaded separately.
|
||||
|
||||
This section provides brief overviews of the components and tools
|
||||
associated with the Yocto Project.
|
||||
|
||||
.. _gs-development-tools:
|
||||
|
||||
Development Tools
|
||||
-----------------
|
||||
|
||||
The following list consists of tools that help you develop images and
|
||||
applications using the Yocto Project:
|
||||
|
||||
- *CROPS:* `CROPS <https://github.com/crops/poky-container/>`__ is an
|
||||
open source, cross-platform development framework that leverages
|
||||
`Docker Containers <https://www.docker.com/>`__. CROPS provides an
|
||||
easily managed, extensible environment that allows you to build
|
||||
binaries for a variety of architectures on Windows, Linux and Mac OS
|
||||
X hosts.
|
||||
|
||||
- *devtool:* This command-line tool is available as part of the
|
||||
extensible SDK (eSDK) and is its cornerstone. You can use ``devtool``
|
||||
to help build, test, and package software within the eSDK. You can
|
||||
use the tool to optionally integrate what you build into an image
|
||||
built by the OpenEmbedded build system.
|
||||
|
||||
The ``devtool`` command employs a number of sub-commands that allow
|
||||
you to add, modify, and upgrade recipes. As with the OpenEmbedded
|
||||
build system, "recipes" represent software packages within
|
||||
``devtool``. When you use ``devtool add``, a recipe is automatically
|
||||
created. When you use ``devtool modify``, the specified existing
|
||||
recipe is used in order to determine where to get the source code and
|
||||
how to patch it. In both cases, an environment is set up so that when
|
||||
you build the recipe a source tree that is under your control is used
|
||||
in order to allow you to make changes to the source as desired. By
|
||||
default, both new recipes and the source go into a "workspace"
|
||||
directory under the eSDK. The ``devtool upgrade`` command updates an
|
||||
existing recipe so that you can build it for an updated set of source
|
||||
files.
|
||||
|
||||
You can read about the ``devtool`` workflow in the Yocto Project
|
||||
Application Development and Extensible Software Development Kit
|
||||
(eSDK) Manual in the
|
||||
":ref:`sdk-manual/sdk-extensible:using \`\`devtool\`\` in your sdk workflow`"
|
||||
section.
|
||||
|
||||
- *Extensible Software Development Kit (eSDK):* The eSDK provides a
|
||||
cross-development toolchain and libraries tailored to the contents of
|
||||
a specific image. The eSDK makes it easy to add new applications and
|
||||
libraries to an image, modify the source for an existing component,
|
||||
test changes on the target hardware, and integrate into the rest of
|
||||
the OpenEmbedded build system. The eSDK gives you a toolchain
|
||||
experience supplemented with the powerful set of ``devtool`` commands
|
||||
tailored for the Yocto Project environment.
|
||||
|
||||
For information on the eSDK, see the :doc:`../sdk-manual/sdk-manual` Manual.
|
||||
|
||||
- *Toaster:* Toaster is a web interface to the Yocto Project
|
||||
OpenEmbedded build system. Toaster allows you to configure, run, and
|
||||
view information about builds. For information on Toaster, see the
|
||||
:doc:`../toaster-manual/toaster-manual`.
|
||||
|
||||
.. _gs-production-tools:
|
||||
|
||||
Production Tools
|
||||
----------------
|
||||
|
||||
The following list consists of tools that help production related
|
||||
activities using the Yocto Project:
|
||||
|
||||
- *Auto Upgrade Helper:* This utility when used in conjunction with the
|
||||
:term:`OpenEmbedded Build System`
|
||||
(BitBake and
|
||||
OE-Core) automatically generates upgrades for recipes that are based
|
||||
on new versions of the recipes published upstream. See
|
||||
:ref:`dev-manual/dev-manual-common-tasks:using the auto upgrade helper (auh)`
|
||||
for how to set it up.
|
||||
|
||||
- *Recipe Reporting System:* The Recipe Reporting System tracks recipe
|
||||
versions available for Yocto Project. The main purpose of the system
|
||||
is to help you manage the recipes you maintain and to offer a dynamic
|
||||
overview of the project. The Recipe Reporting System is built on top
|
||||
of the `OpenEmbedded Layer
|
||||
Index <http://layers.openembedded.org/layerindex/layers/>`__, which
|
||||
is a website that indexes OpenEmbedded-Core layers.
|
||||
|
||||
- *Patchwork:* `Patchwork <http://jk.ozlabs.org/projects/patchwork/>`__
|
||||
is a fork of a project originally started by
|
||||
`OzLabs <http://ozlabs.org/>`__. The project is a web-based tracking
|
||||
system designed to streamline the process of bringing contributions
|
||||
into a project. The Yocto Project uses Patchwork as an organizational
|
||||
tool to handle patches, which number in the thousands for every
|
||||
release.
|
||||
|
||||
- *AutoBuilder:* AutoBuilder is a project that automates build tests
|
||||
and quality assurance (QA). By using the public AutoBuilder, anyone
|
||||
can determine the status of the current "master" branch of Poky.
|
||||
|
||||
.. note::
|
||||
|
||||
AutoBuilder is based on buildbot.
|
||||
|
||||
A goal of the Yocto Project is to lead the open source industry with
|
||||
a project that automates testing and QA procedures. In doing so, the
|
||||
project encourages a development community that publishes QA and test
|
||||
plans, publicly demonstrates QA and test plans, and encourages
|
||||
development of tools that automate and test and QA procedures for the
|
||||
benefit of the development community.
|
||||
|
||||
You can learn more about the AutoBuilder used by the Yocto Project
|
||||
Autobuilder :doc:`here <../test-manual/test-manual-understand-autobuilder>`.
|
||||
|
||||
- *Cross-Prelink:* Prelinking is the process of pre-computing the load
|
||||
addresses and link tables generated by the dynamic linker as compared
|
||||
to doing this at runtime. Doing this ahead of time results in
|
||||
performance improvements when the application is launched and reduced
|
||||
memory usage for libraries shared by many applications.
|
||||
|
||||
Historically, cross-prelink is a variant of prelink, which was
|
||||
conceived by `Jakub
|
||||
Jelínek <http://people.redhat.com/jakub/prelink.pdf>`__ a number of
|
||||
years ago. Both prelink and cross-prelink are maintained in the same
|
||||
repository albeit on separate branches. By providing an emulated
|
||||
runtime dynamic linker (i.e. ``glibc``-derived ``ld.so`` emulation),
|
||||
the cross-prelink project extends the prelink software's ability to
|
||||
prelink a sysroot environment. Additionally, the cross-prelink
|
||||
software enables the ability to work in sysroot style environments.
|
||||
|
||||
The dynamic linker determines standard load address calculations
|
||||
based on a variety of factors such as mapping addresses, library
|
||||
usage, and library function conflicts. The prelink tool uses this
|
||||
information, from the dynamic linker, to determine unique load
|
||||
addresses for executable and linkable format (ELF) binaries that are
|
||||
shared libraries and dynamically linked. The prelink tool modifies
|
||||
these ELF binaries with the pre-computed information. The result is
|
||||
faster loading and often lower memory consumption because more of the
|
||||
library code can be re-used from shared Copy-On-Write (COW) pages.
|
||||
|
||||
The original upstream prelink project only supports running prelink
|
||||
on the end target device due to the reliance on the target device's
|
||||
dynamic linker. This restriction causes issues when developing a
|
||||
cross-compiled system. The cross-prelink adds a synthesized dynamic
|
||||
loader that runs on the host, thus permitting cross-prelinking
|
||||
without ever having to run on a read-write target filesystem.
|
||||
|
||||
- *Pseudo:* Pseudo is the Yocto Project implementation of
|
||||
`fakeroot <http://man.he.net/man1/fakeroot>`__, which is used to run
|
||||
commands in an environment that seemingly has root privileges.
|
||||
|
||||
During a build, it can be necessary to perform operations that
|
||||
require system administrator privileges. For example, file ownership
|
||||
or permissions might need definition. Pseudo is a tool that you can
|
||||
either use directly or through the environment variable
|
||||
``LD_PRELOAD``. Either method allows these operations to succeed as
|
||||
if system administrator privileges exist even when they do not.
|
||||
|
||||
You can read more about Pseudo in the "`Fakeroot and
|
||||
Pseudo <#fakeroot-and-pseudo>`__" section.
|
||||
|
||||
.. _gs-openembedded-build-system:
|
||||
|
||||
Open-Embedded Build System Components
|
||||
-------------------------------------
|
||||
|
||||
The following list consists of components associated with the
|
||||
:term:`OpenEmbedded Build System`:
|
||||
|
||||
- *BitBake:* BitBake is a core component of the Yocto Project and is
|
||||
used by the OpenEmbedded build system to build images. While BitBake
|
||||
is key to the build system, BitBake is maintained separately from the
|
||||
Yocto Project.
|
||||
|
||||
BitBake is a generic task execution engine that allows shell and
|
||||
Python tasks to be run efficiently and in parallel while working
|
||||
within complex inter-task dependency constraints. In short, BitBake
|
||||
is a build engine that works through recipes written in a specific
|
||||
format in order to perform sets of tasks.
|
||||
|
||||
You can learn more about BitBake in the :doc:`BitBake User
|
||||
Manual <bitbake:index>`.
|
||||
|
||||
- *OpenEmbedded-Core:* OpenEmbedded-Core (OE-Core) is a common layer of
|
||||
metadata (i.e. recipes, classes, and associated files) used by
|
||||
OpenEmbedded-derived systems, which includes the Yocto Project. The
|
||||
Yocto Project and the OpenEmbedded Project both maintain the
|
||||
OpenEmbedded-Core. You can find the OE-Core metadata in the Yocto
|
||||
Project :yocto_git:`Source Repositories </cgit/cgit.cgi/poky/tree/meta>`.
|
||||
|
||||
Historically, the Yocto Project integrated the OE-Core metadata
|
||||
throughout the Yocto Project source repository reference system
|
||||
(Poky). After Yocto Project Version 1.0, the Yocto Project and
|
||||
OpenEmbedded agreed to work together and share a common core set of
|
||||
metadata (OE-Core), which contained much of the functionality
|
||||
previously found in Poky. This collaboration achieved a long-standing
|
||||
OpenEmbedded objective for having a more tightly controlled and
|
||||
quality-assured core. The results also fit well with the Yocto
|
||||
Project objective of achieving a smaller number of fully featured
|
||||
tools as compared to many different ones.
|
||||
|
||||
Sharing a core set of metadata results in Poky as an integration
|
||||
layer on top of OE-Core. You can see that in this
|
||||
`figure <#yp-key-dev-elements>`__. The Yocto Project combines various
|
||||
components such as BitBake, OE-Core, script "glue", and documentation
|
||||
for its build system.
|
||||
|
||||
.. _gs-reference-distribution-poky:
|
||||
|
||||
Reference Distribution (Poky)
|
||||
-----------------------------
|
||||
|
||||
Poky is the Yocto Project reference distribution. It contains the
|
||||
:term:`OpenEmbedded Build System`
|
||||
(BitBake and OE-Core) as well as a set of metadata to get you started
|
||||
building your own distribution. See the
|
||||
`figure <#what-is-the-yocto-project>`__ in "What is the Yocto Project?"
|
||||
section for an illustration that shows Poky and its relationship with
|
||||
other parts of the Yocto Project.
|
||||
|
||||
To use the Yocto Project tools and components, you can download
|
||||
(``clone``) Poky and use it to bootstrap your own distribution.
|
||||
|
||||
.. note::
|
||||
|
||||
Poky does not contain binary files. It is a working example of how to
|
||||
build your own custom Linux distribution from source.
|
||||
|
||||
You can read more about Poky in the "`Reference Embedded Distribution
|
||||
(Poky) <#reference-embedded-distribution>`__" section.
|
||||
|
||||
.. _gs-packages-for-finished-targets:
|
||||
|
||||
Packages for Finished Targets
|
||||
-----------------------------
|
||||
|
||||
The following lists components associated with packages for finished
|
||||
targets:
|
||||
|
||||
- *Matchbox:* Matchbox is an Open Source, base environment for the X
|
||||
Window System running on non-desktop, embedded platforms such as
|
||||
handhelds, set-top boxes, kiosks, and anything else for which screen
|
||||
space, input mechanisms, or system resources are limited.
|
||||
|
||||
Matchbox consists of a number of interchangeable and optional
|
||||
applications that you can tailor to a specific, non-desktop platform
|
||||
to enhance usability in constrained environments.
|
||||
|
||||
You can find the Matchbox source in the Yocto Project
|
||||
:yocto_git:`Source Repositories <>`.
|
||||
|
||||
- *Opkg:* Open PacKaGe management (opkg) is a lightweight package
|
||||
management system based on the itsy package (ipkg) management system.
|
||||
Opkg is written in C and resembles Advanced Package Tool (APT) and
|
||||
Debian Package (dpkg) in operation.
|
||||
|
||||
Opkg is intended for use on embedded Linux devices and is used in
|
||||
this capacity in the
|
||||
`OpenEmbedded <http://www.openembedded.org/wiki/Main_Page>`__ and
|
||||
`OpenWrt <https://openwrt.org/>`__ projects, as well as the Yocto
|
||||
Project.
|
||||
|
||||
.. note::
|
||||
|
||||
As best it can, opkg maintains backwards compatibility with ipkg
|
||||
and conforms to a subset of Debian's policy manual regarding
|
||||
control files.
|
||||
|
||||
You can find the opkg source in the Yocto Project
|
||||
:yocto_git:`Source Repositories <>`.
|
||||
|
||||
.. _gs-archived-components:
|
||||
|
||||
Archived Components
|
||||
-------------------
|
||||
|
||||
The Build Appliance is a virtual machine image that enables you to build
|
||||
and boot a custom embedded Linux image with the Yocto Project using a
|
||||
non-Linux development system.
|
||||
|
||||
Historically, the Build Appliance was the second of three methods by
|
||||
which you could use the Yocto Project on a system that was not native to
|
||||
Linux.
|
||||
|
||||
1. *Hob:* Hob, which is now deprecated and is no longer available since
|
||||
the 2.1 release of the Yocto Project provided a rudimentary,
|
||||
GUI-based interface to the Yocto Project. Toaster has fully replaced
|
||||
Hob.
|
||||
|
||||
2. *Build Appliance:* Post Hob, the Build Appliance became available. It
|
||||
was never recommended that you use the Build Appliance as a
|
||||
day-to-day production development environment with the Yocto Project.
|
||||
Build Appliance was useful as a way to try out development in the
|
||||
Yocto Project environment.
|
||||
|
||||
3. *CROPS:* The final and best solution available now for developing
|
||||
using the Yocto Project on a system not native to Linux is with
|
||||
`CROPS <#gs-crops-overview>`__.
|
||||
|
||||
.. _gs-development-methods:
|
||||
|
||||
Development Methods
|
||||
===================
|
||||
|
||||
The Yocto Project development environment usually involves a
|
||||
:term:`Build Host` and target
|
||||
hardware. You use the Build Host to build images and develop
|
||||
applications, while you use the target hardware to test deployed
|
||||
software.
|
||||
|
||||
This section provides an introduction to the choices or development
|
||||
methods you have when setting up your Build Host. Depending on the your
|
||||
particular workflow preference and the type of operating system your
|
||||
Build Host runs, several choices exist that allow you to use the Yocto
|
||||
Project.
|
||||
|
||||
.. note::
|
||||
|
||||
For additional detail about the Yocto Project development
|
||||
environment, see the ":doc:`overview-manual-development-environment`"
|
||||
chapter.
|
||||
|
||||
- *Native Linux Host:* By far the best option for a Build Host. A
|
||||
system running Linux as its native operating system allows you to
|
||||
develop software by directly using the
|
||||
:term:`BitBake` tool. You can
|
||||
accomplish all aspects of development from a familiar shell of a
|
||||
supported Linux distribution.
|
||||
|
||||
For information on how to set up a Build Host on a system running
|
||||
Linux as its native operating system, see the
|
||||
":ref:`dev-manual/dev-manual-start:setting up a native linux host`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *CROss PlatformS (CROPS):* Typically, you use
|
||||
`CROPS <https://github.com/crops/poky-container/>`__, which leverages
|
||||
`Docker Containers <https://www.docker.com/>`__, to set up a Build
|
||||
Host that is not running Linux (e.g. Microsoft Windows or macOS).
|
||||
|
||||
.. note::
|
||||
|
||||
You can, however, use CROPS on a Linux-based system.
|
||||
|
||||
CROPS is an open source, cross-platform development framework that
|
||||
provides an easily managed, extensible environment for building
|
||||
binaries targeted for a variety of architectures on Windows, macOS,
|
||||
or Linux hosts. Once the Build Host is set up using CROPS, you can
|
||||
prepare a shell environment to mimic that of a shell being used on a
|
||||
system natively running Linux.
|
||||
|
||||
For information on how to set up a Build Host with CROPS, see the
|
||||
":ref:`dev-manual/dev-manual-start:setting up to use cross platforms (crops)`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *Windows Subsystem For Linux (WSLv2):* You may use Windows Subsystem
|
||||
For Linux v2 to set up a build host using Windows 10.
|
||||
|
||||
.. note::
|
||||
|
||||
The Yocto Project is not compatible with WSLv1, it is compatible
|
||||
but not officially supported nor validated with WSLv2, if you
|
||||
still decide to use WSL please upgrade to WSLv2.
|
||||
|
||||
The Windows Subsystem For Linux allows Windows 10 to run a real Linux
|
||||
kernel inside of a lightweight utility virtual machine (VM) using
|
||||
virtualization technology.
|
||||
|
||||
For information on how to set up a Build Host with WSLv2, see the
|
||||
":ref:`dev-manual/dev-manual-start:setting up to use windows subsystem for linux (wslv2)`"
|
||||
section in the Yocto Project Development Tasks Manual.
|
||||
|
||||
- *Toaster:* Regardless of what your Build Host is running, you can use
|
||||
Toaster to develop software using the Yocto Project. Toaster is a web
|
||||
interface to the Yocto Project's :term:`OpenEmbedded Build System`.
|
||||
The interface
|
||||
enables you to configure and run your builds. Information about
|
||||
builds is collected and stored in a database. You can use Toaster to
|
||||
configure and start builds on multiple remote build servers.
|
||||
|
||||
For information about and how to use Toaster, see the
|
||||
:doc:`../toaster-manual/toaster-manual`.
|
||||
|
||||
.. _reference-embedded-distribution:
|
||||
|
||||
Reference Embedded Distribution (Poky)
|
||||
======================================
|
||||
|
||||
"Poky", which is pronounced *Pock*-ee, is the name of the Yocto
|
||||
Project's reference distribution or Reference OS Kit. Poky contains the
|
||||
:term:`OpenEmbedded Build System`
|
||||
(:term:`BitBake` and
|
||||
:term:`OpenEmbedded-Core (OE-Core)`) as well as a set
|
||||
of :term:`Metadata` to get you started
|
||||
building your own distro. In other words, Poky is a base specification
|
||||
of the functionality needed for a typical embedded system as well as the
|
||||
components from the Yocto Project that allow you to build a distribution
|
||||
into a usable binary image.
|
||||
|
||||
Poky is a combined repository of BitBake, OpenEmbedded-Core (which is
|
||||
found in ``meta``), ``meta-poky``, ``meta-yocto-bsp``, and documentation
|
||||
provided all together and known to work well together. You can view
|
||||
these items that make up the Poky repository in the
|
||||
:yocto_git:`Source Repositories </cgit/cgit.cgi/poky/tree/>`.
|
||||
|
||||
.. note::
|
||||
|
||||
If you are interested in all the contents of the
|
||||
poky
|
||||
Git repository, see the ":ref:`ref-manual/ref-structure:top-level core components`"
|
||||
section in the Yocto Project Reference Manual.
|
||||
|
||||
The following figure illustrates what generally comprises Poky:
|
||||
|
||||
.. image:: figures/poky-reference-distribution.png
|
||||
:align: center
|
||||
|
||||
- BitBake is a task executor and scheduler that is the heart of the
|
||||
OpenEmbedded build system.
|
||||
|
||||
- ``meta-poky``, which is Poky-specific metadata.
|
||||
|
||||
- ``meta-yocto-bsp``, which are Yocto Project-specific Board Support
|
||||
Packages (BSPs).
|
||||
|
||||
- OpenEmbedded-Core (OE-Core) metadata, which includes shared
|
||||
configurations, global variable definitions, shared classes,
|
||||
packaging, and recipes. Classes define the encapsulation and
|
||||
inheritance of build logic. Recipes are the logical units of software
|
||||
and images to be built.
|
||||
|
||||
- Documentation, which contains the Yocto Project source files used to
|
||||
make the set of user manuals.
|
||||
|
||||
.. note::
|
||||
|
||||
While Poky is a "complete" distribution specification and is tested
|
||||
and put through QA, you cannot use it as a product "out of the box"
|
||||
in its current form.
|
||||
|
||||
To use the Yocto Project tools, you can use Git to clone (download) the
|
||||
Poky repository then use your local copy of the reference distribution
|
||||
to bootstrap your own distribution.
|
||||
|
||||
.. note::
|
||||
|
||||
Poky does not contain binary files. It is a working example of how to
|
||||
build your own custom Linux distribution from source.
|
||||
|
||||
Poky has a regular, well established, six-month release cycle under its
|
||||
own version. Major releases occur at the same time major releases (point
|
||||
releases) occur for the Yocto Project, which are typically in the Spring
|
||||
and Fall. For more information on the Yocto Project release schedule and
|
||||
cadence, see the ":doc:`../ref-manual/ref-release-process`" chapter in the
|
||||
Yocto Project Reference Manual.
|
||||
|
||||
Much has been said about Poky being a "default configuration". A default
|
||||
configuration provides a starting image footprint. You can use Poky out
|
||||
of the box to create an image ranging from a shell-accessible minimal
|
||||
image all the way up to a Linux Standard Base-compliant image that uses
|
||||
a GNOME Mobile and Embedded (GMAE) based reference user interface called
|
||||
Sato.
|
||||
|
||||
One of the most powerful properties of Poky is that every aspect of a
|
||||
build is controlled by the metadata. You can use metadata to augment
|
||||
these base image types by adding metadata
|
||||
`layers <#the-yocto-project-layer-model>`__ that extend functionality.
|
||||
These layers can provide, for example, an additional software stack for
|
||||
an image type, add a board support package (BSP) for additional
|
||||
hardware, or even create a new image type.
|
||||
|
||||
Metadata is loosely grouped into configuration files or package recipes.
|
||||
A recipe is a collection of non-executable metadata used by BitBake to
|
||||
set variables or define additional build-time tasks. A recipe contains
|
||||
fields such as the recipe description, the recipe version, the license
|
||||
of the package and the upstream source repository. A recipe might also
|
||||
indicate that the build process uses autotools, make, distutils or any
|
||||
other build process, in which case the basic functionality can be
|
||||
defined by the classes it inherits from the OE-Core layer's class
|
||||
definitions in ``./meta/classes``. Within a recipe you can also define
|
||||
additional tasks as well as task prerequisites. Recipe syntax through
|
||||
BitBake also supports both ``_prepend`` and ``_append`` operators as a
|
||||
method of extending task functionality. These operators inject code into
|
||||
the beginning or end of a task. For information on these BitBake
|
||||
operators, see the
|
||||
":ref:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata:appending and prepending (override style syntax)`"
|
||||
section in the BitBake User's Manual.
|
||||
|
||||
.. _openembedded-build-system-workflow:
|
||||
|
||||
The OpenEmbedded Build System Workflow
|
||||
======================================
|
||||
|
||||
The :term:`OpenEmbedded Build System` uses a "workflow" to
|
||||
accomplish image and SDK generation. The following figure overviews that
|
||||
workflow:
|
||||
|
||||
.. image:: figures/YP-flow-diagram.png
|
||||
:align: center
|
||||
|
||||
Following is a brief summary of the "workflow":
|
||||
|
||||
1. Developers specify architecture, policies, patches and configuration
|
||||
details.
|
||||
|
||||
2. The build system fetches and downloads the source code from the
|
||||
specified location. The build system supports standard methods such
|
||||
as tarballs or source code repositories systems such as Git.
|
||||
|
||||
3. Once source code is downloaded, the build system extracts the sources
|
||||
into a local work area where patches are applied and common steps for
|
||||
configuring and compiling the software are run.
|
||||
|
||||
4. The build system then installs the software into a temporary staging
|
||||
area where the binary package format you select (DEB, RPM, or IPK) is
|
||||
used to roll up the software.
|
||||
|
||||
5. Different QA and sanity checks run throughout entire build process.
|
||||
|
||||
6. After the binaries are created, the build system generates a binary
|
||||
package feed that is used to create the final root file image.
|
||||
|
||||
7. The build system generates the file system image and a customized
|
||||
Extensible SDK (eSDK) for application development in parallel.
|
||||
|
||||
For a very detailed look at this workflow, see the "`OpenEmbedded Build
|
||||
System Concepts <#openembedded-build-system-build-concepts>`__" section.
|
||||
|
||||
Some Basic Terms
|
||||
================
|
||||
|
||||
It helps to understand some basic fundamental terms when learning the
|
||||
Yocto Project. Although a list of terms exists in the ":doc:`Yocto Project
|
||||
Terms <../ref-manual/ref-terms>`" section of the Yocto Project
|
||||
Reference Manual, this section provides the definitions of some terms
|
||||
helpful for getting started:
|
||||
|
||||
- *Configuration Files:* Files that hold global definitions of
|
||||
variables, user-defined variables, and hardware configuration
|
||||
information. These files tell the :term:`OpenEmbedded Build System`
|
||||
what to build and
|
||||
what to put into the image to support a particular platform.
|
||||
|
||||
- *Extensible Software Development Kit (eSDK):* A custom SDK for
|
||||
application developers. This eSDK allows developers to incorporate
|
||||
their library and programming changes back into the image to make
|
||||
their code available to other application developers. For information
|
||||
on the eSDK, see the :doc:`../sdk-manual/sdk-manual` manual.
|
||||
|
||||
- *Layer:* A collection of related recipes. Layers allow you to
|
||||
consolidate related metadata to customize your build. Layers also
|
||||
isolate information used when building for multiple architectures.
|
||||
Layers are hierarchical in their ability to override previous
|
||||
specifications. You can include any number of available layers from
|
||||
the Yocto Project and customize the build by adding your layers after
|
||||
them. You can search the Layer Index for layers used within Yocto
|
||||
Project.
|
||||
|
||||
For more detailed information on layers, see the
|
||||
":ref:`dev-manual/dev-manual-common-tasks:understanding and creating layers`"
|
||||
section in the Yocto Project Development Tasks Manual. For a
|
||||
discussion specifically on BSP Layers, see the
|
||||
":ref:`bsp-guide/bsp:bsp layers`" section in the Yocto
|
||||
Project Board Support Packages (BSP) Developer's Guide.
|
||||
|
||||
- *Metadata:* A key element of the Yocto Project is the Metadata that
|
||||
is used to construct a Linux distribution and is contained in the
|
||||
files that the OpenEmbedded build system parses when building an
|
||||
image. In general, Metadata includes recipes, configuration files,
|
||||
and other information that refers to the build instructions
|
||||
themselves, as well as the data used to control what things get built
|
||||
and the effects of the build. Metadata also includes commands and
|
||||
data used to indicate what versions of software are used, from where
|
||||
they are obtained, and changes or additions to the software itself
|
||||
(patches or auxiliary files) that are used to fix bugs or customize
|
||||
the software for use in a particular situation. OpenEmbedded-Core is
|
||||
an important set of validated metadata.
|
||||
|
||||
- *OpenEmbedded Build System:* The terms "BitBake" and "build system"
|
||||
are sometimes used for the OpenEmbedded Build System.
|
||||
|
||||
BitBake is a task scheduler and execution engine that parses
|
||||
instructions (i.e. recipes) and configuration data. After a parsing
|
||||
phase, BitBake creates a dependency tree to order the compilation,
|
||||
schedules the compilation of the included code, and finally executes
|
||||
the building of the specified custom Linux image (distribution).
|
||||
BitBake is similar to the ``make`` tool.
|
||||
|
||||
During a build process, the build system tracks dependencies and
|
||||
performs a native or cross-compilation of the package. As a first
|
||||
step in a cross-build setup, the framework attempts to create a
|
||||
cross-compiler toolchain (i.e. Extensible SDK) suited for the target
|
||||
platform.
|
||||
|
||||
- *OpenEmbedded-Core (OE-Core):* OE-Core is metadata comprised of
|
||||
foundation recipes, classes, and associated files that are meant to
|
||||
be common among many different OpenEmbedded-derived systems,
|
||||
including the Yocto Project. OE-Core is a curated subset of an
|
||||
original repository developed by the OpenEmbedded community that has
|
||||
been pared down into a smaller, core set of continuously validated
|
||||
recipes. The result is a tightly controlled and quality-assured core
|
||||
set of recipes.
|
||||
|
||||
You can see the Metadata in the ``meta`` directory of the Yocto
|
||||
Project `Source
|
||||
Repositories <http://git.yoctoproject.org/cgit/cgit.cgi>`__.
|
||||
|
||||
- *Packages:* In the context of the Yocto Project, this term refers to
|
||||
a recipe's packaged output produced by BitBake (i.e. a "baked
|
||||
recipe"). A package is generally the compiled binaries produced from
|
||||
the recipe's sources. You "bake" something by running it through
|
||||
BitBake.
|
||||
|
||||
It is worth noting that the term "package" can, in general, have
|
||||
subtle meanings. For example, the packages referred to in the
|
||||
":ref:`ref-manual/ref-system-requirements:required packages for the build host`"
|
||||
section in the Yocto Project Reference Manual are compiled binaries
|
||||
that, when installed, add functionality to your Linux distribution.
|
||||
|
||||
Another point worth noting is that historically within the Yocto
|
||||
Project, recipes were referred to as packages - thus, the existence
|
||||
of several BitBake variables that are seemingly mis-named, (e.g.
|
||||
:term:`PR`,
|
||||
:term:`PV`, and
|
||||
:term:`PE`).
|
||||
|
||||
- *Poky:* Poky is a reference embedded distribution and a reference
|
||||
test configuration. Poky provides the following:
|
||||
|
||||
- A base-level functional distro used to illustrate how to customize
|
||||
a distribution.
|
||||
|
||||
- A means by which to test the Yocto Project components (i.e. Poky
|
||||
is used to validate the Yocto Project).
|
||||
|
||||
- A vehicle through which you can download the Yocto Project.
|
||||
|
||||
Poky is not a product level distro. Rather, it is a good starting
|
||||
point for customization.
|
||||
|
||||
.. note::
|
||||
|
||||
Poky is an integration layer on top of OE-Core.
|
||||
|
||||
- *Recipe:* The most common form of metadata. A recipe contains a list
|
||||
of settings and tasks (i.e. instructions) for building packages that
|
||||
are then used to build the binary image. A recipe describes where you
|
||||
get source code and which patches to apply. Recipes describe
|
||||
dependencies for libraries or for other recipes as well as
|
||||
configuration and compilation options. Related recipes are
|
||||
consolidated into a layer.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='overview-yp'>
|
||||
<title>Introducing the Yocto Project</title>
|
||||
@@ -458,7 +459,7 @@
|
||||
<para>The <filename>devtool</filename> command employs
|
||||
a number of sub-commands that allow you to add, modify,
|
||||
and upgrade recipes.
|
||||
As with the OpenEmbedded build system, “recipes”
|
||||
As with the OpenEmbedded build system, "recipes"
|
||||
represent software packages within
|
||||
<filename>devtool</filename>.
|
||||
When you use <filename>devtool add</filename>, a recipe
|
||||
@@ -471,7 +472,7 @@
|
||||
control is used in order to allow you to make changes
|
||||
to the source as desired.
|
||||
By default, both new recipes and the source go into
|
||||
a “workspace” directory under the eSDK.
|
||||
a "workspace" directory under the eSDK.
|
||||
The <filename>devtool upgrade</filename> command
|
||||
updates an existing recipe so that you can build it
|
||||
for an updated set of source files.</para>
|
||||
@@ -597,7 +598,7 @@
|
||||
By providing an emulated runtime dynamic linker
|
||||
(i.e. <filename>glibc</filename>-derived
|
||||
<filename>ld.so</filename> emulation), the
|
||||
cross-prelink project extends the prelink software’s
|
||||
cross-prelink project extends the prelink software's
|
||||
ability to prelink a sysroot environment.
|
||||
Additionally, the cross-prelink software enables the
|
||||
ability to work in sysroot style environments.</para>
|
||||
@@ -619,7 +620,7 @@
|
||||
|
||||
<para>The original upstream prelink project only
|
||||
supports running prelink on the end target device
|
||||
due to the reliance on the target device’s dynamic
|
||||
due to the reliance on the target device's dynamic
|
||||
linker.
|
||||
This restriction causes issues when developing a
|
||||
cross-compiled system.
|
||||
@@ -712,7 +713,7 @@
|
||||
You can see that in this
|
||||
<link linkend='yp-key-dev-elements'>figure</link>.
|
||||
The Yocto Project combines various components such as
|
||||
BitBake, OE-Core, script “glue”, and documentation
|
||||
BitBake, OE-Core, script "glue", and documentation
|
||||
for its build system.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
@@ -790,7 +791,7 @@
|
||||
<note>
|
||||
As best it can, opkg maintains backwards
|
||||
compatibility with ipkg and conforms to a subset
|
||||
of Debian’s policy manual regarding control files.
|
||||
of Debian's policy manual regarding control files.
|
||||
</note>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
19
documentation/overview-manual/overview-manual.rst
Normal file
19
documentation/overview-manual/overview-manual.rst
Normal file
@@ -0,0 +1,19 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
==========================================
|
||||
Yocto Project Overview and Concepts Manual
|
||||
==========================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
overview-manual-intro
|
||||
overview-manual-yp-intro
|
||||
overview-manual-development-environment
|
||||
overview-manual-concepts
|
||||
history
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='overview-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -52,28 +53,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<!ENTITY DISTRO "3.1.4">
|
||||
<!ENTITY DISTRO_COMPRESSED "314">
|
||||
<!ENTITY DISTRO "3.1">
|
||||
<!ENTITY DISTRO_COMPRESSED "31">
|
||||
<!ENTITY DISTRO_NAME_NO_CAP "dunfell">
|
||||
<!ENTITY DISTRO_NAME "Dunfell">
|
||||
<!ENTITY DISTRO_NAME_NO_CAP_MINUS_ONE "zeus">
|
||||
<!ENTITY DISTRO_NAME_MINUS_ONE "Zeus">
|
||||
<!ENTITY YOCTO_DOC_VERSION "3.1.4">
|
||||
<!ENTITY YOCTO_DOC_VERSION "3.1">
|
||||
<!ENTITY YOCTO_DOC_VERSION_MINUS_ONE "3.0.2">
|
||||
<!ENTITY DISTRO_REL_TAG "yocto-3.1.4">
|
||||
<!ENTITY DISTRO_REL_TAG "yocto-3.1">
|
||||
<!ENTITY METAINTELVERSION "12.0">
|
||||
<!ENTITY REL_MONTH_YEAR "November 2020">
|
||||
<!ENTITY REL_MONTH_YEAR "April 2020">
|
||||
<!ENTITY META_INTEL_REL_TAG "&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;">
|
||||
<!ENTITY POKYVERSION "23.0.4">
|
||||
<!ENTITY POKYVERSION_COMPRESSED "2304">
|
||||
<!ENTITY POKYVERSION "23.0.0">
|
||||
<!ENTITY POKYVERSION_COMPRESSED "2300">
|
||||
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;">
|
||||
<!ENTITY COPYRIGHT_YEAR "2010-2020">
|
||||
<!ENTITY ORGNAME "The Yocto Project">
|
||||
@@ -62,22 +62,22 @@
|
||||
<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
||||
pylint3 xterm">
|
||||
pylint3 xterm python3-subunit mesa-common-dev">
|
||||
<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
|
||||
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
|
||||
python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \
|
||||
python3-jinja2 SDL-devel xterm rpcgen">
|
||||
python3-jinja2 SDL-devel xterm rpcgen mesa-libGL-devel">
|
||||
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||
diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
|
||||
python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel xterm rpcgen
|
||||
python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel xterm rpcgen Mesa-dri-devel
|
||||
$ sudo pip3 install GitPython">
|
||||
<!ENTITY CENTOS7_HOST_PACKAGES_ESSENTIAL "-y epel-release
|
||||
$ sudo yum makecache
|
||||
$ sudo yum install gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
|
||||
perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python36-pip xz \
|
||||
which SDL-devel xterm
|
||||
which SDL-devel xterm mesa-libGL-devel
|
||||
$ sudo pip3 install GitPython jinja2">
|
||||
<!ENTITY CENTOS8_HOST_PACKAGES_ESSENTIAL "-y epel-release
|
||||
$ sudo dnf config-manager --set-enabled PowerTools
|
||||
@@ -86,4 +86,4 @@
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath ccache \
|
||||
socat perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip \
|
||||
python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel xterm \
|
||||
rpcgen">
|
||||
rpcgen mesa-libGL-devel">
|
||||
|
||||
89
documentation/poky.yaml
Normal file
89
documentation/poky.yaml
Normal file
@@ -0,0 +1,89 @@
|
||||
DISTRO : "3.1"
|
||||
DISTRO_COMPRESSED : "31"
|
||||
DISTRO_NAME_NO_CAP : "dunfell"
|
||||
DISTRO_NAME : "Dunfell"
|
||||
DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus"
|
||||
DISTRO_NAME_MINUS_ONE : "Zeus"
|
||||
YOCTO_DOC_VERSION : "3.1"
|
||||
YOCTO_DOC_VERSION_MINUS_ONE : "3.0.2"
|
||||
DISTRO_REL_TAG : "yocto-3.1"
|
||||
METAINTELVERSION : "12.0"
|
||||
REL_MONTH_YEAR : "April 2020"
|
||||
META_INTEL_REL_TAG : "&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;"
|
||||
POKYVERSION : "23.0.0"
|
||||
POKYVERSION_COMPRESSED : "2300"
|
||||
YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
|
||||
COPYRIGHT_YEAR : "2010-2020"
|
||||
ORGNAME : "The Yocto Project"
|
||||
ORGEMAIL : "docs@lists.yoctoproject.org"
|
||||
YOCTO_DL_URL : "http://downloads.yoctoproject.org"
|
||||
YOCTO_HOME_URL : "http://www.yoctoproject.org"
|
||||
YOCTO_LISTS_URL : "http://lists.yoctoproject.org"
|
||||
YOCTO_BUGZILLA_URL : "http://bugzilla.yoctoproject.org"
|
||||
YOCTO_WIKI_URL : "https://wiki.yoctoproject.org"
|
||||
YOCTO_AB_URL : "http://autobuilder.yoctoproject.org"
|
||||
YOCTO_GIT_URL : "http://git.yoctoproject.org"
|
||||
YOCTO_ADTREPO_URL : "http://adtrepo.yoctoproject.org"
|
||||
OE_HOME_URL : "http://www.openembedded.org"
|
||||
OE_LISTS_URL : "http://lists.openembedded.org/mailman"
|
||||
OE_DOCS_URL : "http://docs.openembedded.org"
|
||||
OH_HOME_URL : "http://o-hand.com"
|
||||
BITBAKE_HOME_URL : "http://developer.berlios.de/projects/bitbake/"
|
||||
YOCTO_DOCS_URL : "&YOCTO_HOME_URL;/docs"
|
||||
YOCTO_SOURCES_URL : "&YOCTO_HOME_URL;/sources/"
|
||||
YOCTO_AB_PORT_URL : "https://autobuilder.yocto.io/"
|
||||
YOCTO_AB_NIGHTLY_URL : "&YOCTO_AB_PORT_URL;/pub/nightly/"
|
||||
YOCTO_POKY_URL : "&YOCTO_DL_URL;/releases/poky/"
|
||||
YOCTO_RELEASE_DL_URL : "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;"
|
||||
YOCTO_TOOLCHAIN_DL_URL : "&YOCTO_RELEASE_DL_URL;/toolchain/"
|
||||
YOCTO_ADTINSTALLER_DL_URL : "&YOCTO_RELEASE_DL_URL;/adt-installer"
|
||||
YOCTO_POKY_DL_URL : "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2"
|
||||
YOCTO_MACHINES_DL_URL : "&YOCTO_RELEASE_DL_URL;/machines"
|
||||
YOCTO_QEMU_DL_URL : "&YOCTO_MACHINES_DL_URL;/qemu"
|
||||
YOCTO_PYTHON-i686_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2"
|
||||
YOCTO_PYTHON-x86_64_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2"
|
||||
YOCTO_DOCS_QS_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html"
|
||||
YOCTO_DOCS_ADT_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html"
|
||||
YOCTO_DOCS_REF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html"
|
||||
YOCTO_DOCS_BSP_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html"
|
||||
YOCTO_DOCS_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html"
|
||||
YOCTO_DOCS_KERNEL_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-dev/kernel-dev.html"
|
||||
YOCTO_DOCS_PROF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/profile-manual/profile-manual.html"
|
||||
YOCTO_DOCS_MM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/mega-manual/mega-manual.html"
|
||||
YOCTO_DOCS_BB_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bitbake-user-manual/bitbake-user-manual.html"
|
||||
YOCTO_DOCS_TOAST_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/toaster-manual/toaster-manual.html"
|
||||
YOCTO_DOCS_SDK_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/sdk-manual/sdk-manual.html"
|
||||
YOCTO_DOCS_OM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/overview-manual/overview-manual.html"
|
||||
YOCTO_DOCS_BRIEF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/brief-yoctoprojectqs/brief-yoctoprojectqs.html"
|
||||
YOCTO_ADTPATH_DIR : "/opt/poky/&DISTRO;"
|
||||
YOCTO_POKY_TARBALL : "&YOCTO_POKY;.tar.bz2"
|
||||
OE_INIT_PATH : "&YOCTO_POKY;/oe-init-build-env"
|
||||
OE_INIT_FILE : "oe-init-build-env"
|
||||
UBUNTU_HOST_PACKAGES_ESSENTIAL : "gawk wget git-core diffstat unzip texinfo gcc-multilib \
|
||||
build-essential chrpath socat cpio python3 python3-pip python3-pexpect \
|
||||
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
|
||||
pylint3 xterm python3-subunit mesa-common-dev"
|
||||
FEDORA_HOST_PACKAGES_ESSENTIAL : "gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
|
||||
ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
|
||||
python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \
|
||||
python3-jinja2 SDL-devel xterm rpcgen mesa-libGL-devel"
|
||||
OPENSUSE_HOST_PACKAGES_ESSENTIAL : "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||
diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
|
||||
python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel xterm rpcgen Mesa-dri-devel
|
||||
$ sudo pip3 install GitPython"
|
||||
CENTOS7_HOST_PACKAGES_ESSENTIAL : "-y epel-release
|
||||
$ sudo yum makecache
|
||||
$ sudo yum install gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
|
||||
perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python36-pip xz \
|
||||
which SDL-devel xterm mesa-libGL-devel
|
||||
$ sudo pip3 install GitPython jinja2"
|
||||
CENTOS8_HOST_PACKAGES_ESSENTIAL : "-y epel-release
|
||||
$ sudo dnf config-manager --set-enabled PowerTools
|
||||
$ sudo dnf makecache
|
||||
$ sudo dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath ccache \
|
||||
socat perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip \
|
||||
python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel xterm \
|
||||
rpcgen mesa-libGL-devel"
|
||||
58
documentation/profile-manual/history.rst
Normal file
58
documentation/profile-manual/history.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
***********************
|
||||
Manual Revision History
|
||||
***********************
|
||||
|
||||
.. list-table::
|
||||
:widths: 10 15 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Revision
|
||||
- Date
|
||||
- Note
|
||||
* - 1.4
|
||||
- April 2013
|
||||
- The initial document released with the Yocto Project 1.4 Release
|
||||
* - 1.5
|
||||
- October 2013
|
||||
- Released with the Yocto Project 1.5 Release.
|
||||
* - 1.6
|
||||
- April 2014
|
||||
- Released with the Yocto Project 1.6 Release.
|
||||
* - 1.7
|
||||
- October 2014
|
||||
- Released with the Yocto Project 1.7 Release.
|
||||
* - 1.8
|
||||
- April 2015
|
||||
- Released with the Yocto Project 1.8 Release.
|
||||
* - 2.0
|
||||
- October 2015
|
||||
- Released with the Yocto Project 2.0 Release.
|
||||
* - 2.1
|
||||
- April 2016
|
||||
- Released with the Yocto Project 2.1 Release.
|
||||
* - 2.2
|
||||
- October 2016
|
||||
- Released with the Yocto Project 2.2 Release.
|
||||
* - 2.3
|
||||
- May 2017
|
||||
- Released with the Yocto Project 2.3 Release.
|
||||
* - 2.4
|
||||
- October 2017
|
||||
- Released with the Yocto Project 2.4 Release.
|
||||
* - 2.5
|
||||
- May 2018
|
||||
- Released with the Yocto Project 2.5 Release.
|
||||
* - 2.6
|
||||
- November 2018
|
||||
- Released with the Yocto Project 2.6 Release.
|
||||
* - 2.7
|
||||
- May 2019
|
||||
- Released with the Yocto Project 2.7 Release.
|
||||
* - 3.0
|
||||
- October 2019
|
||||
- Released with the Yocto Project 3.0 Release.
|
||||
* - 3.1
|
||||
- April 2020
|
||||
- Released with the Yocto Project 3.1 Release.
|
||||
29
documentation/profile-manual/profile-manual-arch.rst
Normal file
29
documentation/profile-manual/profile-manual-arch.rst
Normal file
@@ -0,0 +1,29 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*************************************************************
|
||||
Overall Architecture of the Linux Tracing and Profiling Tools
|
||||
*************************************************************
|
||||
|
||||
Architecture of the Tracing and Profiling Tools
|
||||
===============================================
|
||||
|
||||
It may seem surprising to see a section covering an 'overall
|
||||
architecture' for what seems to be a random collection of tracing tools
|
||||
that together make up the Linux tracing and profiling space. The fact
|
||||
is, however, that in recent years this seemingly disparate set of tools
|
||||
has started to converge on a 'core' set of underlying mechanisms:
|
||||
|
||||
- static tracepoints
|
||||
- dynamic tracepoints
|
||||
|
||||
- kprobes
|
||||
- uprobes
|
||||
|
||||
- the perf_events subsystem
|
||||
- debugfs
|
||||
|
||||
.. admonition:: Tying it Together
|
||||
|
||||
Rather than enumerating here how each tool makes use of these common
|
||||
mechanisms, textboxes like this will make note of the specific usages
|
||||
in each tool as they come up in the course of the text.
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='profile-manual-arch'>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
|
||||
|
||||
<xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
|
||||
|
||||
24
documentation/profile-manual/profile-manual-examples.rst
Normal file
24
documentation/profile-manual/profile-manual-examples.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
*******************
|
||||
Real-World Examples
|
||||
*******************
|
||||
|
||||
|
|
||||
|
||||
This chapter contains real-world examples.
|
||||
|
||||
Slow Write Speed on Live Images
|
||||
===============================
|
||||
|
||||
In one of our previous releases (denzil), users noticed that booting off
|
||||
of a live image and writing to disk was noticeably slower. This included
|
||||
the boot itself, especially the first one, since first boots tend to do
|
||||
a significant amount of writing due to certain post-install scripts.
|
||||
|
||||
The problem (and solution) was discovered by using the Yocto tracing
|
||||
tools, in this case 'perf stat', 'perf script', 'perf record' and 'perf
|
||||
report'.
|
||||
|
||||
See all the unvarnished details of how this bug was diagnosed and solved
|
||||
here: Yocto Bug #3049
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='profile-manual-examples'>
|
||||
|
||||
|
||||
79
documentation/profile-manual/profile-manual-intro.rst
Normal file
79
documentation/profile-manual/profile-manual-intro.rst
Normal file
@@ -0,0 +1,79 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
******************************************
|
||||
Yocto Project Profiling and Tracing Manual
|
||||
******************************************
|
||||
|
||||
.. _profile-intro:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Yocto bundles a number of tracing and profiling tools - this 'HOWTO'
|
||||
describes their basic usage and shows by example how to make use of them
|
||||
to examine application and system behavior.
|
||||
|
||||
The tools presented are for the most part completely open-ended and have
|
||||
quite good and/or extensive documentation of their own which can be used
|
||||
to solve just about any problem you might come across in Linux. Each
|
||||
section that describes a particular tool has links to that tool's
|
||||
documentation and website.
|
||||
|
||||
The purpose of this 'HOWTO' is to present a set of common and generally
|
||||
useful tracing and profiling idioms along with their application (as
|
||||
appropriate) to each tool, in the context of a general-purpose
|
||||
'drill-down' methodology that can be applied to solving a large number
|
||||
(90%?) of problems. For help with more advanced usages and problems,
|
||||
please see the documentation and/or websites listed for each tool.
|
||||
|
||||
The final section of this 'HOWTO' is a collection of real-world examples
|
||||
which we'll be continually adding to as we solve more problems using the
|
||||
tools - feel free to add your own examples to the list!
|
||||
|
||||
.. _profile-manual-general-setup:
|
||||
|
||||
General Setup
|
||||
=============
|
||||
|
||||
Most of the tools are available only in 'sdk' images or in images built
|
||||
after adding 'tools-profile' to your local.conf. So, in order to be able
|
||||
to access all of the tools described here, please first build and boot
|
||||
an 'sdk' image e.g. ::
|
||||
|
||||
$ bitbake core-image-sato-sdk
|
||||
|
||||
or alternatively by adding 'tools-profile' to the EXTRA_IMAGE_FEATURES line in
|
||||
your local.conf: ::
|
||||
|
||||
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile"
|
||||
|
||||
If you use the 'tools-profile' method, you don't need to build an sdk image -
|
||||
the tracing and profiling tools will be included in non-sdk images as well e.g.: ::
|
||||
|
||||
$ bitbake core-image-sato
|
||||
|
||||
.. note::
|
||||
|
||||
By default, the Yocto build system strips symbols from the binaries
|
||||
it packages, which makes it difficult to use some of the tools.
|
||||
|
||||
You can prevent that by setting the
|
||||
:term:`INHIBIT_PACKAGE_STRIP`
|
||||
variable to "1" in your ``local.conf`` when you build the image: ::
|
||||
|
||||
INHIBIT_PACKAGE_STRIP = "1"
|
||||
|
||||
The above setting will noticeably increase the size of your image.
|
||||
|
||||
If you've already built a stripped image, you can generate debug
|
||||
packages (xxx-dbg) which you can manually install as needed.
|
||||
|
||||
To generate debug info for packages, you can add dbg-pkgs to
|
||||
EXTRA_IMAGE_FEATURES in local.conf. For example: ::
|
||||
|
||||
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
|
||||
|
||||
Additionally, in order to generate the right type of debuginfo, we also need to
|
||||
set :term:`PACKAGE_DEBUG_SPLIT_STYLE` in the ``local.conf`` file: ::
|
||||
|
||||
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='profile-manual-intro'>
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
|
||||
SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
Generic XHTML / DocBook XHTML CSS Stylesheet.
|
||||
|
||||
Browser wrangling and typographic design by
|
||||
|
||||
2624
documentation/profile-manual/profile-manual-usage.rst
Normal file
2624
documentation/profile-manual/profile-manual-usage.rst
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<chapter id='profile-manual-usage'>
|
||||
|
||||
|
||||
19
documentation/profile-manual/profile-manual.rst
Normal file
19
documentation/profile-manual/profile-manual.rst
Normal file
@@ -0,0 +1,19 @@
|
||||
.. SPDX-License-Identifier: CC-BY-2.0-UK
|
||||
|
||||
==========================================
|
||||
Yocto Project Profiling and Tracing Manual
|
||||
==========================================
|
||||
|
||||
|
|
||||
|
||||
.. toctree::
|
||||
:caption: Table of Contents
|
||||
:numbered:
|
||||
|
||||
profile-manual-intro
|
||||
profile-manual-arch
|
||||
profile-manual-usage
|
||||
profile-manual-examples
|
||||
history
|
||||
|
||||
.. include:: /boilerplate.rst
|
||||
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
|
||||
<!--SPDX-License-Identifier: CC-BY-2.0-UK-->
|
||||
|
||||
<book id='profile-manual' lang='en'
|
||||
xmlns:xi="http://www.w3.org/2003/XInclude"
|
||||
@@ -102,28 +103,8 @@
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1</revnumber>
|
||||
<date>April 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.1</revnumber>
|
||||
<date>June 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.1 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.2</revnumber>
|
||||
<date>August 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.2 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.3</revnumber>
|
||||
<date>October 2020</date>
|
||||
<revremark>Released with the Yocto Project 3.1.3 Release.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>3.1.4</revnumber>
|
||||
<date>&REL_MONTH_YEAR;</date>
|
||||
<revremark>Released with the Yocto Project 3.1.4 Release.</revremark>
|
||||
<revremark>Released with the Yocto Project 3.1 Release.</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
DESCRIPTION = "GNU Helloworld application"
|
||||
SECTION = "examples"
|
||||
LICENSE = "GPLv3"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
|
||||
|
||||
SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.gz"
|
||||
SRC_URI[sha256sum] = "31e066137a962676e89f69d1b65382de95a7ef7d914b8cb956f41ea72e0f516b"
|
||||
|
||||
inherit autotools-brokensep gettext
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user