summaryrefslogtreecommitdiffstats
path: root/documentation/kernel-dev/kernel-dev-intro.rst
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-06-26 19:10:51 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-17 10:09:33 +0100
commit9bd69b1f1d71a9692189beeac75af9dfbad816cc (patch)
tree305347fca899074aed5610e0e82eaec180bf630c /documentation/kernel-dev/kernel-dev-intro.rst
parentc40a8d5904c29046f1cbbeb998e6cd7c24f9b206 (diff)
downloadpoky-9bd69b1f1d71a9692189beeac75af9dfbad816cc.tar.gz
sphinx: initial sphinx support
This commit is autogenerated pandoc to generate an inital set of reST files based on DocBook XML files. A .rst file is generated for each .xml files in all manuals with this command: cd <manual> for i in *.xml; do \ pandoc -f docbook -t rst --shift-heading-level-by=-1 \ $i -o $(basename $i .xml).rst \ done The conversion was done with: pandoc 2.9.2.1-91 (Arch Linux). Also created an initial top level index file for each document, and added all 'books' to the top leve index.rst file. The YP manuals layout is organized as: Book Chapter Section Section Section Sphinx uses section headers to create the document structure. ReStructuredText defines sections headers like that: To break longer text up into sections, you use section headers. These are a single line of text (one or more words) with adornment: an underline alone, or an underline and an overline together, in dashes "-----", equals "======", tildes "~~~~~~" or any of the non-alphanumeric characters = - ` : ' " ~ ^ _ * + # < > that you feel comfortable with. An underline-only adornment is distinct from an overline-and-underline adornment using the same character. The underline/overline must be at least as long as the title text. Be consistent, since all sections marked with the same adornment style are deemed to be at the same level: Let's define the following convention when converting from Docbook: Book => overline === (Title) Chapter => overline *** (1.) Section => ==== (1.1) Section => ---- (1.1.1) Section => ~~~~ (1.1.1.1) Section => ^^^^ (1.1.1.1.1) During the conversion with pandoc, we used --shift-heading-level=-1 to convert most of DocBook headings automatically. However with this setting, the Chapter header was removed, so I added it back manually. Without this setting all headings were off by one, which was more difficult to manually fix. At least with this change, we now have the same TOC with Sphinx and DocBook. (From yocto-docs rev: 3c73d64a476d4423ee4c6808c685fa94d88d7df8) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/kernel-dev/kernel-dev-intro.rst')
-rw-r--r--documentation/kernel-dev/kernel-dev-intro.rst178
1 files changed, 178 insertions, 0 deletions
diff --git a/documentation/kernel-dev/kernel-dev-intro.rst b/documentation/kernel-dev/kernel-dev-intro.rst
new file mode 100644
index 0000000000..0f87f8cf1d
--- /dev/null
+++ b/documentation/kernel-dev/kernel-dev-intro.rst
@@ -0,0 +1,178 @@
1************
2Introduction
3************
4
5.. _kernel-dev-overview:
6
7Overview
8========
9
10Regardless of how you intend to make use of the Yocto Project, chances
11are you will work with the Linux kernel. This manual describes how to
12set up your build host to support kernel development, introduces the
13kernel development process, provides background information on the Yocto
14Linux kernel `Metadata <&YOCTO_DOCS_REF_URL;#metadata>`__, describes
15common tasks you can perform using the kernel tools, shows you how to
16use the kernel Metadata needed to work with the kernel inside the Yocto
17Project, and provides insight into how the Yocto Project team develops
18and maintains Yocto Linux kernel Git repositories and Metadata.
19
20Each Yocto Project release has a set of Yocto Linux kernel recipes,
21whose Git repositories you can view in the Yocto `Source
22Repositories <&YOCTO_GIT_URL;>`__ under the "Yocto Linux Kernel"
23heading. New recipes for the release track the latest Linux kernel
24upstream developments from ` <http://www.kernel.org>`__ and introduce
25newly-supported platforms. Previous recipes in the release are refreshed
26and supported for at least one additional Yocto Project release. As they
27align, these previous releases are updated to include the latest from
28the Long Term Support Initiative (LTSI) project. You can learn more
29about Yocto Linux kernels and LTSI in the "`Yocto Project Kernel
30Development and Maintenance <#kernel-big-picture>`__" section.
31
32Also included is a Yocto Linux kernel development recipe
33(``linux-yocto-dev.bb``) should you want to work with the very latest in
34upstream Yocto Linux kernel development and kernel Metadata development.
35
36.. note::
37
38 For more on Yocto Linux kernels, see the "
39 Yocto Project Kernel Development and Maintenance
40 section.
41
42The Yocto Project also provides a powerful set of kernel tools for
43managing Yocto Linux kernel sources and configuration data. You can use
44these tools to make a single configuration change, apply multiple
45patches, or work with your own kernel sources.
46
47In particular, the kernel tools allow you to generate configuration
48fragments that specify only what you must, and nothing more.
49Configuration fragments only need to contain the highest level visible
50``CONFIG`` options as presented by the Yocto Linux kernel ``menuconfig``
51system. Contrast this against a complete Yocto Linux kernel ``.config``
52file, which includes all the automatically selected ``CONFIG`` options.
53This efficiency reduces your maintenance effort and allows you to
54further separate your configuration in ways that make sense for your
55project. A common split separates policy and hardware. For example, all
56your kernels might support the ``proc`` and ``sys`` filesystems, but
57only specific boards require sound, USB, or specific drivers. Specifying
58these configurations individually allows you to aggregate them together
59as needed, but maintains them in only one place. Similar logic applies
60to separating source changes.
61
62If you do not maintain your own kernel sources and need to make only
63minimal changes to the sources, the released recipes provide a vetted
64base upon which to layer your changes. Doing so allows you to benefit
65from the continual kernel integration and testing performed during
66development of the Yocto Project.
67
68If, instead, you have a very specific Linux kernel source tree and are
69unable to align with one of the official Yocto Linux kernel recipes, an
70alternative exists by which you can use the Yocto Project Linux kernel
71tools with your own kernel sources.
72
73The remainder of this manual provides instructions for completing
74specific Linux kernel development tasks. These instructions assume you
75are comfortable working with
76`BitBake <http://openembedded.org/wiki/Bitbake>`__ recipes and basic
77open-source development tools. Understanding these concepts will
78facilitate the process of working with the kernel recipes. If you find
79you need some additional background, please be sure to review and
80understand the following documentation:
81
82- `Yocto Project Quick Build <&YOCTO_DOCS_BRIEF_URL;>`__ document.
83
84- `Yocto Project Overview and Concepts Manual <&YOCTO_DOCS_OM_URL;>`__.
85
86- ```devtool``
87 workflow <&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow>`__
88 as described in the Yocto Project Application Development and the
89 Extensible Software Development Kit (eSDK) manual.
90
91- The "`Understanding and Creating
92 Layers <&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers>`__"
93 section in the Yocto Project Development Tasks Manual.
94
95- The "`Kernel Modification
96 Workflow <#kernel-modification-workflow>`__" section.
97
98Kernel Modification Workflow
99============================
100
101Kernel modification involves changing the Yocto Project kernel, which
102could involve changing configuration options as well as adding new
103kernel recipes. Configuration changes can be added in the form of
104configuration fragments, while recipe modification comes through the
105kernel's ``recipes-kernel`` area in a kernel layer you create.
106
107This section presents a high-level overview of the Yocto Project kernel
108modification workflow. The illustration and accompanying list provide
109general information and references for further information.
110
1111. *Set up Your Host Development System to Support Development Using the
112 Yocto Project*: See the "`Setting Up the Development Host to Use the
113 Yocto Project <&YOCTO_DOCS_DEV_URL;#dev-manual-start>`__" section in
114 the Yocto Project Development Tasks Manual for options on how to get
115 a build host ready to use the Yocto Project.
116
1172. *Set Up Your Host Development System for Kernel Development:* It is
118 recommended that you use ``devtool`` and an extensible SDK for kernel
119 development. Alternatively, you can use traditional kernel
120 development methods with the Yocto Project. Either way, there are
121 steps you need to take to get the development environment ready.
122
123 Using ``devtool`` and the eSDK requires that you have a clean build
124 of the image and that you are set up with the appropriate eSDK. For
125 more information, see the "`Getting Ready to Develop Using
126 ``devtool`` <#getting-ready-to-develop-using-devtool>`__" section.
127
128 Using traditional kernel development requires that you have the
129 kernel source available in an isolated local Git repository. For more
130 information, see the "`Getting Ready for Traditional Kernel
131 Development <#getting-ready-for-traditional-kernel-development>`__"
132 section.
133
1343. *Make Changes to the Kernel Source Code if applicable:* Modifying the
135 kernel does not always mean directly changing source files. However,
136 if you have to do this, you make the changes to the files in the
137 eSDK's Build Directory if you are using ``devtool``. For more
138 information, see the "`Using ``devtool`` to Patch the
139 Kernel <#using-devtool-to-patch-the-kernel>`__" section.
140
141 If you are using traditional kernel development, you edit the source
142 files in the kernel's local Git repository. For more information, see
143 the "`Using Traditional Kernel Development to Patch the
144 Kernel <#using-traditional-kernel-development-to-patch-the-kernel>`__"
145 section.
146
1474. *Make Kernel Configuration Changes if Applicable:* If your situation
148 calls for changing the kernel's configuration, you can use
149 ```menuconfig`` <#using-menuconfig>`__, which allows you to
150 interactively develop and test the configuration changes you are
151 making to the kernel. Saving changes you make with ``menuconfig``
152 updates the kernel's ``.config`` file.
153
154 .. note::
155
156 Try to resist the temptation to directly edit an existing
157 .config
158 file, which is found in the Build Directory among the source code
159 used for the build. Doing so, can produce unexpected results when
160 the OpenEmbedded build system regenerates the configuration file.
161
162 Once you are satisfied with the configuration changes made using
163 ``menuconfig`` and you have saved them, you can directly compare the
164 resulting ``.config`` file against an existing original and gather
165 those changes into a `configuration fragment
166 file <#creating-config-fragments>`__ to be referenced from within the
167 kernel's ``.bbappend`` file.
168
169 Additionally, if you are working in a BSP layer and need to modify
170 the BSP's kernel's configuration, you can use ``menuconfig``.
171
1725. *Rebuild the Kernel Image With Your Changes:* Rebuilding the kernel
173 image applies your changes. Depending on your target hardware, you
174 can verify your changes on actual hardware or perhaps QEMU.
175
176The remainder of this developer's guide covers common tasks typically
177used during kernel development, advanced Metadata usage, and Yocto Linux
178kernel maintenance concepts.