kernel-dev: Updates to "Working With Your Own Sources"

Formatting changes for the list.

(From yocto-docs rev: df1201085408eec45d8fbf649e80437299daa0e8)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2017-10-03 13:09:54 -07:00
committed by Richard Purdie
parent cb9150394d
commit d7ad579ce5

View File

@@ -2258,23 +2258,29 @@
</para> </para>
<para> <para>
Here are some basic steps you can use to work with your own sources: Here are some basic steps you can use to work with your own
sources:
<orderedlist> <orderedlist>
<listitem><para>Copy the <filename>linux-yocto-custom.bb</filename> <listitem><para>
<emphasis>Create a Copy of the Kernel Recipe:</emphasis>
Copy the <filename>linux-yocto-custom.bb</filename>
recipe to your layer and give it a meaningful name. recipe to your layer and give it a meaningful name.
The name should include the version of the Linux kernel you The name should include the version of the Yocto Linux
are using (e.g. kernel you are using (e.g.
<filename>linux-yocto-myproject_3.19.bb</filename>, <filename>linux-yocto-myproject_4.12.bb</filename>,
where "3.19" is the base version of the Linux kernel where "4.12" is the base version of the Linux kernel
with which you would be working).</para></listitem> with which you would be working).
<listitem><para>In the same directory inside your layer,
create a matching directory
to store your patches and configuration files (e.g.
<filename>linux-yocto-myproject</filename>).
</para></listitem> </para></listitem>
<listitem><para>Make sure you have either a <listitem><para>
<filename>defconfig</filename> file or configuration <emphasis>Create a Directory for Your Patches:</emphasis>
fragment files. In the same directory inside your layer, create a matching
directory to store your patches and configuration files
(e.g. <filename>linux-yocto-myproject</filename>).
</para></listitem>
<listitem><para>
<emphasis>Ensure You Have Configurations:</emphasis>
Make sure you have either a <filename>defconfig</filename>
file or configuration fragment files in your layer.
When you use the <filename>linux-yocto-custom.bb</filename> When you use the <filename>linux-yocto-custom.bb</filename>
recipe, you must specify a configuration. recipe, you must specify a configuration.
If you do not have a <filename>defconfig</filename> file, If you do not have a <filename>defconfig</filename> file,
@@ -2283,27 +2289,32 @@
$ make defconfig $ make defconfig
</literallayout> </literallayout>
After running the command, copy the resulting After running the command, copy the resulting
<filename>.config</filename> to the <filename>.config</filename> file to the
<filename>files</filename> directory as "defconfig" and <filename>files</filename> directory in your layer
then add it to the as "defconfig" and then add it to the
<ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
variable in the recipe.</para> variable in the recipe.</para>
<para>Running the <filename>make defconfig</filename> <para>Running the <filename>make defconfig</filename>
command results in the default configuration for your command results in the default configuration for your
architecture as defined by your kernel. architecture as defined by your kernel.
However, no guarantee exists that this configuration is However, no guarantee exists that this configuration is
valid for your use case, or that your board will even boot. valid for your use case, or that your board will even boot.
This is particularly true for non-x86 architectures. This is particularly true for non-x86 architectures.</para>
To use non-x86 <filename>defconfig</filename> files, you
need to be more specific and find one that matches your <para>To use non-x86 <filename>defconfig</filename> files,
you need to be more specific and find one that matches your
board (i.e. for arm, you look in board (i.e. for arm, you look in
<filename>arch/arm/configs</filename> and use the one that <filename>arch/arm/configs</filename> and use the one that
is the best starting point for your board). is the best starting point for your board).
</para></listitem> </para></listitem>
<listitem><para>Edit the following variables in your recipe <listitem><para>
as appropriate for your project: <emphasis>Edit the Recipe:</emphasis>
Edit the following variables in your recipe as appropriate
for your project:
<itemizedlist> <itemizedlist>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>: <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>:
The <filename>SRC_URI</filename> should specify The <filename>SRC_URI</filename> should specify
a Git repository that uses one of the supported Git a Git repository that uses one of the supported Git
fetcher protocols (i.e. <filename>file</filename>, fetcher protocols (i.e. <filename>file</filename>,
@@ -2315,24 +2326,32 @@
The skeleton recipe provides an example The skeleton recipe provides an example
<filename>SRC_URI</filename> as a syntax reference. <filename>SRC_URI</filename> as a syntax reference.
</para></listitem> </para></listitem>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>: <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>:
The Linux kernel version you are using (e.g. The Linux kernel version you are using (e.g.
"3.19").</para></listitem> "4.12").
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION_EXTENSION'><filename>LINUX_VERSION_EXTENSION</filename></ulink>: </para></listitem>
The Linux kernel <filename>CONFIG_LOCALVERSION</filename> <listitem><para>
that is compiled into the resulting kernel and visible <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION_EXTENSION'><filename>LINUX_VERSION_EXTENSION</filename></ulink>:
The Linux kernel
<filename>CONFIG_LOCALVERSION</filename> that is
compiled into the resulting kernel and visible
through the <filename>uname</filename> command. through the <filename>uname</filename> command.
</para></listitem> </para></listitem>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>: <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>:
The commit ID from which you want to build. The commit ID from which you want to build.
</para></listitem> </para></listitem>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>: <listitem><para>
Treat this variable the same as you would in any other <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
recipe. Treat this variable the same as you would in any
Increment the variable to indicate to the OpenEmbedded other recipe.
build system that the recipe has changed. Increment the variable to indicate to the
OpenEmbedded build system that the recipe has
changed.
</para></listitem> </para></listitem>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>: <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
The default <filename>PV</filename> assignment is The default <filename>PV</filename> assignment is
typically adequate. typically adequate.
It combines the <filename>LINUX_VERSION</filename> It combines the <filename>LINUX_VERSION</filename>
@@ -2340,16 +2359,17 @@
as derived from the as derived from the
<ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>
variable. variable.
The combined results are a string with The combined results are a string with the
the following form: following form:
<literallayout class='monospaced'> <literallayout class='monospaced'>
3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2 3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2
</literallayout> </literallayout>
While lengthy, the extra verbosity in <filename>PV</filename> While lengthy, the extra verbosity in
helps ensure you are using the exact <filename>PV</filename> helps ensure you are using
sources from which you intend to build. the exact sources from which you intend to build.
</para></listitem> </para></listitem>
<listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>: <listitem><para>
<ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>:
A list of the machines supported by your new recipe. A list of the machines supported by your new recipe.
This variable in the example recipe is set This variable in the example recipe is set
by default to a regular expression that matches by default to a regular expression that matches
@@ -2358,18 +2378,24 @@
failure. failure.
You must change it to match a list of the machines You must change it to match a list of the machines
that your new recipe supports. that your new recipe supports.
For example, to support the <filename>qemux86</filename> For example, to support the
and <filename>qemux86-64</filename> machines, use <filename>qemux86</filename> and
<filename>qemux86-64</filename> machines, use
the following form: the following form:
<literallayout class='monospaced'> <literallayout class='monospaced'>
COMPATIBLE_MACHINE = "qemux86|qemux86-64" COMPATIBLE_MACHINE = "qemux86|qemux86-64"
</literallayout></para></listitem> </literallayout>
</itemizedlist></para></listitem> </para></listitem>
<listitem><para>Provide further customizations to your recipe </itemizedlist>
</para></listitem>
<listitem><para>
<emphasis>Customize Your Recipe as Needed:</emphasis>
Provide further customizations to your recipe
as needed just as you would customize an existing as needed just as you would customize an existing
linux-yocto recipe. linux-yocto recipe.
See the "<link linkend='modifying-an-existing-recipe'>Modifying See the
an Existing Recipe</link>" section for information. "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
section for information.
</para></listitem> </para></listitem>
</orderedlist> </orderedlist>
</para> </para>