diff options
author | Scott Rifenbark <scott.m.rifenbark@intel.com> | 2012-03-05 13:09:31 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-08 12:08:07 -0800 |
commit | 2cae64b94fa07f690879810c3b5226d3abbf3d44 (patch) | |
tree | 19369a8b5644502fa2bc4268e6638d6278a3a0c8 /documentation | |
parent | 25f74b31b70b07a0d67d57c4c031d50d61f98a3b (diff) | |
download | poky-2cae64b94fa07f690879810c3b5226d3abbf3d44.tar.gz |
documentation/dev-manual: Re-org of topics
Several topics in the "Common Tasks" chapter really fit better in
the "Newbie" chapter. I moved these sections out. I also combined
information from the section on submitting changes from the
"Common Tasks" and the "Newbie" chapter to live in the "Newbie"
chapter only.
(From yocto-docs rev: 90fa8c125e545c57a5a994dd59715b73c5c4882f)
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.xml | 297 | ||||
-rw-r--r-- | documentation/dev-manual/dev-manual-newbie.xml | 71 |
2 files changed, 155 insertions, 213 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index cedab513bb..9f7d04244a 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -1774,6 +1774,91 @@ so that there are some definite steps on how to do this. I need more detail her | |||
1774 | </section> | 1774 | </section> |
1775 | </section> | 1775 | </section> |
1776 | 1776 | ||
1777 | <section id="usingpoky-changes-updatingimages"> | ||
1778 | <title>Updating Existing Images</title> | ||
1779 | |||
1780 | <para> | ||
1781 | Often, rather than re-flashing a new image, you might wish to install updated | ||
1782 | packages into an existing running system. | ||
1783 | You can do this by first sharing the <filename>tmp/deploy/ipk/</filename> directory | ||
1784 | through a web server and then by changing <filename>/etc/opkg/base-feeds.conf</filename> | ||
1785 | to point at the shared server. | ||
1786 | Following is an example: | ||
1787 | <literallayout class='monospaced'> | ||
1788 | $ src/gz all http://www.mysite.com/somedir/deploy/ipk/all | ||
1789 | $ src/gz armv7a http://www.mysite.com/somedir/deploy/ipk/armv7a | ||
1790 | $ src/gz beagleboard http://www.mysite.com/somedir/deploy/ipk/beagleboard | ||
1791 | </literallayout> | ||
1792 | </para> | ||
1793 | </section> | ||
1794 | |||
1795 | <section id="usingpoky-changes-prbump"> | ||
1796 | <title>Incrementing a Package Revision Number</title> | ||
1797 | |||
1798 | <para> | ||
1799 | If a committed change results in changing the package output, | ||
1800 | then the value of the | ||
1801 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PR'>PR</ulink></filename> | ||
1802 | variable needs to be increased | ||
1803 | (or "bumped") as part of that commit. | ||
1804 | This means that for new recipes you must be sure to add the <filename>PR</filename> | ||
1805 | variable and set its initial value equal to "r0". | ||
1806 | Failing to define <filename>PR</filename> makes it easy to miss when you bump a package. | ||
1807 | Note that you can only use integer values following the "r" in the | ||
1808 | <filename>PR</filename> variable. | ||
1809 | </para> | ||
1810 | |||
1811 | <para> | ||
1812 | If you are sharing a common <filename>.inc</filename> file with multiple recipes, | ||
1813 | you can also use the | ||
1814 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-INC_PR'>INC_PR</ulink></filename> | ||
1815 | variable to ensure that | ||
1816 | the recipes sharing the <filename>.inc</filename> file are rebuilt when the | ||
1817 | <filename>.inc</filename> file itself is changed. | ||
1818 | The <filename>.inc</filename> file must set <filename>INC_PR</filename> | ||
1819 | (initially to "r0"), and all recipes referring to it should set <filename>PR</filename> | ||
1820 | to "$(INC_PR).0" initially, incrementing the last number when the recipe is changed. | ||
1821 | If the <filename>.inc</filename> file is changed then its | ||
1822 | <filename>INC_PR</filename> should be incremented. | ||
1823 | </para> | ||
1824 | |||
1825 | <para> | ||
1826 | When upgrading the version of a package, assuming the | ||
1827 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PV'>PV</ulink></filename> | ||
1828 | changes, the <filename>PR</filename> variable should be reset to "r0" | ||
1829 | (or "$(INC_PR).0" if you are using <filename>INC_PR</filename>). | ||
1830 | </para> | ||
1831 | |||
1832 | <para> | ||
1833 | Usually, version increases occur only to packages. | ||
1834 | However, if for some reason <filename>PV</filename> changes but does not | ||
1835 | increase, you can increase the | ||
1836 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PE'>PE</ulink></filename> | ||
1837 | variable (Package Epoch). | ||
1838 | The <filename>PE</filename> variable defaults to "0". | ||
1839 | </para> | ||
1840 | |||
1841 | <para> | ||
1842 | Version numbering strives to follow the | ||
1843 | <ulink url='http://www.debian.org/doc/debian-policy/ch-controlfields.html'> | ||
1844 | Debian Version Field Policy Guidelines</ulink>. | ||
1845 | These guidelines define how versions are compared and what "increasing" a version means. | ||
1846 | </para> | ||
1847 | |||
1848 | <para> | ||
1849 | There are two reasons for following the previously mentioned guidelines. | ||
1850 | First, to ensure that when a developer updates and rebuilds, they get all the changes to | ||
1851 | the repository and do not have to remember to rebuild any sections. | ||
1852 | Second, to ensure that target users are able to upgrade their | ||
1853 | devices using package manager commands such as <filename>opkg upgrade</filename> | ||
1854 | (or similar commands for dpkg/apt or rpm-based systems). | ||
1855 | </para> | ||
1856 | |||
1857 | <para> | ||
1858 | The goal is to ensure the Yocto Project has packages that can be upgraded in all cases. | ||
1859 | </para> | ||
1860 | </section> | ||
1861 | |||
1777 | <section id="usingpoky-configuring-DISTRO_PN_ALIAS"> | 1862 | <section id="usingpoky-configuring-DISTRO_PN_ALIAS"> |
1778 | <title>Handling a Package Name Alias</title> | 1863 | <title>Handling a Package Name Alias</title> |
1779 | <para> | 1864 | <para> |
@@ -1870,218 +1955,6 @@ so that there are some definite steps on how to do this. I need more detail her | |||
1870 | build directory that is different than the source directory. | 1955 | build directory that is different than the source directory. |
1871 | </para> | 1956 | </para> |
1872 | </section> | 1957 | </section> |
1873 | |||
1874 | <section id="usingpoky-changes"> | ||
1875 | <title>Making and Maintaining Changes</title> | ||
1876 | <para> | ||
1877 | Because the Yocto Project is extremely configurable and flexible, | ||
1878 | we recognize that developers will want | ||
1879 | to extend, configure or optimize it for their specific uses. | ||
1880 | To best keep pace with future Yocto Project changes, | ||
1881 | we recommend you make controlled changes to the Yocto Project. | ||
1882 | </para> | ||
1883 | |||
1884 | <para> | ||
1885 | The Yocto Project supports a "<link linkend='understanding-and-creating-layers'>layers</link>" concept. | ||
1886 | If you use layers properly, you can ease future upgrades and allow segregation | ||
1887 | between the Yocto Project core and a given developer's changes. | ||
1888 | The following section provides more advice on managing changes to the Yocto Project. | ||
1889 | </para> | ||
1890 | |||
1891 | <section id="usingpoky-changes-commits"> | ||
1892 | <title>Committing Changes</title> | ||
1893 | |||
1894 | <para> | ||
1895 | Modifications to the Yocto Project are often managed under some kind of source | ||
1896 | revision control system. | ||
1897 | Because some simple practices can significantly improve usability, policy for committing changes | ||
1898 | is important. | ||
1899 | It helps to use a consistent documentation style when committing changes. | ||
1900 | The Yocto Project development team has found the following practices work well: | ||
1901 | <itemizedlist> | ||
1902 | <listitem><para>The first line of the commit summarizes the change and begins with the | ||
1903 | name of the affected package or packages. | ||
1904 | However, not all changes apply to specific packages. | ||
1905 | Consequently, the prefix could also be a machine name or class name.</para></listitem> | ||
1906 | <listitem><para>The second part of the commit (if needed) is a longer more detailed | ||
1907 | description of the changes. | ||
1908 | Placing a blank line between the first and second parts helps with | ||
1909 | readability.</para></listitem> | ||
1910 | </itemizedlist> | ||
1911 | </para> | ||
1912 | |||
1913 | <para> | ||
1914 | Following is an example commit: | ||
1915 | <literallayout class='monospaced'> | ||
1916 | bitbake/data.py: Add emit_func() and generate_dependencies() functions | ||
1917 | |||
1918 | These functions allow generation of dependency data between functions and | ||
1919 | variables allowing moves to be made towards generating checksums and allowing | ||
1920 | use of the dependency information in other parts of BitBake. | ||
1921 | |||
1922 | Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org | ||
1923 | </literallayout> | ||
1924 | </para> | ||
1925 | |||
1926 | <para> | ||
1927 | All commits should be self-contained such that they leave the | ||
1928 | metadata in a consistent state that builds both before and after the | ||
1929 | commit is made. | ||
1930 | Besides being a good practice to follow, it helps ensure autobuilder test results | ||
1931 | are valid. | ||
1932 | </para> | ||
1933 | </section> | ||
1934 | |||
1935 | <section id="usingpoky-changes-prbump"> | ||
1936 | <title>Package Revision Incrementing</title> | ||
1937 | |||
1938 | <para> | ||
1939 | If a committed change results in changing the package output, | ||
1940 | then the value of the | ||
1941 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PR'>PR</ulink></filename> | ||
1942 | variable needs to be increased | ||
1943 | (or "bumped") as part of that commit. | ||
1944 | This means that for new recipes you must be sure to add the <filename>PR</filename> | ||
1945 | variable and set its initial value equal to "r0". | ||
1946 | Failing to define <filename>PR</filename> makes it easy to miss when you bump a package. | ||
1947 | Note that you can only use integer values following the "r" in the | ||
1948 | <filename>PR</filename> variable. | ||
1949 | </para> | ||
1950 | |||
1951 | <para> | ||
1952 | If you are sharing a common <filename>.inc</filename> file with multiple recipes, | ||
1953 | you can also use the | ||
1954 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-INC_PR'>INC_PR</ulink></filename> | ||
1955 | variable to ensure that | ||
1956 | the recipes sharing the <filename>.inc</filename> file are rebuilt when the | ||
1957 | <filename>.inc</filename> file itself is changed. | ||
1958 | The <filename>.inc</filename> file must set <filename>INC_PR</filename> | ||
1959 | (initially to "r0"), and all recipes referring to it should set <filename>PR</filename> | ||
1960 | to "$(INC_PR).0" initially, incrementing the last number when the recipe is changed. | ||
1961 | If the <filename>.inc</filename> file is changed then its | ||
1962 | <filename>INC_PR</filename> should be incremented. | ||
1963 | </para> | ||
1964 | |||
1965 | <para> | ||
1966 | When upgrading the version of a package, assuming the | ||
1967 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PV'>PV</ulink></filename> | ||
1968 | changes, the <filename>PR</filename> variable should be reset to "r0" | ||
1969 | (or "$(INC_PR).0" if you are using <filename>INC_PR</filename>). | ||
1970 | </para> | ||
1971 | |||
1972 | <para> | ||
1973 | Usually, version increases occur only to packages. | ||
1974 | However, if for some reason <filename>PV</filename> changes but does not | ||
1975 | increase, you can increase the | ||
1976 | <filename><ulink url='http://www.yoctoproject.org/docs/latest/poky-ref-manual/poky-ref-manual.html#var-PE'>PE</ulink></filename> | ||
1977 | variable (Package Epoch). | ||
1978 | The <filename>PE</filename> variable defaults to "0". | ||
1979 | </para> | ||
1980 | |||
1981 | <para> | ||
1982 | Version numbering strives to follow the | ||
1983 | <ulink url='http://www.debian.org/doc/debian-policy/ch-controlfields.html'> | ||
1984 | Debian Version Field Policy Guidelines</ulink>. | ||
1985 | These guidelines define how versions are compared and what "increasing" a version means. | ||
1986 | </para> | ||
1987 | |||
1988 | <para> | ||
1989 | There are two reasons for following the previously mentioned guidelines. | ||
1990 | First, to ensure that when a developer updates and rebuilds, they get all the changes to | ||
1991 | the repository and do not have to remember to rebuild any sections. | ||
1992 | Second, to ensure that target users are able to upgrade their | ||
1993 | devices using package manager commands such as <filename>opkg upgrade</filename> | ||
1994 | (or similar commands for dpkg/apt or rpm-based systems). | ||
1995 | </para> | ||
1996 | |||
1997 | <para> | ||
1998 | The goal is to ensure the Yocto Project has packages that can be upgraded in all cases. | ||
1999 | </para> | ||
2000 | </section> | ||
2001 | |||
2002 | <section id="usingpoky-changes-collaborate"> | ||
2003 | <title>Using The Yocto Project in a Team Environment</title> | ||
2004 | |||
2005 | <para> | ||
2006 | It might not be immediately clear how you can use the Yocto Project in a team environment, | ||
2007 | or scale it for a large team of developers. | ||
2008 | The specifics of any situation determine the best solution. | ||
2009 | Granted that the Yocto Project offers immense flexibility regarding this, practices do exist | ||
2010 | that experience has shown work well. | ||
2011 | </para> | ||
2012 | |||
2013 | <para> | ||
2014 | The core component of any development effort with the Yocto Project is often an | ||
2015 | automated build and testing framework along with an image generation process. | ||
2016 | You can use these core components to check that the metadata can be built, | ||
2017 | highlight when commits break the build, and provide up-to-date images that | ||
2018 | allow developers to test the end result and use it as a base platform for further | ||
2019 | development. | ||
2020 | Experience shows that buildbot is a good fit for this role. | ||
2021 | What works well is to configure buildbot to make two types of builds: | ||
2022 | incremental and full (from scratch). | ||
2023 | See <ulink url='http://autobuilder.yoctoproject.org:8010/'>the buildbot for the | ||
2024 | Yocto Project</ulink> for an example implementation that uses buildbot. | ||
2025 | </para> | ||
2026 | |||
2027 | <para> | ||
2028 | You can tie incremental builds to a commit hook that triggers the build | ||
2029 | each time a commit is made to the metadata. | ||
2030 | This practice results in useful acid tests that determine whether a given commit | ||
2031 | breaks the build in some serious way. | ||
2032 | Associating a build to a commit can catch a lot of simple errors. | ||
2033 | Furthermore, the tests are fast so developers can get quick feedback on changes. | ||
2034 | </para> | ||
2035 | |||
2036 | <para> | ||
2037 | Full builds build and test everything from the ground up. | ||
2038 | These types of builds usually happen at predetermined times like during the | ||
2039 | night when the machine load is low. | ||
2040 | </para> | ||
2041 | |||
2042 | <para> | ||
2043 | Most teams have many pieces of software undergoing active development at any given time. | ||
2044 | You can derive large benefits by putting these pieces under the control of a source | ||
2045 | control system that is compatible with the Yocto Project (i.e. Git or Subversion (SVN). | ||
2046 | You can then set the autobuilder to pull the latest revisions of the packages | ||
2047 | and test the latest commits by the builds. | ||
2048 | This practice quickly highlights issues. | ||
2049 | The Yocto Project easily supports testing configurations that use both a | ||
2050 | stable known good revision and a floating revision. | ||
2051 | The Yocto Project can also take just the changes from specific source control branches. | ||
2052 | This capability allows you to track and test specific changes. | ||
2053 | </para> | ||
2054 | |||
2055 | <para> | ||
2056 | Perhaps the hardest part of setting this up is defining the software project or | ||
2057 | the Yocto Project metadata policies that surround the different source control systems. | ||
2058 | Of course circumstances will be different in each case. | ||
2059 | However, this situation reveals one of the Yocto Project's advantages - | ||
2060 | the system itself does not | ||
2061 | force any particular policy on users, unlike a lot of build systems. | ||
2062 | The system allows the best policies to be chosen for the given circumstances. | ||
2063 | </para> | ||
2064 | </section> | ||
2065 | |||
2066 | <section id="usingpoky-changes-updatingimages"> | ||
2067 | <title>Updating Existing Images</title> | ||
2068 | |||
2069 | <para> | ||
2070 | Often, rather than re-flashing a new image, you might wish to install updated | ||
2071 | packages into an existing running system. | ||
2072 | You can do this by first sharing the <filename>tmp/deploy/ipk/</filename> directory | ||
2073 | through a web server and then by changing <filename>/etc/opkg/base-feeds.conf</filename> | ||
2074 | to point at the shared server. | ||
2075 | Following is an example: | ||
2076 | <literallayout class='monospaced'> | ||
2077 | $ src/gz all http://www.mysite.com/somedir/deploy/ipk/all | ||
2078 | $ src/gz armv7a http://www.mysite.com/somedir/deploy/ipk/armv7a | ||
2079 | $ src/gz beagleboard http://www.mysite.com/somedir/deploy/ipk/beagleboard | ||
2080 | </literallayout> | ||
2081 | </para> | ||
2082 | </section> | ||
2083 | </section> | ||
2084 | |||
2085 | </chapter> | 1958 | </chapter> |
2086 | 1959 | ||
2087 | <!-- | 1960 | <!-- |
diff --git a/documentation/dev-manual/dev-manual-newbie.xml b/documentation/dev-manual/dev-manual-newbie.xml index 1b5ef07398..9234a7175a 100644 --- a/documentation/dev-manual/dev-manual-newbie.xml +++ b/documentation/dev-manual/dev-manual-newbie.xml | |||
@@ -53,6 +53,70 @@ | |||
53 | </para> | 53 | </para> |
54 | </section> | 54 | </section> |
55 | 55 | ||
56 | <section id="usingpoky-changes-collaborate"> | ||
57 | <title>Using The Yocto Project in a Team Environment</title> | ||
58 | |||
59 | <para> | ||
60 | It might not be immediately clear how you can use the Yocto Project in a team environment, | ||
61 | or scale it for a large team of developers. | ||
62 | The specifics of any situation determine the best solution. | ||
63 | Granted that the Yocto Project offers immense flexibility regarding this, practices do exist | ||
64 | that experience has shown work well. | ||
65 | </para> | ||
66 | |||
67 | <para> | ||
68 | The core component of any development effort with the Yocto Project is often an | ||
69 | automated build and testing framework along with an image generation process. | ||
70 | You can use these core components to check that the metadata can be built, | ||
71 | highlight when commits break the build, and provide up-to-date images that | ||
72 | allow developers to test the end result and use it as a base platform for further | ||
73 | development. | ||
74 | Experience shows that buildbot is a good fit for this role. | ||
75 | What works well is to configure buildbot to make two types of builds: | ||
76 | incremental and full (from scratch). | ||
77 | See <ulink url='http://autobuilder.yoctoproject.org:8010/'>the buildbot for the | ||
78 | Yocto Project</ulink> for an example implementation that uses buildbot. | ||
79 | </para> | ||
80 | |||
81 | <para> | ||
82 | You can tie incremental builds to a commit hook that triggers the build | ||
83 | each time a commit is made to the metadata. | ||
84 | This practice results in useful acid tests that determine whether a given commit | ||
85 | breaks the build in some serious way. | ||
86 | Associating a build to a commit can catch a lot of simple errors. | ||
87 | Furthermore, the tests are fast so developers can get quick feedback on changes. | ||
88 | </para> | ||
89 | |||
90 | <para> | ||
91 | Full builds build and test everything from the ground up. | ||
92 | These types of builds usually happen at predetermined times like during the | ||
93 | night when the machine load is low. | ||
94 | </para> | ||
95 | |||
96 | <para> | ||
97 | Most teams have many pieces of software undergoing active development at any given time. | ||
98 | You can derive large benefits by putting these pieces under the control of a source | ||
99 | control system that is compatible with the Yocto Project (i.e. Git or Subversion (SVN). | ||
100 | You can then set the autobuilder to pull the latest revisions of the packages | ||
101 | and test the latest commits by the builds. | ||
102 | This practice quickly highlights issues. | ||
103 | The Yocto Project easily supports testing configurations that use both a | ||
104 | stable known good revision and a floating revision. | ||
105 | The Yocto Project can also take just the changes from specific source control branches. | ||
106 | This capability allows you to track and test specific changes. | ||
107 | </para> | ||
108 | |||
109 | <para> | ||
110 | Perhaps the hardest part of setting this up is defining the software project or | ||
111 | the Yocto Project metadata policies that surround the different source control systems. | ||
112 | Of course circumstances will be different in each case. | ||
113 | However, this situation reveals one of the Yocto Project's advantages - | ||
114 | the system itself does not | ||
115 | force any particular policy on users, unlike a lot of build systems. | ||
116 | The system allows the best policies to be chosen for the given circumstances. | ||
117 | </para> | ||
118 | </section> | ||
119 | |||
56 | <section id='yocto-project-repositories'> | 120 | <section id='yocto-project-repositories'> |
57 | <title>Yocto Project Source Repositories</title> | 121 | <title>Yocto Project Source Repositories</title> |
58 | 122 | ||
@@ -797,6 +861,8 @@ | |||
797 | 861 | ||
798 | <para> | 862 | <para> |
799 | Contributions to the Yocto Project are very welcome. | 863 | Contributions to the Yocto Project are very welcome. |
864 | Because the Yocto Project is extremely configurable and flexible, we recognize that developers | ||
865 | will want to extend, configure or optimize it for their specific uses. | ||
800 | You should send patches to the appropriate Yocto Project mailing list to get them | 866 | You should send patches to the appropriate Yocto Project mailing list to get them |
801 | in front of the Yocto Project Maintainer. | 867 | in front of the Yocto Project Maintainer. |
802 | For a list of the Yocto Project mailing lists, see the | 868 | For a list of the Yocto Project mailing lists, see the |
@@ -866,7 +932,10 @@ | |||
866 | <para> | 932 | <para> |
867 | In a collaborative environment, it is necessary to have some sort of standard | 933 | In a collaborative environment, it is necessary to have some sort of standard |
868 | or method through which you submit changes. | 934 | or method through which you submit changes. |
869 | Otherwise, things could get quite chaotic. | 935 | Otherwise, things could get quite chaotic. |
936 | One general practice to follow is to make small, controlled changes to the | ||
937 | Yocto Project. | ||
938 | Keeping changes small and isolated lets you best keep pace with future Yocto Project changes. | ||
870 | </para> | 939 | </para> |
871 | 940 | ||
872 | <para> | 941 | <para> |