From ba6aac310680d9ec197fb1db95a925f9a5874c10 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 16 Oct 2012 12:02:10 -0700 Subject: documentation: dev-manual - Edits to "Patching the Kernel" section. Edits according to Darren Hart's feedback. Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 55 ++++++++++------------ 1 file changed, 24 insertions(+), 31 deletions(-) (limited to 'documentation/dev-manual') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index d98e53c335..890ea6e26a 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1620,6 +1620,9 @@ Furthermore, the Build Directory is build and is located in poky and the kernel is based on the Linux 3.4 kernel. + For general information on how to configure the most efficient build, see the + "Building an Image" section + in the Yocto Project Quick Start.
@@ -1654,11 +1657,6 @@ section and the S variable for more information about where source is kept during a build. - 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/linux - @@ -1693,6 +1691,9 @@ PR variables represent the version and revision for the linux-yocto recipe. + The PV variable includes the Git meta and machine + hashes, which make the directory name longer than you might + expect. Edit the source file: Edit the init/calibrate.c file to have the @@ -1717,20 +1718,19 @@ Stage and commit your changes: These Git commands list out the changed file, stage it, and then - commit the files: + commit the file: $ git status $ git add init/calibrate.c - $ git commit + $ git commit -m "calibrate: Add printk example" Generate the patch file: This Git command creates the a patch file named - 0001-calibrate.c.patch in the current directory. + 0001-calibrate: Add printk example.patch + in the current directory. $ git format-patch HEAD~1 - The name of the patch file is based on your commit summary - line. @@ -1776,7 +1776,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - SRC_URI += "file://0001-calibrate.c.patch" + SRC_URI += "file://0001-calibrate: Add printk example.patch" PRINC := "${@int(PRINC) + 1}" @@ -1784,7 +1784,7 @@ statements enable the OpenEmbedded build system to find the patch file. Put the patch file in your layer: - Move the 0001-calibrate.c.patch file to + Move the 0001-calibrate: Add printk example.patch file to the meta-mylayer/recipes-kernel/linux/linux-yocto directory. @@ -1799,22 +1799,14 @@ 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: - Build for the Correct Target Architecture: The - local.conf file in the build directory defines the build's - target architecture. + Build for the Correct Target Architecture: Your + selected MACHINE + definition within the local.conf file in the build directory + specifies the target architecture used when building the Linux kernel. By default, MACHINE is set to qemux86, which specifies a 32-bit Intel Architecture - target machine suitable for the QEMU emulator. - In this example, MACHINE is correctly configured. - - Optimize Build Time: Also in the - local.conf file are two variables that can speed your - build time if your host supports multi-core and multi-thread capabilities: - BB_NUMBER_THREADS and PARALLEL_MAKE. - If the host system has multiple cores then you can optimize build time - by setting both these variables to twice the number of - cores. + target machine suitable for the QEMU emulator. Identify Your meta-mylayer Layer: The BBLAYERS variable in the bblayers.conf file found in the @@ -1847,22 +1839,23 @@ Be sure your build environment is initialized: Your environment should be set up since you previously sourced the &OE_INIT_FILE; script. - If it isn't, source the script again from poky. + If it is not, source the script again from poky. $ cd ~/poky $ source &OE_INIT_FILE; Clean up: - Be sure old images are cleaned out by running the - cleanall BitBake task as follows from your build directory: + Be sure to clean the shared state out by running the + cleansstate BitBake task as follows from your build directory: - $ bitbake -c cleanall linux-yocto + $ bitbake -c cleansstate linux-yocto Never remove any files by hand from the tmp/deploy directory inside the build directory. - Always use the BitBake cleanall task to clear - out previous builds. + Always use the various BitBake clean tasks to clear out previous + build artifacts. + Build the image: Next, build the kernel image using this command: -- cgit v1.2.3-54-g00ecf