aboutsummaryrefslogtreecommitdiffstats
path: root/docs/usermanual/chapters/getting_oe.xml
blob: 69b9126fad0d3f95e283697b4bcada48b1a504c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="chapter_getting_oe">
  <title>Getting Started</title>

  <section id="gettingoe_directory_setup">
    <title>OpenEmbedded Directory Structure</title>

    <para>Before you begin downloading OpenEmbedded, you need to setup your
    working environment.</para>

	<para>The first step is to decide where on your system you wish to
    work. This document will use the <varname>$OEBASE</varname> variable to
    denote the base directory of the OpenEmbedded environment. For
    example, <varname>$OEBASE</varname> could
    be <literal>/home/joe/work/oe</literal>.</para>

    <para>The base directory of your OpenEmbedded environment
    (<varname>$OEBASE</varname>) is the location where sources will be checked
    out (or unpacked). You must choose a location with <emphasis>no symlinks
    above it</emphasis>.</para>

	<para>To create the directory structure:

    <screen>
$ mkdir -p $OEBASE/build/conf
$ cd $OEBASE</screen>

	The <literal>$OEBASE/build</literal> directory will contain your
	local configurations and extensions to the OpenEmbedded system which allow
	you to build your applications and images.
    </para>

	<para>The <varname>$OEBASE</varname> will also contain both bitbake/ and
	openembedded/ directories. These will be discussed in
	<xref linkend="gettingoe_getting_bitbake"/> and
	<xref linkend="gettingoe_getting_oe"/>.
	</para>
  </section>

  <section id="gettingoe_getting_bitbake">
    <title>Getting <application>BitBake</application></title>

    <para>Before using OE, you must first obtain the build tool it needs:
    bitbake.</para>

    <para>It is recommended to run bitbake without installing it, as a sibling
    directory of <literal>openembedded/</literal>
    and <literal>build/</literal> directories. Indeed, as bitbake is written
    in python it does not need compilation for being used. You'll just have to
    set the PATH variable so that the BitBake tools are accessible (see
    <xref linkend="gettingoe_configuring_oe"/>).</para>

	<section><title>Getting <application>BitBake</application> Using Subversion</title>
	  <para>To checkout the latest version of the BitBake 1.8 branch, use the
		following command:
		<screen>
$ cd $OEBASE
$ <command>svn</command> co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake
</screen>
	  </para>

	  <para><application>BitBake</application> is checked out now and
		the <varname>$OEBASE</varname> directory will contain
		a <literal>bitbake/</literal> subdirectory.</para>

	  <para>If you need to access a Subversion server through a proxy, see the
		<ulink url="http://subversion.tigris.org/faq.html#proxy">SVN FAQ</ulink>
	  </para>
	</section>

	<section><title>Updating <application>BitBake</application></title>
	  <para>Bitbake is being revised fairly often. Periodically it's a good
		idea to check the repository of bitbake stable branches to see if a
		new stable branch is available or if the current branch has been
		revised. Compare your existing bitbake directory with the latest
		bitbake branch in the repository. Your existing bitbake branch and
		its 'last changed revision' number can be found as follows:

		<screen>$ cd $OEBASE/bitbake; svn info</screen>

		If there is a new stable branch, you will want to move or delete
		your existing bitbake directory and repeat the process listed above
		under "To obtain bitbake". If there is no new branch, it is easy to
		update bitbake:

		<screen>$ cd $OEBASE/bitbake; svn update</screen>
	  </para>
	</section>
  </section>


  <section id="gettingoe_getting_oe">
    <title>Getting OpenEmbedded</title>

    <para><emphasis>Note:</emphasis> Once upon a time OpenEmbedded used
      Monotone for version control. If you have an OE Monotone repository on
      your computer, you should replace it with the Git repository.</para>

    <para>The OpenEmbedded metadata has a high rate of development, so it's a
      good idea to stay up to date. You'll need Git to get the metadata and
      stay up to date. Git is available in most distributions and has binaries
      at <ulink url="http://git-scm.com/">Git homepage</ulink>.</para>

    <section><title>Checking Out OpenEmbedded With Git</title>
      <para>Once you have installed Git, checkout the OpenEmbedded repository:
        <screen>
$ cd $OEBASE
$ git clone git://git.openembedded.net/openembedded</screen>
        The <literal>$OEBASE/openembedded/</literal> directory should now
        exist.</para>
    </section>

    <section><title>Updating OpenEmbedded</title>
      <para>The <literal>org.openembedded.dev</literal> branch of OpenEmbedded
        is updated very frequently (as much as several times an hour). The
        distro branches are not updated as much but still fairly often. It
        seems good practice to update your OpenEmbedded tree at least
        daily. To do this, run:
        <screen>
$ cd $OEBASE
$ git pull</screen>
      </para>
    </section>
    <section><title>Changing Branches</title>
      <para>Working with multiple branches is very easy to do with Git. The
        OpenEmbedded repository holds many branches. To list all branches, use this command:
        <screen>$ git branch -a</screen>
        Branch names that begin with <literal>origin/</literal> denote
        branches that exist on the remote server. The name with a * in front
        of it is the branch currently checked out. If you want to work with a
        remote branch, you must first create a local copy of it. The following
        command will create a local copy of a remote branch:
        <screen>$ git branch &lt;local_name&gt; &lt;remote_name&gt;</screen>
        To change branches, use this command:
        <screen>$ git checkout &lt;branch_name&gt;</screen>
        There are more complicated branch operations that can be done with git,
        but those are beyond the scope of this document.</para>
    </section>
  </section>

  <section id="gettingoe_configuring_oe">
    <title>Configuring OpenEmbedded</title>

    <para>This section is a stub, help us by expanding it</para>
  </section>

  <section id="gettingoe_building_software">
    <title>Building Software</title>

    <para>Once BitBake and OpenEmbedded are set up and configured, one can build 
    software and images like this:
<screen>
bitbake &lt;recipe_name&gt;
</screen>
            </para>

    <para>This section is a stub, help us by expanding it</para>
  </section>
</chapter>