From dbd5778d749871be99cb25843de6409c8807d5f7 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 11 Oct 2012 14:27:48 -0700 Subject: documentation: dev-manual - edits to the patching the kernel and model sections. Made changes to try and clean up the process. (From yocto-docs rev: 9c4fbcb473dc594647ba8779162379a745f8f8d6) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 72 ++++++++++++++-------- documentation/dev-manual/dev-manual-model.xml | 5 ++ 2 files changed, 52 insertions(+), 25 deletions(-) (limited to 'documentation') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 98e5e59393..5ba1ff0173 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1623,7 +1623,15 @@ calibrate.c source code file. Applying the patch and booting the modified image causes the added messages to appear on the emulator's console. - + + + + The example assumes a clean build exists for the x86qemu + machine in a Source Directory named poky. + Furthermore, the Build Directory is + build and is located in poky and + the kernel is based on the Linux 3.4 kernel. +
Create a Layer for your Changes @@ -1635,7 +1643,7 @@ $mkdir meta-mylayer Creating a directory that follows the Yocto Project layer naming - conventions sets up the area for your layer. + conventions sets up the area 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 @@ -1658,20 +1666,18 @@ ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}-${PV}-${PR} - Assuming a recent build for the qemux86 machine - based on the Linux 3.4 kernel, a - Source Directory named poky, and - the existence of a default build directory, the directory that - holds the temporary source code would be here: + For this example, the directory that + holds the temporary source code is here: ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+5bdc...85f-r4.3 - Within the linux directory, you find the source directories. + Within the linux directory, you find directories for + the source. For this example, we are going to patch the init/calibrate.c file - and add some simple console printk statements that we can + by adding some simple console printk statements that we can see when we boot the image using QEMU.
@@ -1686,11 +1692,11 @@ - To create the patch for the calibrate.c, follow the steps - outlined in the + To create the patch for the calibrate.c, follow steps + 3 through 12 outlined in the "Using a Git Workflow" section. - For the steps used to edit the source file, do the following: + For step 6 (Edit the Files), do the following: @@ -1737,16 +1743,30 @@ Get Your Layer Setup for the Build - At this point, you have a patch file in the same directory as your original - calibrate.c. - Move it to your layer and place it in a separate folder having the same - name as the recipe, which is linux-yocto in this case. + At this point, you have a patch file in the kernel's source code directory. + The patch file is named according to the commit's summary line and ends + with .patch. + For this example, it is named 0001-calibrate.c.patch. + + + + You need to move the patch file to your layer next. + The patch file needs to reside in the + meta-mylayer/recipes-kernel/linux/linux-yocto directory. + Create this directory path within your layer and move the patch file. + This directory path mirrors that used by the main kernel recipe in + the Source Directory (poky). + + $ cd ~/poky/meta-mylayer + $ mkdir recipes-kernel + $ mkdir recipes-kernel/linux + $ mkdir recipes-kernel/linux/linux-yocto + - Next, you need to set up your conf directory in your layer. - Create the conf and create the layer.conf - file. + Next, you need to create a conf directory in your layer + and within it create the layer.conf file. You can find information on this in the "Creating Your Own Layer" section. @@ -1807,12 +1827,14 @@ /home/scottrif/poky/meta-mylayer \ " - Create a bbappend File: You need to have - an append file to the main 3.4 kernel recipe. - Locate the append file in your meta-mylayer layer. - It needs to be in a meta-mylayer/recipes-kernel/linux directory. - Create the directory and use the following for the append file. - This example assumes patch file is named 0001-documentation-calibrate.c.patch: + Create a bbappend File: You need to create + an append file for the main 3.4 kernel recipe. + Create the append file in the linux directory you + created earlier within your layer. + Assuming the patch file is named + 0001-documentation-calibrate.c.patch, your append + file, which must be named linux-yocto_3.4.bbappend, + has these statements: FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/documentation/dev-manual/dev-manual-model.xml b/documentation/dev-manual/dev-manual-model.xml index 03bb83096e..436ecb6fb7 100644 --- a/documentation/dev-manual/dev-manual-model.xml +++ b/documentation/dev-manual/dev-manual-model.xml @@ -1730,6 +1730,11 @@ directory. "Building an Image" section of the Yocto Project Quick Start. + Change Your Working Directory: + After making your edits, move back to the directory from which you + initialized the Git repository. + Returning to this directory ensures you are using the correct branch when + you go to commit your changes. See the List of Files You Changed: Use the git status command to see what files you have actually edited. The ability to have Git track the files you have changed is an advantage that this -- cgit v1.2.3-54-g00ecf