blob: 966c35d4d34423b3232f5796a0a5505c08427f98 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<chapter id='toaster-manual-setup-and-use'>
6
7<title>Setting Up and Using Toaster</title>
8
Patrick Williamsf1e5d692016-03-30 15:21:19 -05009 <section id='starting-toaster-for-local-development'>
10 <title>Starting Toaster for Local Development</title>
11
12 <para>
13 Once you have set up the Yocto Project and installed the
14 Toaster system dependencies as described in
15 "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>",
16 you are ready to start Toaster.
17 </para>
18
19 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020 Navigate to the root of your
Patrick Williamsf1e5d692016-03-30 15:21:19 -050021 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
22 (e.g. <filename>poky</filename>):
23 <literallayout class='monospaced'>
24 $ cd poky
25 </literallayout>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050026 Once in that directory, source the build environment script:
27 <literallayout class='monospaced'>
28 $ source oe-init-build-env
29 </literallayout>
30 Next, from the build directory (e.g.
31 <filename>poky/build</filename>), start Toaster using this
32 command:
33 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060034 $ source toaster start
Patrick Williamsf1e5d692016-03-30 15:21:19 -050035 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050036 You can now run your builds from the command line, or with
37 Toaster as explained in section
38 "<link linkend='using-the-toaster-web-interface'>Using the Toaster Web Interface</link>".
Patrick Williamsf1e5d692016-03-30 15:21:19 -050039 </para>
40
41 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042 To access the Toaster web interface, open your favorite
43 browser and enter the following:
Patrick Williamsf1e5d692016-03-30 15:21:19 -050044 <literallayout class='monospaced'>
45 http://127.0.0.1:8000
46 </literallayout>
47 </para>
48 </section>
49
50 <section id='setting-a-different-port'>
51 <title>Setting a Different Port</title>
52
53 <para>
54 By default, Toaster starts on port 8000.
55 You can use the <filename>WEBPORT</filename> parameter to
56 set a different port.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050057 For example, the following command sets the port to "8400":
Patrick Williamsf1e5d692016-03-30 15:21:19 -050058 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060059 $ source toaster start webport=8400
60 </literallayout>
61 </para>
62 </section>
63
64 <section id='setting-a-different-address'>
65 <title>Setting a Different Address</title>
66
67 <para>
68 By default, Toaster binds to the loop back address
69 (i.e. localhost).
70 You can use the <filename>WEBPORT</filename> parameter to
71 set a different host.
72 For example, the following command sets the host and port
73 to "0.0.0.0:8400":
74 <literallayout class='monospaced'>
75 $ source toaster start webport=0.0.0.0:8400
Patrick Williamsf1e5d692016-03-30 15:21:19 -050076 </literallayout>
77 </para>
78 </section>
79
80 <section id='the-directory-for-cloning-layers'>
81 <title>The Directory for Cloning Layers</title>
82
83 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050084 Toaster creates a <filename>_toaster_clones</filename>
85 directory inside your Source Directory
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050086 (i.e. <filename>poky</filename>) to clone any layers
87 needed for your builds.
Patrick Williamsf1e5d692016-03-30 15:21:19 -050088 </para>
89
90 <para>
91 Alternatively, if you would like all of your Toaster related
92 files and directories to be in a particular location other than
93 the default, you can set the <filename>TOASTER_DIR</filename>
94 environment variable, which takes precedence over your current
95 working directory.
96 Setting this environment variable causes Toaster to create and use
97 <filename>$TOASTER_DIR./_toaster_clones</filename>.
98 </para>
99 </section>
100
101 <section id='toaster-the-build-directory'>
102 <title>The Build Directory</title>
103
104 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500105 Toaster creates a build directory within your Source
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500106 Directory (e.g. <filename>poky</filename>) to execute
107 the builds.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500108 </para>
109
110 <para>
111 Alternatively, if you would like all of your Toaster related files
112 and directories to be in a particular location, you can set
113 the <filename>TOASTER_DIR</filename> environment variable,
114 which takes precedence over your current working directory.
115 Setting this environment variable causes Toaster to use
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500116 <filename>$TOASTER_DIR/build</filename> as the build directory.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500117 </para>
118 </section>
119
120 <section id='toaster-creating-a-django-super-user'>
121 <title>Creating a Django Superuser</title>
122
123 <para>
124 Toaster is built on the
125 <ulink url='https://www.djangoproject.com/'>Django framework</ulink>.
126 Django provides an administration interface you can use
127 to edit Toaster configuration parameters.
128 </para>
129
130 <para>
131 To access the Django administration interface, you must
132 create a superuser by following these steps:
133 <orderedlist>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500134 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600135 If you used <filename>pip3</filename>, which is
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500136 recommended, to set up the Toaster system dependencies,
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600137 you need be sure the local user path is in your
138 <filename>PATH</filename> list.
139 To append the pip3 local user path, use the following
140 command:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500141 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600142 $ export PATH=$PATH:$HOME/.local/bin
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500143 </literallayout>
144 </para></listitem>
145 <listitem><para>
146 From the directory containing the Toaster database,
147 which by default is the
148 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
149 invoke the <filename>createsuperuser</filename> command
150 from <filename>manage.py</filename>:
151 <literallayout class='monospaced'>
152 $ cd ~/poky/build
153 $ ../bitbake/lib/toaster/manage.py createsuperuser
154 </literallayout>
155 </para></listitem>
156 <listitem><para>
157 Django prompts you for the username, which you need to
158 provide.
159 </para></listitem>
160 <listitem><para>
161 Django prompts you for an email address, which is
162 optional.
163 </para></listitem>
164 <listitem><para>
165 Django prompts you for a password, which you must provide.
166 </para></listitem>
167 <listitem><para>
168 Django prompts you to re-enter your password for verification.
169 </para></listitem>
170 </orderedlist>
171 After completing these steps, the following confirmation message
172 appears:
173 <literallayout class='monospaced'>
174 Superuser created successfully.
175 </literallayout>
176 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500177
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500178 <para>
179 Creating a superuser allows you to access the Django administration
180 interface through a browser.
181 The URL for this interface is the same as the URL used for the
182 Toaster instance with "/admin" on the end.
183 For example, if you are running Toaster locally, use the
184 following URL:
185 <literallayout class='monospaced'>
186 http://127.0.0.1:8000/admin
187 </literallayout>
188 You can use the Django administration interface to set Toaster
189 configuration parameters such as the build directory, layer sources,
190 default variable values, and BitBake versions.
191 </para>
192 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500193
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500194 <section id='toaster-setting-up-a-production-instance-of-toaster'>
195 <title>Setting Up a Production Instance of Toaster</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500196
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500197 <para>
198 You can use a production instance of Toaster to share the
199 Toaster instance with remote users, multiple users, or both.
200 The production instance is also the setup that can handle
201 heavier loads on the web service.
202 Use the instructions in the following sections to set up
203 Toaster to run builds through the Toaster web interface.
204 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500205
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500206 <section id='toaster-production-instance-requirements'>
207 <title>Requirements</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500208
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500209 <para>
210 Be sure you meet the following requirements:
211 <note>
212 You must comply with all Apache,
213 <filename>mod-wsgi</filename>, and Mysql requirements.
214 </note>
215 <itemizedlist>
216 <listitem><para>
217 Have all the build requirements as described in
218 "<link linkend='toaster-setting-up-the-basic-system-requirements'>Setting Up the Basic System Requirements</link>"
219 chapter.
220 </para></listitem>
221 <listitem><para>
222 Have an Apache webserver.
223 </para></listitem>
224 <listitem><para>
225 Have <filename>mod-wsgi</filename> for the Apache
226 webserver.
227 </para></listitem>
228 <listitem><para>
229 Use the Mysql database server.
230 </para></listitem>
231 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232 If you are using Ubuntu 16.04, run the following:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500233 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600234 $ sudo apt-get install apache2 libapache2-mod-wsgi-py3 mysql-server python3-pip libmysqlclient-dev
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500235 </literallayout>
236 </para></listitem>
237 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600238 If you are using Fedora 24 or a RedHat distribution, run
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500239 the following:
240 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600241 $ sudo dnf install httpd python3-mod_wsgi python3-pip mariadb-server mariadb-devel python3-devel
242 </literallayout>
243 </para></listitem>
244 <listitem><para>
245 If you are using openSUSE Leap 42.1, run
246 the following:
247 <literallayout class='monospaced'>
248 $ sudo zypper install apache2 apache2-mod_wsgi-python3 python3-pip mariadb mariadb-client python3-devel
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500249 </literallayout>
250 </para></listitem>
251 </itemizedlist>
252 </para>
253 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500254
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500255 <section id='toaster-installation-steps'>
256 <title>Installation</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500257
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500258 <para>
259 Perform the following steps to install Toaster:
260 <orderedlist>
261 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262 Create toaster user and set its home directory to
263 <filename>/var/www/toaster</filename>:
264 <literallayout class='monospaced'>
265 $ sudo /usr/sbin/useradd toaster -md /var/www/toaster -s /bin/false
266 $ sudo su - toaster -s /bin/bash
267 </literallayout>
268 </para></listitem>
269 <listitem><para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500270 Checkout a copy of <filename>poky</filename>
271 into the web server directory.
272 You will be using <filename>/var/www/toaster</filename>:
273 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500274 $ git clone git://git.yoctoproject.org/poky
275 $ git checkout &DISTRO_NAME_NO_CAP;
276 </literallayout>
277 </para></listitem>
278 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600279 Install Toaster
280 dependencies using the --user flag which
281 keeps the Python packages
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500282 isolated from your system-provided packages:
283 <literallayout class='monospaced'>
284 $ cd /var/www/toaster/
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600285 $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
286 $ pip3 install --user mysqlclient
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500287 </literallayout>
288 <note>
289 Isolating these packages is not required but is
290 recommended.
291 Alternatively, you can use your operating system's
292 package manager to install the packages.
293 </note>
294 </para></listitem>
295 <listitem><para>
296 Configure Toaster by editing
297 <filename>/var/www/toaster/poky/bitbake/lib/toaster/toastermain/settings.py</filename>
298 as follows:
299 <itemizedlist>
300 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600301 Edit the
302 <ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>DATABASE</ulink>
303 settings:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500304 <literallayout class='monospaced'>
305 DATABASES = {
306 'default': {
307 'ENGINE': 'django.db.backends.mysql',
308 'NAME': 'toaster_data',
309 'USER': 'toaster',
310 'PASSWORD': 'yourpasswordhere',
311 'HOST': 'localhost',
312 'PORT': '3306',
313 }
314 }
315 </literallayout>
316 </para></listitem>
317 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600318 Edit the
319 <ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>SECRET_KEY</ulink>:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500320 <literallayout class='monospaced'>
321 SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
322 </literallayout>
323 </para></listitem>
324 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600325 Edit the
326 <ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>STATIC_ROOT</ulink>:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500327 <literallayout class='monospaced'>
328 STATIC_ROOT = '/var/www/toaster/static_files/'
329 </literallayout>
330 </para></listitem>
331 </itemizedlist>
332 </para></listitem>
333 <listitem><para>
334 Add the database and user to the <filename>mysql</filename>
335 server defined earlier:
336 <literallayout class='monospaced'>
337 $ mysql -u root -p
338 mysql> CREATE DATABASE toaster_data;
339 mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
340 mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
341 mysql> quit
342 </literallayout>
343 </para></listitem>
344 <listitem><para>
345 Get Toaster to create the database schema,
346 default data, and gather the statically-served files:
347 <literallayout class='monospaced'>
348 $ cd /var/www/toaster/poky/
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500349 $ ./bitbake/lib/toaster/manage.py migrate
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600350 $ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json \
351 ./bitbake/lib/toaster/manage.py checksettings
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500352 $ ./bitbake/lib/toaster/manage.py collectstatic
353 </literallayout>
354 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500355
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500356 <para>
357 For the above set of commands, after moving to the
358 <filename>poky</filename> directory,
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600359 the <filename>migrate</filename>
360 command ensures the database
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500361 schema has had changes propagated correctly (i.e.
362 migrations).
363 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500364
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500365 <para>
366 The next line sets the Toaster root directory
367 <filename>TOASTER_DIR</filename> and the location of
368 the Toaster configuration file
369 <filename>TOASTER_CONF</filename>, which is
370 relative to the Toaster root directory
371 <filename>TOASTER_DIR</filename>.
372 For more information on the Toaster configuration file
373 <filename>TOASTER_CONF</filename>, see the
374 <link linkend='toaster-json-files'>JSON Files</link>
375 section of this manual.
376 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500377
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500378 <para>
379 This line also runs the <filename>checksettings</filename>
380 command, which configures the location of the Toaster
381 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build directory</ulink>.
382 The Toaster root directory <filename>TOASTER_DIR</filename>
383 determines where the Toaster build directory
384 is created on the file system.
385 In the example above,
386 <filename>TOASTER_DIR</filename> is set as follows:
387 <literallayout class="monospaced">
388 /var/www/toaster/poky
389 </literallayout>
390 This setting causes the Toaster build directory to be:
391 <literallayout class="monospaced">
392 /var/www/toaster/poky/build
393 </literallayout>
394 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500395
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500396 <para>
397 Finally, the <filename>collectstatic</filename> command
398 is a Django framework command that collects all the
399 statically served files into a designated directory to
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600400 be served up by the Apache web server as defined by
401 <filename>STATIC_ROOT</filename>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500402 </para></listitem>
403 <listitem><para>
404 Add an Apache configuration file for Toaster to your Apache web
405 server's configuration directory.
406 If you are using Ubuntu or Debian, put the file here:
407 <literallayout class='monospaced'>
408 /etc/apache2/conf-available/toaster.conf
409 </literallayout>
410 If you are using Fedora or RedHat, put it here:
411 <literallayout class='monospaced'>
412 /etc/httpd/conf.d/toaster.conf
413 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600414 If you are using OpenSUSE, put it here:
415 <literallayout class='monospaced'>
416 /etc/apache2/conf.d/toaster.conf
417 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500418 Following is a sample Apache configuration for Toaster
419 you can follow:
420 <literallayout class='monospaced'>
421 Alias /static /var/www/toaster/static_files
422 &lt;Directory /var/www/toaster/static_files&gt;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600423 &lt;IfModule mod_access_compat.c&gt;
424 Order allow,deny
425 Allow from all
426 &lt;/IfModule&gt;
427 &lt;IfModule !mod_access_compat.c&gt;
428 Require all granted
429 &lt;/IfModule&gt;
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500430 &lt;/Directory&gt;
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500431
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600432 &lt;Directory /var/www/toaster/poky/bitbake/lib/toaster/toastermain&gt;
433 &lt;Files "wsgi.py"&gt;
434 Require all granted
435 &lt;/Files&gt;
436 &lt;/Directory&gt;
437
438 WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/.local/lib/python3.4/site-packages
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500439
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500440 WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
441 &lt;Location /&gt;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600442 WSGIProcessGroup toaster_wsgi
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500443 &lt;/Location&gt;
444 </literallayout>
445 If you are using Ubuntu or Debian,
446 you will need to enable the config and module for Apache:
447 <literallayout class='monospaced'>
448 $ sudo a2enmod wsgi
449 $ sudo a2enconf toaster
450 $ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
451 </literallayout>
452 Finally, restart Apache to make sure all new configuration
453 is loaded.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600454 For Ubuntu, Debian, and OpenSUSE use:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500455 <literallayout class='monospaced'>
456 $ sudo service apache2 restart
457 </literallayout>
458 For Fedora and RedHat use:
459 <literallayout class='monospaced'>
460 $ sudo service httpd restart
461 </literallayout>
462 </para></listitem>
463 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600464 Prepare the systemd service to run Toaster builds.
465 Here is a sample configuration file for the service:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500466 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600467 [Unit]
468 Description=Toaster runbuilds
469
470 [Service]
471 Type=forking
472 User=toaster
473 ExecStart=/usr/bin/screen -d -m -S runbuilds /var/www/toaster/poky/bitbake/lib/toaster/runbuilds-service.sh start
474 ExecStop=/usr/bin/screen -S runbuilds -X quit
475 WorkingDirectory=/var/www/toaster/poky
476
477 [Install]
478 WantedBy=multi-user.target
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500479 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600480 Prepare the <filename>runbuilds-service.sh</filename>
481 script that you need to place in the
482 <filename>/var/www/toaster/poky/bitbake/lib/toaster/</filename>
483 directory by setting up executable permissions:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500484 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600485 #!/bin/bash
486
487 #export http_proxy=http://proxy.host.com:8080
488 #export https_proxy=http://proxy.host.com:8080
489 #export GIT_PROXY_COMMAND=$HOME/bin/gitproxy
490
491 cd ~/poky/
492 source ./oe-init-build-env build
493 source ../bitbake/bin/toaster $1 noweb
494 [ "$1" == 'start' ] &amp;&amp; /bin/bash
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500495 </literallayout>
496 </para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600497 <listitem><para>
498 Run the service:
499 <literallayout class='monospaced'>
500 # service runbuilds start
501 </literallayout>
502 Since the service is running in a detached screen
503 session, you can attach to it using this command:
504 <literallayout class='monospaced'>
505 $ sudo su - toaster
506 $ screen -rS runbuilds
507 </literallayout>
508 You can detach from the service again using "Ctrl-a"
509 followed by "d" key combination.
510 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500511 </orderedlist>
512 You can now open up a browser and start using Toaster.
513 </para>
514 </section>
515 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500516
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500517 <section id='using-the-toaster-web-interface'>
518 <title>Using the Toaster Web Interface</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500519
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500520 <para>
521 The Toaster web interface allows you to do the following:
522 <itemizedlist>
523 <listitem><para>
524 Browse published layers in the
525 <ulink url='http://layers.openembedded.org'>OpenEmbedded Metadata Index</ulink>
526 that are available for your selected version of the build
527 system.
528 </para></listitem>
529 <listitem><para>
530 Import your own layers for building.
531 </para></listitem>
532 <listitem><para>
533 Add and remove layers from your configuration.
534 </para></listitem>
535 <listitem><para>
536 Set configuration variables.
537 </para></listitem>
538 <listitem><para>
539 Select a target or multiple targets to build.
540 </para></listitem>
541 <listitem><para>
542 Start your builds.
543 </para></listitem>
544 <listitem><para>
545 See what was built (recipes and packages) and what
546 packages were installed into your final image.
547 </para></listitem>
548 <listitem><para>
549 Browse the directory structure of your image.
550 </para></listitem>
551 <listitem><para>
552 See the value of all variables in your build configuration,
553 and which files set each value.
554 </para></listitem>
555 <listitem><para>
556 Examine error, warning and trace messages to aid in
557 debugging.
558 </para></listitem>
559 <listitem><para>
560 See information about the BitBake tasks executed and
561 reused during your build, including those that used
562 shared state.
563 </para></listitem>
564 <listitem><para>
565 See dependency relationships between recipes, packages
566 and tasks.
567 </para></listitem>
568 <listitem><para>
569 See performance information such as build time, task time,
570 CPU usage, and disk I/O.
571 </para></listitem>
572 </itemizedlist>
573 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500574
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500575 <section id='web-interface-videos'>
576 <title>Toaster Web Interface Videos</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500577
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500578 <para>
579 Following are several videos that show how to use the Toaster GUI:
580 <itemizedlist>
581 <listitem><para><emphasis>Build Configuration:</emphasis>
582 This
583 <ulink url='https://www.youtube.com/watch?v=qYgDZ8YzV6w'>video</ulink>
584 overviews and demonstrates build configuration for Toaster.
585 </para></listitem>
586 <listitem><para><emphasis>Build Custom Layers:</emphasis>
587 This
588 <ulink url='https://www.youtube.com/watch?v=QJzaE_XjX5c'>video</ulink>
589 shows you how to build custom layers that are used with
590 Toaster.
591 </para></listitem>
592 <listitem><para><emphasis>Toaster Homepage and Table Controls:</emphasis>
593 This
594 <ulink url='https://www.youtube.com/watch?v=QEARDnrR1Xw'>video</ulink>
595 goes over the Toaster entry page, and provides
596 an overview of the data manipulation capabilities of
597 Toaster, which include search, sorting and filtering by
598 different criteria.
599 </para></listitem>
600 <listitem><para><emphasis>Build Dashboard:</emphasis>
601 This
602 <ulink url='https://www.youtube.com/watch?v=KKqHYcnp2gE'>video</ulink>
603 shows you the build dashboard, a page providing an
604 overview of the information available for a selected build.
605 </para></listitem>
606 <listitem><para><emphasis>Image Information:</emphasis>
607 This
608 <ulink url='https://www.youtube.com/watch?v=XqYGFsmA0Rw'>video</ulink>
609 walks through the information Toaster provides
610 about images: packages installed and root file system.
611 </para></listitem>
612 <listitem><para><emphasis>Configuration:</emphasis>
613 This
614 <ulink url='https://www.youtube.com/watch?v=UW-j-T2TzIg'>video</ulink>
615 provides Toaster build configuration information.
616 </para></listitem>
617 <listitem><para><emphasis>Tasks:</emphasis>
618 This
619 <ulink url='https://www.youtube.com/watch?v=D4-9vGSxQtw'>video</ulink>
620 shows the information Toaster provides about the
621 tasks run by the build system.
622 </para></listitem>
623 <listitem><para><emphasis>Recipes and Packages Built:</emphasis>
624 This
625 <ulink url='https://www.youtube.com/watch?v=x-6dx4huNnw'>video</ulink>
626 shows the information Toaster provides about recipes
627 and packages built.
628 </para></listitem>
629 <listitem><para><emphasis>Performance Data:</emphasis>
630 This
631 <ulink url='https://www.youtube.com/watch?v=qWGMrJoqusQ'>video</ulink>
632 shows the build performance data provided by
633 Toaster.
634 </para></listitem>
635 </itemizedlist>
636 </para>
637 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500638
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500639 <section id='a-note-on-the-local-yocto-project-release'>
640 <title>Additional Information About the Local Yocto Project Release</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500641
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500642 <para>
643 This section only applies if you have set up Toaster
644 for local development, as explained in the
645 "<link linkend='starting-toaster-for-local-development'>Starting Toaster for Local Development</link>"
646 section.
647 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500648
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500649 <para>
650 When you create a project in Toaster, you will be asked to
651 provide a name and to select a Yocto Project release.
652 One of the release options you will find is called
653 "Local Yocto Project".
654 <imagedata fileref="figures/new-project.png" align="center" width="9in" />
655 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500656
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500657 <para>
658 When you select the "Local Yocto Project" release, Toaster
659 will run your builds using the local Yocto
660 Project clone you have in your computer: the same clone
661 you are using to run Toaster.
662 Unless you manually update
663 this clone, your builds will always use the same Git revision.
664 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500665
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500666 <para>
667 If you select any of the other release options, Toaster
668 will fetch the tip of your selected release from the upstream
669 <ulink url='https://git.yoctoproject.org'>Yocto Project repository</ulink>
670 every time you run a build.
671 Fetching this tip effectively
672 means that if your selected release is updated upstream, the
673 Git revision you are using for your builds will change.
674 If you are doing development locally, you might not want this
675 change to happen.
676 In that case, the "Local Yocto Project"
677 release might be the right choice.
678 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500679
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500680 <para>
681 However, the "Local Yocto Project" release
682 will not provide you with any compatible layers, other than the
683 three core layers that come with the Yocto Project:
684 <itemizedlist>
685 <listitem><para>
686 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/openembedded-core/'>openembedded-core</ulink>
687 </para></listitem>
688 <listitem><para>
689 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-poky/'>meta-poky</ulink>
690 </para></listitem>
691 <listitem><para>
692 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-yocto-bsp/'>meta-yocto-bsp</ulink>
693 </para></listitem>
694 </itemizedlist>
695 <imagedata fileref="figures/compatible-layers.png" align="center" width="9in" />
696 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500697
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500698 <para>
699 If you want to build any other layers, you will need to
700 manually import them into your Toaster project, using the
701 "Import layer" page.
702 <imagedata fileref="figures/import-layer.png" align="center" width="9in" />
703 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500704
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500705 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500706
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500707 <section id='toaster-web-interface-preferred-version'>
708 <title>Building a Specific Recipe Given Multiple Versions</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500709
710 <para>
711 Occasionally, a layer might provide more than one version of
712 the same recipe.
713 For example, the <filename>openembedded-core</filename> layer
714 provides two versions of the <filename>bash</filename> recipe
715 (i.e. 3.2.48 and 4.3.30-r0) and two versions of the
716 <filename>which</filename> recipe (i.e. 2.21 and 2.18).
717 The following figure shows this exact scenario:
718 <imagedata fileref="figures/bash-oecore.png" align="center" width="9in" depth="6in" />
719 </para>
720
721 <para>
722 By default, the OpenEmbedded build system builds one of the
723 two recipes.
724 For the <filename>bash</filename> case, version 4.3.30-r0 is
725 built by default.
726 Unfortunately, Toaster as it exists, is not able to override
727 the default recipe version.
728 If you would like to build bash 3.2.48, you need to set the
729 <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
730 variable.
731 You can do so from Toaster, using the "Add variable" form,
732 which is available in the "BitBake variables" page of the
733 project configuration section as shown in the following screen:
734 <imagedata fileref="figures/add-variable.png" align="center" width="9in" depth="6in" />
735 </para>
736
737 <para>
738 To specify <filename>bash</filename> 3.2.48 as the version to build,
739 enter "PREFERRED_VERSION_bash" in the "Variable" field, and "3.2.48"
740 in the "Value" field.
741 Next, click the "Add variable" button:
742 <imagedata fileref="figures/set-variable.png" align="center" width="9in" depth="6in" />
743 </para>
744
745 <para>
746 After clicking the "Add variable" button, the settings for
747 <filename>PREFERRED_VERSION</filename> are added to the bottom
748 of the BitBake variables list.
749 With these settings, the OpenEmbedded build system builds the
750 desired version of the recipe rather than the default version:
751 <imagedata fileref="figures/variable-added.png" align="center" width="9in" depth="6in" />
752 </para>
753 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500754 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500755</chapter>