]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
documentation: dev-manual - edits to the patching the kernel and model sections.
authorScott Rifenbark <scott.m.rifenbark@intel.com>
Thu, 11 Oct 2012 21:27:48 +0000 (14:27 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Oct 2012 13:45:15 +0000 (14:45 +0100)
Made changes to try and clean up the process.

(From yocto-docs rev: 9c4fbcb473dc594647ba8779162379a745f8f8d6)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
documentation/dev-manual/dev-manual-common-tasks.xml
documentation/dev-manual/dev-manual-model.xml

index 98e5e59393030e87adc778599bea84cdff59d0cd..5ba1ff017362304a537e9bf095cc6f9f24e3c2da 100644 (file)
             <filename>calibrate.c</filename> source code file.
             Applying the patch and booting the modified image causes the added 
             messages to appear on the emulator's console.
-        </para> 
+        </para>
+
+        <para>
+            The example assumes a clean build exists for the <filename>x86qemu</filename>
+            machine in a Source Directory named <filename>poky</filename>.
+            Furthermore, the <link linkend='build-directory'>Build Directory</link> is 
+            <filename>build</filename> and is located in <filename>poky</filename> and  
+            the kernel is based on the Linux 3.4 kernel.
+        </para>
 
         <section id='create-a-layer-for-your-changes'>
             <title>Create a Layer for your Changes</title>
      $mkdir meta-mylayer
                 </literallayout>
                 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 
                 <literallayout class='monospaced'>
      ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}-${PV}-${PR}
                 </literallayout>
-                Assuming a recent build for the <filename>qemux86</filename> machine 
-                based on the Linux 3.4 kernel, a  
-                <link linkend='source-directory'>Source Directory</link> named <filename>poky</filename>, and
-                the existence of a default <filename>build</filename> 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:
                 <literallayout class='monospaced'>
      ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+5bdc...85f-r4.3
                 </literallayout>
-                Within the <filename>linux</filename> directory, you find the source directories.
+                Within the <filename>linux</filename> directory, you find directories for 
+                the source.
             </para>
 
             <para>
                 For this example, we are going to patch the <filename>init/calibrate.c</filename> file
-                and add some simple console <filename>printk</filename> statements that we can 
+                by adding some simple console <filename>printk</filename> statements that we can 
                 see when we boot the image using QEMU.
             </para>
         </section> 
             </para>
 
             <para>
-                To create the patch for the <filename>calibrate.c</filename>, follow the steps
-                outlined in the 
+                To create the patch for the <filename>calibrate.c</filename>, follow steps
+                3 through 12 outlined in the 
                 "<link linkend='using-a-git-workflow'>Using a Git Workflow</link>" 
                 section.
-                For the steps used to edit the source file, do the following:
+                For step 6 (Edit the Files), do the following:
             </para>
 
             <para>
             <title>Get Your Layer Setup for the Build</title>
 
            <para>
-               At this point, you have a patch file in the same directory as your original 
-               <filename>calibrate.c</filename>.
-               Move it to your layer and place it in a separate folder having the same 
-               name as the recipe, which is <filename>linux-yocto</filename> 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 <filename>.patch</filename>.
+               For this example, it is named <filename>0001-calibrate.c.patch</filename>.
+           </para>
+
+           <para>
+               You need to move the patch file to your layer next. 
+               The patch file needs to reside in the 
+               <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> 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 (<filename>poky</filename>).
+               <literallayout class='monospaced'>
+     $ cd ~/poky/meta-mylayer
+     $ mkdir recipes-kernel
+     $ mkdir recipes-kernel/linux
+     $ mkdir recipes-kernel/linux/linux-yocto
+               </literallayout> 
            </para>
 
            <para>
-               Next, you need to set up your <filename>conf</filename> directory in your layer. 
-               Create the <filename>conf</filename> and create the <filename>layer.conf</filename>
-               file. 
+               Next, you need to create a <filename>conf</filename> directory in your layer 
+               and within it create the <filename>layer.conf</filename> file. 
                You can find information on this in the 
                "<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>" 
                section. 
        /home/scottrif/poky/meta-mylayer \
        "
                        </literallayout></para></listitem>
-                   <listitem><para><emphasis>Create a bbappend File:</emphasis> You need to have
-                       an append file to the main 3.4 kernel recipe.
-                       Locate the append file in your <filename>meta-mylayer</filename> layer.
-                       It needs to be in a <filename>meta-mylayer/recipes-kernel/linux</filename> directory.
-                       Create the directory and use the following for the append file.
-                       This example assumes patch file is named <filename>0001-documentation-calibrate.c.patch</filename>:
+                   <listitem><para><emphasis>Create a bbappend File:</emphasis> You need to create
+                       an append file for the main 3.4 kernel recipe.
+                       Create the append file in the <filename>linux</filename> directory you  
+                       created earlier within your layer. 
+                       Assuming the patch file is named 
+                       <filename>0001-documentation-calibrate.c.patch</filename>, your append
+                       file, which must be named <filename>linux-yocto_3.4.bbappend</filename>,
+                       has these statements:
                        <literallayout class='monospaced'>
      FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
index 03bb83096e3be4bea2fda54c66928996c3879b3a..436ecb6fb71492ff6e13ce70ce150e4567987932 100644 (file)
@@ -1730,6 +1730,11 @@ directory.</para></listitem>
                     "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" 
                     section of the Yocto Project Quick Start.
                     </note></para></listitem>
+                <listitem><para><emphasis>Change Your Working Directory:</emphasis>
+                    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.</para></listitem>
                 <listitem><para><emphasis>See the List of Files You Changed:</emphasis>
                     Use the <filename>git status</filename> 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