diff options
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 55 |
1 files changed, 24 insertions, 31 deletions
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 @@ | |||
1620 | Furthermore, the <link linkend='build-directory'>Build Directory</link> is | 1620 | Furthermore, the <link linkend='build-directory'>Build Directory</link> is |
1621 | <filename>build</filename> and is located in <filename>poky</filename> and | 1621 | <filename>build</filename> and is located in <filename>poky</filename> and |
1622 | the kernel is based on the Linux 3.4 kernel. | 1622 | the kernel is based on the Linux 3.4 kernel. |
1623 | For general information on how to configure the most efficient build, see the | ||
1624 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" section | ||
1625 | in the Yocto Project Quick Start. | ||
1623 | </para> | 1626 | </para> |
1624 | 1627 | ||
1625 | <section id='create-a-layer-for-your-changes'> | 1628 | <section id='create-a-layer-for-your-changes'> |
@@ -1654,11 +1657,6 @@ | |||
1654 | section and the | 1657 | section and the |
1655 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable | 1658 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable |
1656 | for more information about where source is kept during a build. | 1659 | for more information about where source is kept during a build. |
1657 | For this example, the directory that | ||
1658 | holds the temporary source code is here: | ||
1659 | <literallayout class='monospaced'> | ||
1660 | ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.4.11+git1+5bdc...85f-r4.3/linux | ||
1661 | </literallayout> | ||
1662 | </para> | 1660 | </para> |
1663 | 1661 | ||
1664 | <para> | 1662 | <para> |
@@ -1693,6 +1691,9 @@ | |||
1693 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> variables | 1691 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> variables |
1694 | represent the version and revision for the | 1692 | represent the version and revision for the |
1695 | <filename>linux-yocto</filename> recipe. | 1693 | <filename>linux-yocto</filename> recipe. |
1694 | The <filename>PV</filename> variable includes the Git meta and machine | ||
1695 | hashes, which make the directory name longer than you might | ||
1696 | expect. | ||
1696 | </note></para></listitem> | 1697 | </note></para></listitem> |
1697 | <listitem><para><emphasis>Edit the source file</emphasis>: | 1698 | <listitem><para><emphasis>Edit the source file</emphasis>: |
1698 | Edit the <filename>init/calibrate.c</filename> file to have the | 1699 | Edit the <filename>init/calibrate.c</filename> file to have the |
@@ -1717,20 +1718,19 @@ | |||
1717 | </literallayout></para></listitem> | 1718 | </literallayout></para></listitem> |
1718 | <listitem><para><emphasis>Stage and commit your changes</emphasis>: | 1719 | <listitem><para><emphasis>Stage and commit your changes</emphasis>: |
1719 | These Git commands list out the changed file, stage it, and then | 1720 | These Git commands list out the changed file, stage it, and then |
1720 | commit the files: | 1721 | commit the file: |
1721 | <literallayout class='monospaced'> | 1722 | <literallayout class='monospaced'> |
1722 | $ git status | 1723 | $ git status |
1723 | $ git add init/calibrate.c | 1724 | $ git add init/calibrate.c |
1724 | $ git commit | 1725 | $ git commit -m "calibrate: Add printk example" |
1725 | </literallayout></para></listitem> | 1726 | </literallayout></para></listitem> |
1726 | <listitem><para><emphasis>Generate the patch file</emphasis>: | 1727 | <listitem><para><emphasis>Generate the patch file</emphasis>: |
1727 | This Git command creates the a patch file named | 1728 | This Git command creates the a patch file named |
1728 | <filename>0001-calibrate.c.patch</filename> in the current directory. | 1729 | <filename>0001-calibrate: Add printk example.patch</filename> |
1730 | in the current directory. | ||
1729 | <literallayout class='monospaced'> | 1731 | <literallayout class='monospaced'> |
1730 | $ git format-patch HEAD~1 | 1732 | $ git format-patch HEAD~1 |
1731 | </literallayout> | 1733 | </literallayout> |
1732 | <note>The name of the patch file is based on your commit summary | ||
1733 | line.</note> | ||
1734 | </para></listitem> | 1734 | </para></listitem> |
1735 | </orderedlist> | 1735 | </orderedlist> |
1736 | </para> | 1736 | </para> |
@@ -1776,7 +1776,7 @@ | |||
1776 | <literallayout class='monospaced'> | 1776 | <literallayout class='monospaced'> |
1777 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 1777 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
1778 | 1778 | ||
1779 | SRC_URI += "file://0001-calibrate.c.patch" | 1779 | SRC_URI += "file://0001-calibrate: Add printk example.patch" |
1780 | 1780 | ||
1781 | PRINC := "${@int(PRINC) + 1}" | 1781 | PRINC := "${@int(PRINC) + 1}" |
1782 | </literallayout> | 1782 | </literallayout> |
@@ -1784,7 +1784,7 @@ | |||
1784 | statements enable the OpenEmbedded build system to find the patch file. | 1784 | statements enable the OpenEmbedded build system to find the patch file. |
1785 | </para></listitem> | 1785 | </para></listitem> |
1786 | <listitem><para><emphasis>Put the patch file in your layer</emphasis>: | 1786 | <listitem><para><emphasis>Put the patch file in your layer</emphasis>: |
1787 | Move the <filename>0001-calibrate.c.patch</filename> file to | 1787 | Move the <filename>0001-calibrate: Add printk example.patch</filename> file to |
1788 | the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> | 1788 | the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> |
1789 | directory.</para></listitem> | 1789 | directory.</para></listitem> |
1790 | </orderedlist> | 1790 | </orderedlist> |
@@ -1799,22 +1799,14 @@ | |||
1799 | Once you set up these build parameters, they do not have to change unless you | 1799 | Once you set up these build parameters, they do not have to change unless you |
1800 | change the target architecture of the machine you are building: | 1800 | change the target architecture of the machine you are building: |
1801 | <itemizedlist> | 1801 | <itemizedlist> |
1802 | <listitem><para><emphasis>Build for the Correct Target Architecture:</emphasis> The | 1802 | <listitem><para><emphasis>Build for the Correct Target Architecture:</emphasis> Your |
1803 | <filename>local.conf</filename> file in the build directory defines the build's | 1803 | selected <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
1804 | target architecture. | 1804 | definition within the <filename>local.conf</filename> file in the build directory |
1805 | specifies the target architecture used when building the Linux kernel. | ||
1805 | By default, <filename>MACHINE</filename> is set to | 1806 | By default, <filename>MACHINE</filename> is set to |
1806 | <filename>qemux86</filename>, which specifies a 32-bit | 1807 | <filename>qemux86</filename>, which specifies a 32-bit |
1807 | <trademark class='registered'>Intel</trademark> Architecture | 1808 | <trademark class='registered'>Intel</trademark> Architecture |
1808 | target machine suitable for the QEMU emulator. | 1809 | target machine suitable for the QEMU emulator.</para></listitem> |
1809 | In this example, <filename>MACHINE</filename> is correctly configured. | ||
1810 | </para></listitem> | ||
1811 | <listitem><para><emphasis>Optimize Build Time:</emphasis> Also in the | ||
1812 | <filename>local.conf</filename> file are two variables that can speed your | ||
1813 | build time if your host supports multi-core and multi-thread capabilities: | ||
1814 | <filename>BB_NUMBER_THREADS</filename> and <filename>PARALLEL_MAKE</filename>. | ||
1815 | If the host system has multiple cores then you can optimize build time | ||
1816 | by setting both these variables to twice the number of | ||
1817 | cores.</para></listitem> | ||
1818 | <listitem><para><emphasis>Identify Your <filename>meta-mylayer</filename> | 1810 | <listitem><para><emphasis>Identify Your <filename>meta-mylayer</filename> |
1819 | Layer:</emphasis> The <filename>BBLAYERS</filename> variable in the | 1811 | Layer:</emphasis> The <filename>BBLAYERS</filename> variable in the |
1820 | <filename>bblayers.conf</filename> file found in the | 1812 | <filename>bblayers.conf</filename> file found in the |
@@ -1847,22 +1839,23 @@ | |||
1847 | <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>: | 1839 | <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>: |
1848 | Your environment should be set up since you previously sourced | 1840 | Your environment should be set up since you previously sourced |
1849 | the <filename>&OE_INIT_FILE;</filename> script. | 1841 | the <filename>&OE_INIT_FILE;</filename> script. |
1850 | If it isn't, source the script again from <filename>poky</filename>. | 1842 | If it is not, source the script again from <filename>poky</filename>. |
1851 | <literallayout class='monospaced'> | 1843 | <literallayout class='monospaced'> |
1852 | $ cd ~/poky | 1844 | $ cd ~/poky |
1853 | $ source &OE_INIT_FILE; | 1845 | $ source &OE_INIT_FILE; |
1854 | </literallayout> | 1846 | </literallayout> |
1855 | </para></listitem> | 1847 | </para></listitem> |
1856 | <listitem><para><emphasis>Clean up</emphasis>: | 1848 | <listitem><para><emphasis>Clean up</emphasis>: |
1857 | Be sure old images are cleaned out by running the | 1849 | Be sure to clean the shared state out by running the |
1858 | <filename>cleanall</filename> BitBake task as follows from your build directory: | 1850 | <filename>cleansstate</filename> BitBake task as follows from your build directory: |
1859 | <literallayout class='monospaced'> | 1851 | <literallayout class='monospaced'> |
1860 | $ bitbake -c cleanall linux-yocto | 1852 | $ bitbake -c cleansstate linux-yocto |
1861 | </literallayout></para> | 1853 | </literallayout></para> |
1862 | <para><note>Never remove any files by hand from the <filename>tmp/deploy</filename> | 1854 | <para><note>Never remove any files by hand from the <filename>tmp/deploy</filename> |
1863 | directory inside the build directory. | 1855 | directory inside the build directory. |
1864 | Always use the BitBake <filename>cleanall</filename> task to clear | 1856 | Always use the various BitBake clean tasks to clear out previous |
1865 | out previous builds.</note></para></listitem> | 1857 | build artifacts. |
1858 | </note></para></listitem> | ||
1866 | <listitem><para><emphasis>Build the image</emphasis>: | 1859 | <listitem><para><emphasis>Build the image</emphasis>: |
1867 | Next, build the kernel image using this command: | 1860 | Next, build the kernel image using this command: |
1868 | <literallayout class='monospaced'> | 1861 | <literallayout class='monospaced'> |