[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7535/8267] dev-manual, kernel-dev, sdk-manual: Moved patching kernel section
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7535/8267] dev-manual, kernel-dev, sdk-manual: Moved patching kernel section
- Date: Sun, 17 Dec 2017 06:23:04 +0000 (UTC)
commit a99c2c5581f8847fa3d95696f0f985ea87f9da9d
Author: Scott Rifenbark <srifenbark gmail com>
Date: Tue Aug 15 15:52:21 2017 -0700
dev-manual, kernel-dev, sdk-manual: Moved patching kernel section
Moved the "Patching the Kernel" section, which was in the
dev-manual to the kernel-dev manual. During the move,
renamed the section to "Using devtool to Patch the Kernel".
This move bothered a lot of links so I had to fix them in
various manuals.
(From yocto-docs rev: a000be1eddf33e4d7de8f350e076d48e27ca4b98)
Signed-off-by: Scott Rifenbark <srifenbark gmail com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
.../dev-manual/dev-manual-common-tasks.xml | 341 ------------------
documentation/kernel-dev/kernel-dev-common.xml | 364 +++++++++++++++++++-
.../kernel-dev/kernel-dev-concepts-appx.xml | 5 +-
documentation/kernel-dev/kernel-dev-intro.xml | 8 +-
documentation/sdk-manual/sdk-working-projects.xml | 6 +-
5 files changed, 366 insertions(+), 358 deletions(-)
---
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml
b/documentation/dev-manual/dev-manual-common-tasks.xml
index 5a00533..e88d4a7 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -6625,347 +6625,6 @@ Some notes from Cal:
</section>
</section>
- <section id="patching-the-kernel">
- <title>Patching the Kernel</title>
-
- <para>
- Patching the kernel involves changing or adding configurations to an existing kernel,
- changing or adding recipes to the kernel that are needed to support specific hardware features,
- or even altering the source code itself.
- <note>
- You can use the <filename>yocto-kernel</filename> script
- found in the <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
- under <filename>scripts</filename> to manage kernel patches and configuration.
- See the "<ulink
url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches
and Config Items with yocto-kernel</ulink>"
- section in the Yocto Project Board Support Packages (BSP) Developer's Guide for
- more information.</note>
- </para>
-
- <para>
- This example creates a simple patch by adding some QEMU emulator console
- output at boot time through <filename>printk</filename> statements in the kernel's
- <filename>calibrate.c</filename> source code file.
- Applying the patch and booting the modified image causes the added
- messages to appear on the emulator's console.
- </para>
-
- <para>
- The example assumes a clean build exists for the <filename>qemux86</filename>
- machine in a
- <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
- named <filename>poky</filename>.
- Furthermore, the
- <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
- is <filename>build</filename> and is located in
- <filename>poky</filename> and the kernel is based on the
- Linux 3.4 kernel.
- </para>
-
- <para>
- Also, for more information on patching the kernel, see the
- "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#applying-patches'>Applying Patches</ulink>"
- section in the Yocto Project Linux Kernel Development Manual.
- </para>
-
- <section id='create-a-layer-for-your-changes'>
- <title>Create a Layer for your Changes</title>
-
- <para>
- The first step is to create a layer so you can isolate your
- changes.
- Rather than use the <filename>yocto-layer</filename> script
- to create the layer, this example steps through the process
- by hand.
- If you want information on the script that creates a general
- layer, see the
- "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General
Layer Using the yocto-layer Script</link>"
- section.
- </para>
-
- <para>
- These two commands create a directory you can use for your
- layer:
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ mkdir meta-mylayer
- </literallayout>
- Creating a directory that follows the Yocto Project layer naming
- conventions sets up the layer for your changes.
- The layer is where you place your configuration files, append
- files, and patch files.
- To learn more about creating a layer and filling it with the
- files you need, see the "<link linkend='understanding-and-creating-layers'>Understanding
- and Creating Layers</link>" section.
- </para>
- </section>
-
- <section id='finding-the-kernel-source-code'>
- <title>Finding the Kernel Source Code</title>
-
- <para>
- Each time you build a kernel image, the kernel source code
- is fetched and unpacked into the following directory:
- <literallayout class='monospaced'>
- ${S}/linux
- </literallayout>
- See the "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source
Code</link>"
- section and the
- <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable
- for more information about where source is kept during a build.
- </para>
-
- <para>
- For this example, we are going to patch the
- <filename>init/calibrate.c</filename> file
- by adding some simple console <filename>printk</filename> statements that we can
- see when we boot the image using QEMU.
- </para>
- </section>
-
- <section id='creating-the-patch'>
- <title>Creating the Patch</title>
-
- <para>
- Two methods exist by which you can create the patch:
- <ulink
url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename></ulink>
- and
- <link linkend='using-a-quilt-workflow'>Quilt</link>.
- For kernel patches, the Git workflow is more appropriate.
- This section assumes the Git workflow and shows the steps specific to
- this example.
- <orderedlist>
- <listitem><para><emphasis>Change the working directory</emphasis>:
- Change to where the kernel source code is before making
- your edits to the <filename>calibrate.c</filename> file:
- <literallayout class='monospaced'>
- $ cd ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-${PV}-${PR}/linux
- </literallayout>
- Because you are working in an established Git repository,
- you must be in this directory in order to commit your changes
- and create the patch file.
- <note>The <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
and
- <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
variables
- represent the version and revision for the
- <filename>linux-yocto</filename> recipe.
- The <filename>PV</filename> variable includes the Git meta and machine
- hashes, which make the directory name longer than you might
- expect.
- </note></para></listitem>
- <listitem><para><emphasis>Edit the source file</emphasis>:
- Edit the <filename>init/calibrate.c</filename> file to have the
- following changes:
- <literallayout class='monospaced'>
- void calibrate_delay(void)
- {
- unsigned long lpj;
- static bool printed;
- int this_cpu = smp_processor_id();
-
- printk("*************************************\n");
- printk("* *\n");
- printk("* HELLO YOCTO KERNEL *\n");
- printk("* *\n");
- printk("*************************************\n");
-
- if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
- .
- .
- .
- </literallayout></para></listitem>
- <listitem><para><emphasis>Stage and commit your changes</emphasis>:
- These Git commands display the modified file, stage it, and then
- commit the file:
- <literallayout class='monospaced'>
- $ git status
- $ git add init/calibrate.c
- $ git commit -m "calibrate: Add printk example"
- </literallayout></para></listitem>
- <listitem><para><emphasis>Generate the patch file</emphasis>:
- This Git command creates the a patch file named
- <filename>0001-calibrate-Add-printk-example.patch</filename>
- in the current directory.
- <literallayout class='monospaced'>
- $ git format-patch -1
- </literallayout>
- </para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='set-up-your-layer-for-the-build'>
- <title>Set Up Your Layer for the Build</title>
-
- <para>These steps get your layer set up for the build:
- <orderedlist>
- <listitem><para><emphasis>Create additional structure</emphasis>:
- Create the additional layer structure:
- <literallayout class='monospaced'>
- $ cd ~/poky/meta-mylayer
- $ mkdir conf
- $ mkdir recipes-kernel
- $ mkdir recipes-kernel/linux
- $ mkdir recipes-kernel/linux/linux-yocto
- </literallayout>
- The <filename>conf</filename> directory holds your configuration files, while the
- <filename>recipes-kernel</filename> directory holds your append file and
- your patch file.</para></listitem>
- <listitem><para><emphasis>Create the layer configuration file</emphasis>:
- Move to the <filename>meta-mylayer/conf</filename> directory and create
- the <filename>layer.conf</filename> file as follows:
- <literallayout class='monospaced'>
- # We have a conf and classes directory, add to BBPATH
- BBPATH .= ":${LAYERDIR}"
-
- # We have recipes-* directories, add to BBFILES
- BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
- ${LAYERDIR}/recipes-*/*/*.bbappend"
-
- BBFILE_COLLECTIONS += "mylayer"
- BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
- BBFILE_PRIORITY_mylayer = "5"
- </literallayout>
- Notice <filename>mylayer</filename> as part of the last three
- statements.</para></listitem>
- <listitem><para><emphasis>Create the kernel recipe append file</emphasis>:
- Move to the <filename>meta-mylayer/recipes-kernel/linux</filename> directory and
create
- the <filename>linux-yocto_3.4.bbappend</filename> file as follows:
- <literallayout class='monospaced'>
- FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
- SRC_URI += "file://0001-calibrate-Add-printk-example.patch"
- </literallayout>
- The <ulink
url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
- and <ulink
url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
- statements enable the OpenEmbedded build system to find the patch file.
- For more information on using append files, see the
- "<link linkend='using-bbappend-files'>Using .bbappend Files in Your Layer</link>"
- section.
- </para></listitem>
- <listitem><para><emphasis>Put the patch file in your layer</emphasis>:
- Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to
- the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename>
- directory.</para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='set-up-for-the-build'>
- <title>Set Up for the Build</title>
-
- <para>
- Do the following to make sure the build parameters are set up for the example.
- Once you set up these build parameters, they do not have to change unless you
- change the target architecture of the machine you are building:
- <itemizedlist>
- <listitem><para><emphasis>Build for the correct target architecture:</emphasis> Your
- selected <ulink
url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
- definition within the <filename>local.conf</filename> file in the
- <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
- specifies the target architecture used when building the Linux kernel.
- By default, <filename>MACHINE</filename> is set to
- <filename>qemux86</filename>, which specifies a 32-bit
- <trademark class='registered'>Intel</trademark> Architecture
- target machine suitable for the QEMU emulator.</para></listitem>
- <listitem><para><emphasis>Identify your <filename>meta-mylayer</filename>
- layer:</emphasis> The
- <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
- variable in the
- <filename>bblayers.conf</filename> file found in the
- <filename>poky/build/conf</filename> directory needs to have the path to your local
- <filename>meta-mylayer</filename> layer.
- By default, the <filename>BBLAYERS</filename> variable contains paths to
- <filename>meta</filename>, <filename>meta-poky</filename>, and
- <filename>meta-yocto-bsp</filename> in the
- <filename>poky</filename> Git repository.
- Add the path to your <filename>meta-mylayer</filename> location:
- <literallayout class='monospaced'>
- BBLAYERS ?= " \
- $HOME/poky/meta \
- $HOME/poky/meta-poky \
- $HOME/poky/meta-yocto-bsp \
- $HOME/poky/meta-mylayer \
- "
- </literallayout></para></listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section id='build-the-modified-qemu-kernel-image'>
- <title>Build the Modified QEMU Kernel Image</title>
-
- <para>
- The following steps build your modified kernel image:
- <orderedlist>
- <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>:
- Your environment should be set up since you previously sourced
- the
- <ulink
url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
- script.
- If it is not, source the script again from <filename>poky</filename>.
- <literallayout class='monospaced'>
- $ cd ~/poky
- $ source &OE_INIT_FILE;
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Clean up</emphasis>:
- Be sure to clean the shared state out by using BitBake
- to run from within the Build Directory the
- <ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>
- task as follows:
- <literallayout class='monospaced'>
- $ bitbake -c cleansstate linux-yocto
- </literallayout></para>
- <para>
- <note>
- Never remove any files by hand from the
- <filename>tmp/deploy</filename>
- directory inside the
- <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
- Always use the various BitBake clean tasks to
- clear out previous build artifacts.
- For information on the clean tasks, see the
- "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>",
- "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>",
- and
- "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>"
- sections all in the Yocto Project Reference
- Manual.
- </note>
- </para></listitem>
- <listitem><para><emphasis>Build the image</emphasis>:
- Next, build the kernel image using this command:
- <literallayout class='monospaced'>
- $ bitbake -k linux-yocto
- </literallayout></para></listitem>
- </orderedlist>
- </para>
- </section>
-
- <section id='boot-the-image-and-verify-your-changes'>
- <title>Boot the Image and Verify Your Changes</title>
-
- <para>
- These steps boot the image and allow you to see the changes
- <orderedlist>
- <listitem><para><emphasis>Boot the image</emphasis>:
- Boot the modified image in the QEMU emulator
- using this command:
- <literallayout class='monospaced'>
- $ runqemu qemux86
- </literallayout></para></listitem>
- <listitem><para><emphasis>Verify the changes</emphasis>:
- Log into the machine using <filename>root</filename> with no password and then
- use the following shell command to scroll through the console's boot output.
- <literallayout class='monospaced'>
- # dmesg | less
- </literallayout>
- You should see the results of your <filename>printk</filename> statements
- as part of the output.</para></listitem>
- </orderedlist>
- </para>
- </section>
- </section>
-
<section id='making-images-more-secure'>
<title>Making Images More Secure</title>
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml
index bb50a7d..c55f68b 100644
--- a/documentation/kernel-dev/kernel-dev-common.xml
+++ b/documentation/kernel-dev/kernel-dev-common.xml
@@ -75,9 +75,8 @@
See the "<link linkend='creating-and-preparing-a-layer'>Creating and Preparing a Layer</link>"
section for some general resources.
You can also see the
- "<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the
Build</ulink>" section
- of the Yocto Project Development Manual for a detailed
- example.
+ "<link linkend='set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</link>"
+ section for a detailed example.
</para>
<section id='creating-the-append-file'>
@@ -295,9 +294,10 @@
</para>
<para>
- For a detailed example showing how to patch the kernel, see the
- "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>"
- section in the Yocto Project Development Manual.
+ For a detailed example showing how to patch the kernel using
+ <filename>devtool</filename>, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to
Patch the Kernel</link>"
+ section.
</para>
</section>
@@ -449,6 +449,354 @@
</section>
</section>
+ <section id="using-devtool-to-patch-the-kernel">
+ <title>Using <filename>devtool</filename> to Patch the Kernel</title>
+
+ <para>
+ Patching the kernel involves changing or adding configurations to an existing kernel,
+ changing or adding recipes to the kernel that are needed to support specific hardware features,
+ or even altering the source code itself.
+ <note>
+ You can use the <filename>yocto-kernel</filename> script
+ found in the <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ under <filename>scripts</filename> to manage kernel patches and configuration.
+ See the "<ulink
url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches
and Config Items with yocto-kernel</ulink>"
+ section in the Yocto Project Board Support Packages (BSP) Developer's Guide for
+ more information.</note>
+ </para>
+
+ <para>
+ This example creates a simple patch by adding some QEMU emulator console
+ output at boot time through <filename>printk</filename> statements in the kernel's
+ <filename>calibrate.c</filename> source code file.
+ Applying the patch and booting the modified image causes the added
+ messages to appear on the emulator's console.
+ </para>
+
+ <para>
+ The example assumes a clean build exists for the <filename>qemux86</filename>
+ machine in a
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ named <filename>poky</filename>.
+ Furthermore, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ is <filename>build</filename> and is located in
+ <filename>poky</filename> and the kernel is based on the
+ Linux 3.4 kernel.
+ </para>
+
+ <para>
+ Also, for more information on patching the kernel, see the
+ "<link linkend='applying-patches'>Applying Patches</link>"
+ section.
+ </para>
+
+ <section id='create-a-layer-for-your-changes'>
+ <title>Create a Layer for your Changes</title>
+
+ <para>
+ The first step is to create a layer so you can isolate your
+ changes.
+ Rather than use the <filename>yocto-layer</filename> script
+ to create the layer, this example steps through the process
+ by hand.
+ If you want information on the script that creates a general
+ layer, see the
+ "<ulink
url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer
Using the yocto-layer Script</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+
+ <para>
+ These two commands create a directory you can use for your
+ layer:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ mkdir meta-mylayer
+ </literallayout>
+ Creating a directory that follows the Yocto Project layer naming
+ conventions sets up the layer for your changes.
+ The layer is where you place your configuration files, append
+ files, and patch files.
+ To learn more about creating a layer and filling it with the
+ files you need, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and
Creating Layers</ulink>"
+ section in the Yocto Project Development Manual.
+ </para>
+ </section>
+
+ <section id='finding-the-kernel-source-code'>
+ <title>Finding the Kernel Source Code</title>
+
+ <para>
+ Each time you build a kernel image, the kernel source code
+ is fetched and unpacked into the following directory:
+ <literallayout class='monospaced'>
+ ${S}/linux
+ </literallayout>
+ See the "<ulink url='&YOCTO_DOCS_DEV_URL;#finding-the-temporary-source-code'>Finding
Temporary Source Code</ulink>"
+ section in the Yocto Project Development Manual and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable for more information about where source is kept
+ during a build.
+ </para>
+
+ <para>
+ For this example, we are going to patch the
+ <filename>init/calibrate.c</filename> file
+ by adding some simple console <filename>printk</filename> statements that we can
+ see when we boot the image using QEMU.
+ </para>
+ </section>
+
+ <section id='creating-the-patch'>
+ <title>Creating the Patch</title>
+
+ <para>
+ Two methods exist by which you can create the patch:
+ <ulink
url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_DEV_URL;#using-a-quilt-workflow'>Quilt</ulink>.
+ For kernel patches, the Git workflow is more appropriate.
+ This section assumes the Git workflow and shows the steps
+ specific to this example.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Change the working directory</emphasis>:
+ Change to where the kernel source code is before making
+ your edits to the <filename>calibrate.c</filename> file:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-${PV}-${PR}/linux
+ </literallayout>
+ Because you are working in an established Git repository,
+ you must be in this directory in order to commit your changes
+ and create the patch file.
+ <note>The <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
variables
+ represent the version and revision for the
+ <filename>linux-yocto</filename> recipe.
+ The <filename>PV</filename> variable includes the Git meta and machine
+ hashes, which make the directory name longer than you might
+ expect.
+ </note></para></listitem>
+ <listitem><para>
+ <emphasis>Edit the source file</emphasis>:
+ Edit the <filename>init/calibrate.c</filename> file to have the
+ following changes:
+ <literallayout class='monospaced'>
+ void calibrate_delay(void)
+ {
+ unsigned long lpj;
+ static bool printed;
+ int this_cpu = smp_processor_id();
+
+ printk("*************************************\n");
+ printk("* *\n");
+ printk("* HELLO YOCTO KERNEL *\n");
+ printk("* *\n");
+ printk("*************************************\n");
+
+ if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
+ .
+ .
+ .
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Stage and commit your changes</emphasis>:
+ These Git commands display the modified file, stage it, and then
+ commit the file:
+ <literallayout class='monospaced'>
+ $ git status
+ $ git add init/calibrate.c
+ $ git commit -m "calibrate: Add printk example"
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Generate the patch file</emphasis>:
+ This Git command creates the a patch file named
+ <filename>0001-calibrate-Add-printk-example.patch</filename>
+ in the current directory.
+ <literallayout class='monospaced'>
+ $ git format-patch -1
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='set-up-your-layer-for-the-build'>
+ <title>Set Up Your Layer for the Build</title>
+
+ <para>These steps get your layer set up for the build:
+ <orderedlist>
+ <listitem><para><emphasis>Create additional structure</emphasis>:
+ Create the additional layer structure:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/meta-mylayer
+ $ mkdir conf
+ $ mkdir recipes-kernel
+ $ mkdir recipes-kernel/linux
+ $ mkdir recipes-kernel/linux/linux-yocto
+ </literallayout>
+ The <filename>conf</filename> directory holds your configuration files, while the
+ <filename>recipes-kernel</filename> directory holds your append file and
+ your patch file.</para></listitem>
+ <listitem><para><emphasis>Create the layer configuration file</emphasis>:
+ Move to the <filename>meta-mylayer/conf</filename> directory and create
+ the <filename>layer.conf</filename> file as follows:
+ <literallayout class='monospaced'>
+ # We have a conf and classes directory, add to BBPATH
+ BBPATH .= ":${LAYERDIR}"
+
+ # We have recipes-* directories, add to BBFILES
+ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+ BBFILE_COLLECTIONS += "mylayer"
+ BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_mylayer = "5"
+ </literallayout>
+ Notice <filename>mylayer</filename> as part of the last three
+ statements.</para></listitem>
+ <listitem><para><emphasis>Create the kernel recipe append file</emphasis>:
+ Move to the <filename>meta-mylayer/recipes-kernel/linux</filename> directory and
create
+ the <filename>linux-yocto_3.4.bbappend</filename> file as follows:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+ SRC_URI += "file://0001-calibrate-Add-printk-example.patch"
+ </literallayout>
+ The <ulink
url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ and <ulink
url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements enable the OpenEmbedded build system to find the patch file.
+ For more information on using append files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in
Your Layer</ulink>"
+ section in the Yocto Project Development Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Put the patch file in your layer</emphasis>:
+ Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to
+ the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename>
+ directory.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='set-up-for-the-build'>
+ <title>Set Up for the Build</title>
+
+ <para>
+ Do the following to make sure the build parameters are set up for the example.
+ Once you set up these build parameters, they do not have to change unless you
+ change the target architecture of the machine you are building:
+ <itemizedlist>
+ <listitem><para><emphasis>Build for the correct target architecture:</emphasis> Your
+ selected <ulink
url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ definition within the <filename>local.conf</filename> file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ specifies the target architecture used when building the Linux kernel.
+ By default, <filename>MACHINE</filename> is set to
+ <filename>qemux86</filename>, which specifies a 32-bit
+ <trademark class='registered'>Intel</trademark> Architecture
+ target machine suitable for the QEMU emulator.</para></listitem>
+ <listitem><para><emphasis>Identify your <filename>meta-mylayer</filename>
+ layer:</emphasis> The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the
+ <filename>bblayers.conf</filename> file found in the
+ <filename>poky/build/conf</filename> directory needs to have the path to your local
+ <filename>meta-mylayer</filename> layer.
+ By default, the <filename>BBLAYERS</filename> variable contains paths to
+ <filename>meta</filename>, <filename>meta-poky</filename>, and
+ <filename>meta-yocto-bsp</filename> in the
+ <filename>poky</filename> Git repository.
+ Add the path to your <filename>meta-mylayer</filename> location:
+ <literallayout class='monospaced'>
+ BBLAYERS ?= " \
+ $HOME/poky/meta \
+ $HOME/poky/meta-poky \
+ $HOME/poky/meta-yocto-bsp \
+ $HOME/poky/meta-mylayer \
+ "
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='build-the-modified-qemu-kernel-image'>
+ <title>Build the Modified QEMU Kernel Image</title>
+
+ <para>
+ The following steps build your modified kernel image:
+ <orderedlist>
+ <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>:
+ Your environment should be set up since you previously sourced
+ the
+ <ulink
url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ script.
+ If it is not, source the script again from <filename>poky</filename>.
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clean up</emphasis>:
+ Be sure to clean the shared state out by using BitBake
+ to run from within the Build Directory the
+ <ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>
+ task as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -c cleansstate linux-yocto
+ </literallayout></para>
+ <para>
+ <note>
+ Never remove any files by hand from the
+ <filename>tmp/deploy</filename>
+ directory inside the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ Always use the various BitBake clean tasks to
+ clear out previous build artifacts.
+ For information on the clean tasks, see the
+ "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>",
+ "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>",
+ and
+ "<ulink
url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>"
+ sections all in the Yocto Project Reference
+ Manual.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the image</emphasis>:
+ Next, build the kernel image using this command:
+ <literallayout class='monospaced'>
+ $ bitbake -k linux-yocto
+ </literallayout></para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='boot-the-image-and-verify-your-changes'>
+ <title>Boot the Image and Verify Your Changes</title>
+
+ <para>
+ These steps boot the image and allow you to see the changes
+ <orderedlist>
+ <listitem><para><emphasis>Boot the image</emphasis>:
+ Boot the modified image in the QEMU emulator
+ using this command:
+ <literallayout class='monospaced'>
+ $ runqemu qemux86
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Verify the changes</emphasis>:
+ Log into the machine using <filename>root</filename> with no password and then
+ use the following shell command to scroll through the console's boot output.
+ <literallayout class='monospaced'>
+ # dmesg | less
+ </literallayout>
+ You should see the results of your <filename>printk</filename> statements
+ as part of the output.</para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
<section id='using-an-iterative-development-process'>
<title>Using an Iterative Development Process</title>
@@ -747,8 +1095,8 @@
"<link linkend='applying-patches'>Applying Patches</link>"
section.
If you are not familiar with generating patches, refer to the
- "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-the-patch'>Creating the Patch</ulink>"
- section in the Yocto Project Development Manual.
+ "<link linkend='creating-the-patch'>Creating the Patch</link>"
+ section.
</para>
</section>
</section>
diff --git a/documentation/kernel-dev/kernel-dev-concepts-appx.xml
b/documentation/kernel-dev/kernel-dev-concepts-appx.xml
index 7f6b82f..60d67d6 100644
--- a/documentation/kernel-dev/kernel-dev-concepts-appx.xml
+++ b/documentation/kernel-dev/kernel-dev-concepts-appx.xml
@@ -461,9 +461,8 @@
"<link linkend='yocto-linux-kernel-architecture-and-branching-strategies'>Yocto Linux Kernel
Architecture and Branching Strategies</link>"
section.
You can also reference the
- "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>"
- section in the Yocto Project Development Manual for a detailed
- example that modifies the kernel.
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch
the Kernel</link>"
+ section for a detailed example that modifies the kernel.
</para>
</section>
</appendix>
diff --git a/documentation/kernel-dev/kernel-dev-intro.xml b/documentation/kernel-dev/kernel-dev-intro.xml
index 95c50e4..899ed65 100644
--- a/documentation/kernel-dev/kernel-dev-intro.xml
+++ b/documentation/kernel-dev/kernel-dev-intro.xml
@@ -108,12 +108,14 @@
You can find additional information here:
<itemizedlist>
<listitem><para>
- "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>"
- in the Yocto Project Development Manual.
+ The
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to
Patch the Kernel</link>"
+ section.
</para></listitem>
<listitem><para>
+ The
"<ulink url='&YOCTO_DOCS_DEV_URL;#configuring-the-kernel'>Configuring the Kernel</ulink>"
- in the Yocto Project Development Manual.
+ section in the Yocto Project Development Manual.
</para></listitem>
</itemizedlist>
This illustration and the following list summarizes the kernel
diff --git a/documentation/sdk-manual/sdk-working-projects.xml
b/documentation/sdk-manual/sdk-working-projects.xml
index 526d920..da83b1a 100644
--- a/documentation/sdk-manual/sdk-working-projects.xml
+++ b/documentation/sdk-manual/sdk-working-projects.xml
@@ -349,9 +349,9 @@
supported architecture, you can modify the
kernel image before you build it.
See the
- "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the
Kernel</ulink>"
- section in the Yocto Project Development
- manual for an example.
+ "<ulink
url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to
Patch the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel
+ Development Manual for an example.
</para></listitem>
</itemizedlist>
</para></listitem>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]