diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2017-09-27 15:19:39 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-10-06 12:06:33 +0100 |
commit | 946fac468e2fb1bd258d083440a56aa52d5beb29 (patch) | |
tree | 2afecec07bc6620ea7d17b568be196602ebd1985 /documentation/kernel-dev | |
parent | 721991dd4ffbf7911a0220a1f56170d6baeab3d7 (diff) | |
download | poky-946fac468e2fb1bd258d083440a56aa52d5beb29.tar.gz |
kernel-dev: Edits to the iteratively modifying source code section
This section has merged into a single topic now. It still needs
work but it is gathered under one heading for now.
(From yocto-docs rev: 660ed8b64dedbab5400c84ec3759cea77c899c40)
Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/kernel-dev')
-rw-r--r-- | documentation/kernel-dev/kernel-dev-common.xml | 175 |
1 files changed, 87 insertions, 88 deletions
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index 9be49848e4..47a61a1552 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml | |||
@@ -814,7 +814,9 @@ | |||
814 | For a detailed example showing how to patch the kernel using | 814 | For a detailed example showing how to patch the kernel using |
815 | <filename>devtool</filename>, see the | 815 | <filename>devtool</filename>, see the |
816 | "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>" | 816 | "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>" |
817 | section. | 817 | and |
818 | "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel'></link>" | ||
819 | sections. | ||
818 | </para> | 820 | </para> |
819 | </section> | 821 | </section> |
820 | 822 | ||
@@ -2113,11 +2115,12 @@ | |||
2113 | </para> | 2115 | </para> |
2114 | </section> | 2116 | </section> |
2115 | 2117 | ||
2116 | <section id='using-an-iterative-development-process'> | 2118 | <section id='iteratively-modifying-source-code'> |
2117 | <title>Using an Iterative Development Process</title> | 2119 | <title>Iteratively Modifying Source Code</title> |
2118 | 2120 | ||
2119 | <para> | 2121 | <para> |
2120 | If you do not have existing patches or configuration files, | 2122 | If you do not have existing patches or configuration files and |
2123 | you are using traditional kernel development methods, | ||
2121 | you can iteratively generate them from within the BitBake build | 2124 | you can iteratively generate them from within the BitBake build |
2122 | environment as described within this section. | 2125 | environment as described within this section. |
2123 | During an iterative workflow, running a previously completed BitBake | 2126 | During an iterative workflow, running a previously completed BitBake |
@@ -2133,95 +2136,91 @@ | |||
2133 | "linux-yocto". | 2136 | "linux-yocto". |
2134 | </para> | 2137 | </para> |
2135 | 2138 | ||
2136 | <section id='modifying-source-code'> | 2139 | <para> |
2137 | <title>Modifying Source Code</title> | 2140 | You can experiment with source code changes and create a |
2138 | 2141 | simple patch without leaving the BitBake environment. | |
2139 | <para> | 2142 | To get started, be sure to complete a build at |
2140 | You can experiment with source code changes and create a | 2143 | least through the kernel configuration task: |
2141 | simple patch without leaving the BitBake environment. | 2144 | <literallayout class='monospaced'> |
2142 | To get started, be sure to complete a build at | ||
2143 | least through the kernel configuration task: | ||
2144 | <literallayout class='monospaced'> | ||
2145 | $ bitbake linux-yocto -c kernel_configme -f | 2145 | $ bitbake linux-yocto -c kernel_configme -f |
2146 | </literallayout> | 2146 | </literallayout> |
2147 | Taking this step ensures you have the sources prepared | 2147 | Taking this step ensures you have the sources prepared |
2148 | and the configuration completed. | 2148 | and the configuration completed. |
2149 | You can find the sources in the build directory within the | 2149 | You can find the sources in the build directory within the |
2150 | <filename>source/</filename> directory, which is a symlink | 2150 | <filename>source/</filename> directory, which is a symlink |
2151 | (i.e. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink><filename>}/source</filename>). | 2151 | (i.e. <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink><filename>}/source</filename>). |
2152 | The <filename>source/</filename> directory expands to | 2152 | The <filename>source/</filename> directory expands to |
2153 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename><filename>/linux-</filename><filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink><filename>}-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink><filename>}-build/source</filename>. | 2153 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename><filename>/linux-</filename><filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink><filename>}-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink><filename>}-build/source</filename>. |
2154 | The directory pointed to by the | 2154 | The directory pointed to by the |
2155 | <filename>source/</filename> symlink is also known as | 2155 | <filename>source/</filename> symlink is also known as |
2156 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink><filename>}</filename>. | 2156 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink><filename>}</filename>. |
2157 | </para> | 2157 | </para> |
2158 | 2158 | ||
2159 | <para> | 2159 | <para> |
2160 | You can edit the sources as you would any other Linux source | 2160 | You can edit the sources as you would any other Linux source |
2161 | tree. | 2161 | tree. |
2162 | However, keep in mind that you will lose changes if you | 2162 | However, keep in mind that you will lose changes if you |
2163 | trigger the | 2163 | trigger the |
2164 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> | 2164 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> |
2165 | task for the recipe. | 2165 | task for the recipe. |
2166 | You can avoid triggering this task by not using BitBake to | 2166 | You can avoid triggering this task by not using BitBake to |
2167 | run the | 2167 | run the |
2168 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>cleanall</filename></ulink>, | 2168 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>cleanall</filename></ulink>, |
2169 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>cleansstate</filename></ulink>, | 2169 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>cleansstate</filename></ulink>, |
2170 | or forced | 2170 | or forced |
2171 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>fetch</filename></ulink> | 2171 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>fetch</filename></ulink> |
2172 | commands. | 2172 | commands. |
2173 | Also, do not modify the recipe itself while working | 2173 | Also, do not modify the recipe itself while working |
2174 | with temporary changes or BitBake might run the | 2174 | with temporary changes or BitBake might run the |
2175 | <filename>fetch</filename> command depending on the | 2175 | <filename>fetch</filename> command depending on the |
2176 | changes to the recipe. | 2176 | changes to the recipe. |
2177 | </para> | 2177 | </para> |
2178 | 2178 | ||
2179 | <para> | 2179 | <para> |
2180 | To test your temporary changes, instruct BitBake to run the | 2180 | To test your temporary changes, instruct BitBake to run the |
2181 | <filename>compile</filename> again. | 2181 | <filename>compile</filename> again. |
2182 | The <filename>-f</filename> option forces the command to run | 2182 | The <filename>-f</filename> option forces the command to run |
2183 | even though BitBake might think it has already done so: | 2183 | even though BitBake might think it has already done so: |
2184 | <literallayout class='monospaced'> | 2184 | <literallayout class='monospaced'> |
2185 | $ bitbake linux-yocto -c compile -f | 2185 | $ bitbake linux-yocto -c compile -f |
2186 | </literallayout> | 2186 | </literallayout> |
2187 | If the compile fails, you can update the sources and repeat | 2187 | If the compile fails, you can update the sources and repeat |
2188 | the <filename>compile</filename>. | 2188 | the <filename>compile</filename>. |
2189 | Once compilation is successful, you can inspect and test | 2189 | Once compilation is successful, you can inspect and test |
2190 | the resulting build (i.e. kernel, modules, and so forth) from | 2190 | the resulting build (i.e. kernel, modules, and so forth) from |
2191 | the following build directory: | 2191 | the following build directory: |
2192 | <literallayout class='monospaced'> | 2192 | <literallayout class='monospaced'> |
2193 | ${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build | 2193 | ${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build |
2194 | </literallayout> | 2194 | </literallayout> |
2195 | Alternatively, you can run the <filename>deploy</filename> | 2195 | Alternatively, you can run the <filename>deploy</filename> |
2196 | command to place the kernel image in the | 2196 | command to place the kernel image in the |
2197 | <filename>tmp/deploy/images</filename> directory: | 2197 | <filename>tmp/deploy/images</filename> directory: |
2198 | <literallayout class='monospaced'> | 2198 | <literallayout class='monospaced'> |
2199 | $ bitbake linux-yocto -c deploy | 2199 | $ bitbake linux-yocto -c deploy |
2200 | </literallayout> | 2200 | </literallayout> |
2201 | And, of course, you can perform the remaining installation and | 2201 | And, of course, you can perform the remaining installation and |
2202 | packaging steps by issuing: | 2202 | packaging steps by issuing: |
2203 | <literallayout class='monospaced'> | 2203 | <literallayout class='monospaced'> |
2204 | $ bitbake linux-yocto | 2204 | $ bitbake linux-yocto |
2205 | </literallayout> | 2205 | </literallayout> |
2206 | </para> | 2206 | </para> |
2207 | 2207 | ||
2208 | <para> | 2208 | <para> |
2209 | For rapid iterative development, the edit-compile-repeat loop | 2209 | For rapid iterative development, the edit-compile-repeat loop |
2210 | described in this section is preferable to rebuilding the | 2210 | described in this section is preferable to rebuilding the |
2211 | entire recipe because the installation and packaging tasks | 2211 | entire recipe because the installation and packaging tasks |
2212 | are very time consuming. | 2212 | are very time consuming. |
2213 | </para> | 2213 | </para> |
2214 | 2214 | ||
2215 | <para> | 2215 | <para> |
2216 | Once you are satisfied with your source code modifications, | 2216 | Once you are satisfied with your source code modifications, |
2217 | you can make them permanent by generating patches and | 2217 | you can make them permanent by generating patches and |
2218 | applying them to the | 2218 | applying them to the |
2219 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | 2219 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> |
2220 | statement as described in the | 2220 | statement as described in the |
2221 | "<link linkend='applying-patches'>Applying Patches</link>" | 2221 | "<link linkend='applying-patches'>Applying Patches</link>" |
2222 | section. | 2222 | section. |
2223 | </para> | 2223 | </para> |
2224 | </section> | ||
2225 | </section> | 2224 | </section> |
2226 | 2225 | ||
2227 | <section id='working-with-your-own-sources'> | 2226 | <section id='working-with-your-own-sources'> |