From 294dddb6d3ddc94fd4b17c9fe997491a63f12002 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Wed, 20 Sep 2017 16:53:58 -0700 Subject: kernel-dev: Updates to the traditional kernel development flow section. (From yocto-docs rev: d81143d6ae27e2e360f923bde8e578e583a969a1) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/kernel-dev/kernel-dev-common.xml | 92 ++++++++++++++------------ 1 file changed, 51 insertions(+), 41 deletions(-) (limited to 'documentation/kernel-dev/kernel-dev-common.xml') diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index 6179883c48..9f8ac2d715 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -284,12 +284,14 @@ Before you can do anything using BitBake, you need to initialize the BitBake build environment by sourcing a build environment script - (i.e. oe-init-build-env - or - oe-init-build-env-memres). + (i.e. oe-init-build-env). Also, for this example, be sure that the local branch you have checked out for poky is - the Yocto Project &DISTRO_NAME; branch: + the Yocto Project &DISTRO_NAME; branch. + If you need to checkout out the &DISTRO_NAME; branch, + see the + "Checking out by Branch in Poky" + section in the Yocto Project Development Manual. $ cd ~/poky $ git branch @@ -534,7 +536,7 @@ meta-mylayer/recipes-kernel/linux directory and create the kernel's append file. This example uses the - linux-yocto_4.12 kernel. + linux-yocto-4.12 kernel. Thus, the name of the append file is linux-yocto_4.12.bbappend: @@ -1240,12 +1242,6 @@ "Getting Ready for Traditional Kernel Development" Section. - - - - Also, for more information on patching the kernel, see the - "Applying Patches" - section. Edit the Source Files @@ -1338,10 +1334,10 @@ Build the Image: - With the source modified, staged, and committed, and - the local.conf file pointing to - the kernel files, you can now use BitBake to build the - image: + With the source modified, your changes staged and + committed, and the local.conf file + pointing to the kernel files, you can now use BitBake to + build the image: $ cd ~/poky/build $ bitbake core-image-minimal @@ -1383,47 +1379,61 @@ - Make Changes to Use Patch Files During Subsequent Builds: + Move the Patch File to Your Layer: In order for subsequent builds to pick up patches, you - need to make some changes in your layer. - This example created the layer - meta-mylayer earlier with basically - just a bblayers.conf file. - To get it ready for subsequent builds that automatically - apply patches, you need to create an kernel recipe append - file. - - Move to the meta-mylayer - directory and create some extra structure in your layer: + need to move the patch file you created in the previous + step to your layer meta-mylayer. + For this example, the layer created earlier is located + in your home directory as meta-mylayer. + When the layer was created using the + yocto-create script, no additional + hierarchy was created to support patches. + Before moving the patch file, you need to add additional + structure to your layer using the following commands: - $ cd ~/poky/meta-mylayer + $ cd ~/meta-mylayer $ mkdir recipes-kernel $ mkdir recipes-kernel/linux $ mkdir recipes-kernel/linux/linux-yocto - - - In the - recipes-kernel/linux/linux-yocto - directory, create an append file named - linux-yocto_4.12.bbappend with the - following contents: + + Once you have created this hierarchy in your layer, you can + move the patch file using the following command: + + $ mv ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto + + + + Create the Append File: + Finally, you need to create the + linux-yocto_4.12.bbappend file and + insert statements that allow the OpenEmbedded build + system to find the patch. + The append file needs to be in your layer's + recipes-kernel/linux + directory and it must be named + linux-yocto_4.12.bbappend and have + the following contents: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - SRC_URI += "file://0001-calibrate.c-Added-some-printk-statements.patch" + SRC_URI_append = " file://0001-calibrate.c-Added-some-printk-statements.patch" The FILESEXTRAPATHS and SRC_URI statements enable the OpenEmbedded build system to find - the patch file. - For more information on using append files, see the - "Using .bbappend Files in Your Layer"" - section in the Yocto Project Development Manual. + the patch file. - Move the patch file you created in the earlier step - to the TBD + For more information on append files and patches, + see the + "Creating the Append File" + and + "Applying Patches" + sections. + You can also see the + "Using .bbappend Files in Your Layer"" + section in the Yocto Project Development Manual. -- cgit v1.2.3-54-g00ecf