From 1b23230b655a0ecd976a5a326da16ac1058c2f30 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Wed, 19 Dec 2012 09:54:47 -0600 Subject: kernel-dev: Re-write the "Modifying Source Code" section. (From yocto-docs rev: 5ba8873b3ae182a06964ffc682acbe7b7947bb02) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/kernel-dev/kernel-dev-common.xml | 81 +++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'documentation') diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index 063867dd70..0de39d5686 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -478,7 +478,85 @@ adjust your configuration files and repeat the "kernel_configme" and Modifying Source Code - You can experiment with source code changes and create a simple patch without + You can experiment with source code changes and create a + simple patch without leaving the BitBake environment. + To get started, be sure to complete a build at + least through the kernel configuration task: + + $ bitbake linux-yocto -c kernel_configme -f + + Taking this step ensures you have the sources prepared + and the configuration completed. + You can find the sources in the + ${WORKDIR}/linux directory. + + + + You can edit the sources as you would any other Linux source + tree. + However, keep in mind that you will lose changes if you + trigger the fetch task for the recipe. + You can avoid triggering this task by not issuing BitBake's + cleanall, cleansstate, + or forced fetch commands. + Also, do not modify the recipe itself while working + with temporary changes or BitBake might run the + fetch command depending on the + changes to the recipe. + + + + To test your temporary changes, instruct BitBake to run the + compile again. + The -f option forces the command to run + even though BitBake might think it has already done so: + + $ bitbake linux-yocto -c compile -f + + If the compile fails, you can update the sources and repeat + the compile. + Once compilation is successful, you can inspect and test + the resulting build (i.e. kernel, modules, and so forth) from + the build directory: + + ${WORKDIR}/linux-${MACHINE}-${KTYPE}-build + + Alternatively, you can run the deploy + command to place the kernel image in the + tmp/deploy/images directory: + + $ bitbake linux-yocto -c deploy + + And, of course, you can perform the remaining installation and + packaging steps by issuing: + + $ bitbake linux-yocto + + + + + For rapid iterative development, the edit-compile-repeat loop + described in this section is preferable to rebuilding the + entire recipe because the installation and packaging tasks + are very time consuming. + + + + Once you are satisfied with your source code modifications, + you can make them permanent by generating patches and + applying them to the + SRC_URI + statement as described in section + "Applying Patches" section. + If you are not familiar with generating patches, refer to the + "Creating the Patch" + section in the Yocto Project Development Manual. + + + + Original Text: + +You can experiment with source code changes and create a simple patch without leaving the bitbake environment. To get started, be sure to complete a build at least through the kernel configuration task: @@ -521,6 +599,7 @@ Once you are happy with your modifications, you can make these permanent by generating patches and applying them to the SRC_URI as described in section 2.2.1 Applying Patches. If you are not familiar with generating patches, refer to the Yocto Project Development Manual, section 5.7.3 Creating the Patch. + -- cgit v1.2.3-54-g00ecf