From: Scott Rifenbark Date: Wed, 20 Sep 2017 17:11:11 +0000 (-0700) Subject: kernel-dev: Updates to layer creation steps for kernel examples. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d70911d4e580d1da8b9b4e3c2c06bf75217ce57;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git kernel-dev: Updates to layer creation steps for kernel examples. (From yocto-docs rev: 8044f6e255905f3e4798d20e6e89aaa93d2892fb) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index dcce83fc0e7..24feb94b796 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -468,7 +468,8 @@ BitBake append files (.bbappend) and provides a convenient mechanism to create your own recipe files - (.bb). + (.bb) as well as store and use kernel + patch files. For background information on working with layers, see the "Understanding and Creating Layers" section in the Yocto Project Development Manual. @@ -485,8 +486,9 @@ - Following is a detailed example showing how to create a layer - without the aid of tools for building the kernel: + To better understand the layer you create for kernel development, + the following section describes how to create a layer + without the aid of tools: Create additional structure: @@ -498,9 +500,10 @@ $ mkdir recipes-kernel/linux $ mkdir recipes-kernel/linux/linux-yocto - The conf directory holds your configuration files, while the - recipes-kernel directory holds your append file and - your patch file. + The conf directory holds your + configuration files, while the + recipes-kernel directory holds your + append file and eventual patch files. Create the layer configuration file: @@ -519,29 +522,35 @@ BBFILE_PATTERN_mylayer = "^${LAYERDIR}/" BBFILE_PRIORITY_mylayer = "5" - Notice mylayer as part of the last three - statements. + Notice mylayer as part of the last + three statements. + Create the kernel recipe append file: - Move to the meta-mylayer/recipes-kernel/linux directory and create - the linux-yocto_3.4.bbappend file as follows: + Move to the + meta-mylayer/recipes-kernel/linux + directory and create the kernel's append file. + This example uses the + linux-yocto_4.12 kernel. + Thus, the name of the append file is + linux-yocto_4.12.bbappend: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - SRC_URI += "file://0001-calibrate-Add-printk-example.patch" + SRC_URI += "file://patch-file-one" + SRC_URI += "file://patch-file-two" + SRC_URI += "file://patch-file-three" - The FILESEXTRAPATHS - and SRC_URI - statements enable the OpenEmbedded build system to find the patch file. + The + FILESEXTRAPATHS + and + SRC_URI + statements enable the OpenEmbedded build system to find + patch files. For more information on using append files, see the "Using .bbappend Files in Your Layer" section in the Yocto Project Development Manual. - - Put the patch file in your layer: - Move the 0001-calibrate-Add-printk-example.patch file to - the meta-mylayer/recipes-kernel/linux/linux-yocto - directory. @@ -1371,16 +1380,47 @@ - Prepare Your Layer for Subsequent Builds: - In order for subsequent builds to pick up patches, the - patches need to be stored in a layer. + Make Changes to Use Patch Files During Subsequent Builds: + 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 but left it - pretty much empty. + meta-mylayer earlier with basically + just a bblayers.conf file. To get it ready for subsequent builds that automatically - apply patches, follow the steps in the - "Creating and Preparing a Layer" - section. + 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: + + $ cd ~/poky/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: + + FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + + SRC_URI += "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. + + Move the patch file you created in the earlier step + to the TBD