summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2012-10-11 14:27:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-15 14:45:50 +0100
commitdbd5778d749871be99cb25843de6409c8807d5f7 (patch)
tree44713618d037787e248baa2ca8d2a26f29f88b42 /documentation
parenteed0d8765ea92f22e26d5b3aec0b9fe98f3af57f (diff)
downloadpoky-dbd5778d749871be99cb25843de6409c8807d5f7.tar.gz
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 <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/dev-manual/dev-manual-common-tasks.xml72
-rw-r--r--documentation/dev-manual/dev-manual-model.xml5
2 files changed, 52 insertions, 25 deletions
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 @@
1623 <filename>calibrate.c</filename> source code file. 1623 <filename>calibrate.c</filename> source code file.
1624 Applying the patch and booting the modified image causes the added 1624 Applying the patch and booting the modified image causes the added
1625 messages to appear on the emulator's console. 1625 messages to appear on the emulator's console.
1626 </para> 1626 </para>
1627
1628 <para>
1629 The example assumes a clean build exists for the <filename>x86qemu</filename>
1630 machine in a Source Directory named <filename>poky</filename>.
1631 Furthermore, the <link linkend='build-directory'>Build Directory</link> is
1632 <filename>build</filename> and is located in <filename>poky</filename> and
1633 the kernel is based on the Linux 3.4 kernel.
1634 </para>
1627 1635
1628 <section id='create-a-layer-for-your-changes'> 1636 <section id='create-a-layer-for-your-changes'>
1629 <title>Create a Layer for your Changes</title> 1637 <title>Create a Layer for your Changes</title>
@@ -1635,7 +1643,7 @@
1635 $mkdir meta-mylayer 1643 $mkdir meta-mylayer
1636 </literallayout> 1644 </literallayout>
1637 Creating a directory that follows the Yocto Project layer naming 1645 Creating a directory that follows the Yocto Project layer naming
1638 conventions sets up the area for your layer. 1646 conventions sets up the area for your changes.
1639 The layer is where you place your configuration files, append 1647 The layer is where you place your configuration files, append
1640 files, and patch files. 1648 files, and patch files.
1641 To learn more about creating a layer and filling it with the 1649 To learn more about creating a layer and filling it with the
@@ -1658,20 +1666,18 @@
1658 <literallayout class='monospaced'> 1666 <literallayout class='monospaced'>
1659 ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}-${PV}-${PR} 1667 ${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}-${PV}-${PR}
1660 </literallayout> 1668 </literallayout>
1661 Assuming a recent build for the <filename>qemux86</filename> machine 1669 For this example, the directory that
1662 based on the Linux 3.4 kernel, a 1670 holds the temporary source code is here:
1663 <link linkend='source-directory'>Source Directory</link> named <filename>poky</filename>, and
1664 the existence of a default <filename>build</filename> directory, the directory that
1665 holds the temporary source code would be here:
1666 <literallayout class='monospaced'> 1671 <literallayout class='monospaced'>
1667 ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+5bdc...85f-r4.3 1672 ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+5bdc...85f-r4.3
1668 </literallayout> 1673 </literallayout>
1669 Within the <filename>linux</filename> directory, you find the source directories. 1674 Within the <filename>linux</filename> directory, you find directories for
1675 the source.
1670 </para> 1676 </para>
1671 1677
1672 <para> 1678 <para>
1673 For this example, we are going to patch the <filename>init/calibrate.c</filename> file 1679 For this example, we are going to patch the <filename>init/calibrate.c</filename> file
1674 and add some simple console <filename>printk</filename> statements that we can 1680 by adding some simple console <filename>printk</filename> statements that we can
1675 see when we boot the image using QEMU. 1681 see when we boot the image using QEMU.
1676 </para> 1682 </para>
1677 </section> 1683 </section>
@@ -1686,11 +1692,11 @@
1686 </para> 1692 </para>
1687 1693
1688 <para> 1694 <para>
1689 To create the patch for the <filename>calibrate.c</filename>, follow the steps 1695 To create the patch for the <filename>calibrate.c</filename>, follow steps
1690 outlined in the 1696 3 through 12 outlined in the
1691 "<link linkend='using-a-git-workflow'>Using a Git Workflow</link>" 1697 "<link linkend='using-a-git-workflow'>Using a Git Workflow</link>"
1692 section. 1698 section.
1693 For the steps used to edit the source file, do the following: 1699 For step 6 (Edit the Files), do the following:
1694 </para> 1700 </para>
1695 1701
1696 <para> 1702 <para>
@@ -1737,16 +1743,30 @@
1737 <title>Get Your Layer Setup for the Build</title> 1743 <title>Get Your Layer Setup for the Build</title>
1738 1744
1739 <para> 1745 <para>
1740 At this point, you have a patch file in the same directory as your original 1746 At this point, you have a patch file in the kernel's source code directory.
1741 <filename>calibrate.c</filename>. 1747 The patch file is named according to the commit's summary line and ends
1742 Move it to your layer and place it in a separate folder having the same 1748 with <filename>.patch</filename>.
1743 name as the recipe, which is <filename>linux-yocto</filename> in this case. 1749 For this example, it is named <filename>0001-calibrate.c.patch</filename>.
1750 </para>
1751
1752 <para>
1753 You need to move the patch file to your layer next.
1754 The patch file needs to reside in the
1755 <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> directory.
1756 Create this directory path within your layer and move the patch file.
1757 This directory path mirrors that used by the main kernel recipe in
1758 the Source Directory (<filename>poky</filename>).
1759 <literallayout class='monospaced'>
1760 $ cd ~/poky/meta-mylayer
1761 $ mkdir recipes-kernel
1762 $ mkdir recipes-kernel/linux
1763 $ mkdir recipes-kernel/linux/linux-yocto
1764 </literallayout>
1744 </para> 1765 </para>
1745 1766
1746 <para> 1767 <para>
1747 Next, you need to set up your <filename>conf</filename> directory in your layer. 1768 Next, you need to create a <filename>conf</filename> directory in your layer
1748 Create the <filename>conf</filename> and create the <filename>layer.conf</filename> 1769 and within it create the <filename>layer.conf</filename> file.
1749 file.
1750 You can find information on this in the 1770 You can find information on this in the
1751 "<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>" 1771 "<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>"
1752 section. 1772 section.
@@ -1807,12 +1827,14 @@
1807 /home/scottrif/poky/meta-mylayer \ 1827 /home/scottrif/poky/meta-mylayer \
1808 " 1828 "
1809 </literallayout></para></listitem> 1829 </literallayout></para></listitem>
1810 <listitem><para><emphasis>Create a bbappend File:</emphasis> You need to have 1830 <listitem><para><emphasis>Create a bbappend File:</emphasis> You need to create
1811 an append file to the main 3.4 kernel recipe. 1831 an append file for the main 3.4 kernel recipe.
1812 Locate the append file in your <filename>meta-mylayer</filename> layer. 1832 Create the append file in the <filename>linux</filename> directory you
1813 It needs to be in a <filename>meta-mylayer/recipes-kernel/linux</filename> directory. 1833 created earlier within your layer.
1814 Create the directory and use the following for the append file. 1834 Assuming the patch file is named
1815 This example assumes patch file is named <filename>0001-documentation-calibrate.c.patch</filename>: 1835 <filename>0001-documentation-calibrate.c.patch</filename>, your append
1836 file, which must be named <filename>linux-yocto_3.4.bbappend</filename>,
1837 has these statements:
1816 <literallayout class='monospaced'> 1838 <literallayout class='monospaced'>
1817 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1839 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
1818 1840
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.</para></listitem>
1730 "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" 1730 "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>"
1731 section of the Yocto Project Quick Start. 1731 section of the Yocto Project Quick Start.
1732 </note></para></listitem> 1732 </note></para></listitem>
1733 <listitem><para><emphasis>Change Your Working Directory:</emphasis>
1734 After making your edits, move back to the directory from which you
1735 initialized the Git repository.
1736 Returning to this directory ensures you are using the correct branch when
1737 you go to commit your changes.</para></listitem>
1733 <listitem><para><emphasis>See the List of Files You Changed:</emphasis> 1738 <listitem><para><emphasis>See the List of Files You Changed:</emphasis>
1734 Use the <filename>git status</filename> command to see what files you have actually edited. 1739 Use the <filename>git status</filename> command to see what files you have actually edited.
1735 The ability to have Git track the files you have changed is an advantage that this 1740 The ability to have Git track the files you have changed is an advantage that this