blob: c26a32a3d5e9469e63a4f68a598dcfb0f3020345 [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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050022 (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
Brad Bishopd7bf8c12018-02-25 22:55:05 -050064 <section id='setting-up-external-access'>
65 <title>Setting up External Access</title>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060066
67 <para>
68 By default, Toaster binds to the loop back address
Brad Bishopd7bf8c12018-02-25 22:55:05 -050069 (i.e. localhost), which does not allow access from
70 external hosts. To allow external access, use the
71 <filename>WEBPORT</filename> parameter to open an
72 address that connects to the network, specifically the
73 IP address that your NIC uses to connect to the network.
74 You can also bind to all IP addresses the computer
75 supports by using the shortcut
76 "0.0.0.0:<replaceable>port</replaceable>".
77 </para>
78
79 <para>
80 The following example binds to all IP addresses on the
81 host:
Patrick Williamsc0f7c042017-02-23 20:41:17 -060082 <literallayout class='monospaced'>
83 $ source toaster start webport=0.0.0.0:8400
Patrick Williamsf1e5d692016-03-30 15:21:19 -050084 </literallayout>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050085 This example binds to a specific IP address on the host's
86 NIC:
87 <literallayout class='monospaced'>
88 $ source toaster start webport=192.168.1.1:8400
89 </literallayout>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050090 </para>
91 </section>
92
93 <section id='the-directory-for-cloning-layers'>
94 <title>The Directory for Cloning Layers</title>
95
96 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050097 Toaster creates a <filename>_toaster_clones</filename>
98 directory inside your Source Directory
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050099 (i.e. <filename>poky</filename>) to clone any layers
100 needed for your builds.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500101 </para>
102
103 <para>
104 Alternatively, if you would like all of your Toaster related
105 files and directories to be in a particular location other than
106 the default, you can set the <filename>TOASTER_DIR</filename>
107 environment variable, which takes precedence over your current
108 working directory.
109 Setting this environment variable causes Toaster to create and use
110 <filename>$TOASTER_DIR./_toaster_clones</filename>.
111 </para>
112 </section>
113
114 <section id='toaster-the-build-directory'>
115 <title>The Build Directory</title>
116
117 <para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500118 Toaster creates a build directory within your Source
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500119 Directory (e.g. <filename>poky</filename>) to execute
120 the builds.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500121 </para>
122
123 <para>
124 Alternatively, if you would like all of your Toaster related files
125 and directories to be in a particular location, you can set
126 the <filename>TOASTER_DIR</filename> environment variable,
127 which takes precedence over your current working directory.
128 Setting this environment variable causes Toaster to use
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500129 <filename>$TOASTER_DIR/build</filename> as the build directory.
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500130 </para>
131 </section>
132
133 <section id='toaster-creating-a-django-super-user'>
134 <title>Creating a Django Superuser</title>
135
136 <para>
137 Toaster is built on the
138 <ulink url='https://www.djangoproject.com/'>Django framework</ulink>.
139 Django provides an administration interface you can use
140 to edit Toaster configuration parameters.
141 </para>
142
143 <para>
144 To access the Django administration interface, you must
145 create a superuser by following these steps:
146 <orderedlist>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500147 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600148 If you used <filename>pip3</filename>, which is
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500149 recommended, to set up the Toaster system dependencies,
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600150 you need be sure the local user path is in your
151 <filename>PATH</filename> list.
152 To append the pip3 local user path, use the following
153 command:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500154 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600155 $ export PATH=$PATH:$HOME/.local/bin
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500156 </literallayout>
157 </para></listitem>
158 <listitem><para>
159 From the directory containing the Toaster database,
160 which by default is the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500161 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500162 invoke the <filename>createsuperuser</filename> command
163 from <filename>manage.py</filename>:
164 <literallayout class='monospaced'>
165 $ cd ~/poky/build
166 $ ../bitbake/lib/toaster/manage.py createsuperuser
167 </literallayout>
168 </para></listitem>
169 <listitem><para>
170 Django prompts you for the username, which you need to
171 provide.
172 </para></listitem>
173 <listitem><para>
174 Django prompts you for an email address, which is
175 optional.
176 </para></listitem>
177 <listitem><para>
178 Django prompts you for a password, which you must provide.
179 </para></listitem>
180 <listitem><para>
181 Django prompts you to re-enter your password for verification.
182 </para></listitem>
183 </orderedlist>
184 After completing these steps, the following confirmation message
185 appears:
186 <literallayout class='monospaced'>
187 Superuser created successfully.
188 </literallayout>
189 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500190
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500191 <para>
192 Creating a superuser allows you to access the Django administration
193 interface through a browser.
194 The URL for this interface is the same as the URL used for the
195 Toaster instance with "/admin" on the end.
196 For example, if you are running Toaster locally, use the
197 following URL:
198 <literallayout class='monospaced'>
199 http://127.0.0.1:8000/admin
200 </literallayout>
201 You can use the Django administration interface to set Toaster
202 configuration parameters such as the build directory, layer sources,
203 default variable values, and BitBake versions.
204 </para>
205 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500206
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500207 <section id='toaster-setting-up-a-production-instance-of-toaster'>
208 <title>Setting Up a Production Instance of Toaster</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500209
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500210 <para>
211 You can use a production instance of Toaster to share the
212 Toaster instance with remote users, multiple users, or both.
213 The production instance is also the setup that can handle
214 heavier loads on the web service.
215 Use the instructions in the following sections to set up
216 Toaster to run builds through the Toaster web interface.
217 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500218
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500219 <section id='toaster-production-instance-requirements'>
220 <title>Requirements</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500221
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500222 <para>
223 Be sure you meet the following requirements:
224 <note>
225 You must comply with all Apache,
226 <filename>mod-wsgi</filename>, and Mysql requirements.
227 </note>
228 <itemizedlist>
229 <listitem><para>
230 Have all the build requirements as described in
231 "<link linkend='toaster-setting-up-the-basic-system-requirements'>Setting Up the Basic System Requirements</link>"
232 chapter.
233 </para></listitem>
234 <listitem><para>
235 Have an Apache webserver.
236 </para></listitem>
237 <listitem><para>
238 Have <filename>mod-wsgi</filename> for the Apache
239 webserver.
240 </para></listitem>
241 <listitem><para>
242 Use the Mysql database server.
243 </para></listitem>
244 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600245 If you are using Ubuntu 16.04, run the following:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500246 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600247 $ sudo apt-get install apache2 libapache2-mod-wsgi-py3 mysql-server python3-pip libmysqlclient-dev
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500248 </literallayout>
249 </para></listitem>
250 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600251 If you are using Fedora 24 or a RedHat distribution, run
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500252 the following:
253 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600254 $ sudo dnf install httpd python3-mod_wsgi python3-pip mariadb-server mariadb-devel python3-devel
255 </literallayout>
256 </para></listitem>
257 <listitem><para>
258 If you are using openSUSE Leap 42.1, run
259 the following:
260 <literallayout class='monospaced'>
261 $ sudo zypper install apache2 apache2-mod_wsgi-python3 python3-pip mariadb mariadb-client python3-devel
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500262 </literallayout>
263 </para></listitem>
264 </itemizedlist>
265 </para>
266 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500267
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500268 <section id='toaster-installation-steps'>
269 <title>Installation</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500270
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500271 <para>
272 Perform the following steps to install Toaster:
273 <orderedlist>
274 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600275 Create toaster user and set its home directory to
276 <filename>/var/www/toaster</filename>:
277 <literallayout class='monospaced'>
278 $ sudo /usr/sbin/useradd toaster -md /var/www/toaster -s /bin/false
279 $ sudo su - toaster -s /bin/bash
280 </literallayout>
281 </para></listitem>
282 <listitem><para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500283 Checkout a copy of <filename>poky</filename>
284 into the web server directory.
285 You will be using <filename>/var/www/toaster</filename>:
286 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500287 $ git clone git://git.yoctoproject.org/poky
288 $ git checkout &DISTRO_NAME_NO_CAP;
289 </literallayout>
290 </para></listitem>
291 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600292 Install Toaster
293 dependencies using the --user flag which
294 keeps the Python packages
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500295 isolated from your system-provided packages:
296 <literallayout class='monospaced'>
297 $ cd /var/www/toaster/
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600298 $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
299 $ pip3 install --user mysqlclient
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500300 </literallayout>
301 <note>
302 Isolating these packages is not required but is
303 recommended.
304 Alternatively, you can use your operating system's
305 package manager to install the packages.
306 </note>
307 </para></listitem>
308 <listitem><para>
309 Configure Toaster by editing
310 <filename>/var/www/toaster/poky/bitbake/lib/toaster/toastermain/settings.py</filename>
311 as follows:
312 <itemizedlist>
313 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600314 Edit the
315 <ulink url='http://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-SECRET_KEY'>DATABASE</ulink>
316 settings:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500317 <literallayout class='monospaced'>
318 DATABASES = {
319 'default': {
320 'ENGINE': 'django.db.backends.mysql',
321 'NAME': 'toaster_data',
322 'USER': 'toaster',
323 'PASSWORD': 'yourpasswordhere',
324 'HOST': 'localhost',
325 'PORT': '3306',
326 }
327 }
328 </literallayout>
329 </para></listitem>
330 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600331 Edit the
332 <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 -0500333 <literallayout class='monospaced'>
334 SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
335 </literallayout>
336 </para></listitem>
337 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600338 Edit the
339 <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 -0500340 <literallayout class='monospaced'>
341 STATIC_ROOT = '/var/www/toaster/static_files/'
342 </literallayout>
343 </para></listitem>
344 </itemizedlist>
345 </para></listitem>
346 <listitem><para>
347 Add the database and user to the <filename>mysql</filename>
348 server defined earlier:
349 <literallayout class='monospaced'>
350 $ mysql -u root -p
351 mysql> CREATE DATABASE toaster_data;
352 mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
353 mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
354 mysql> quit
355 </literallayout>
356 </para></listitem>
357 <listitem><para>
358 Get Toaster to create the database schema,
359 default data, and gather the statically-served files:
360 <literallayout class='monospaced'>
361 $ cd /var/www/toaster/poky/
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500362 $ ./bitbake/lib/toaster/manage.py migrate
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600363 $ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-poky/conf/toasterconf.json \
364 ./bitbake/lib/toaster/manage.py checksettings
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500365 $ ./bitbake/lib/toaster/manage.py collectstatic
366 </literallayout>
367 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500368
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500369 <para>
370 For the above set of commands, after moving to the
371 <filename>poky</filename> directory,
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600372 the <filename>migrate</filename>
373 command ensures the database
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500374 schema has had changes propagated correctly (i.e.
375 migrations).
376 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500377
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500378 <para>
379 The next line sets the Toaster root directory
380 <filename>TOASTER_DIR</filename> and the location of
381 the Toaster configuration file
382 <filename>TOASTER_CONF</filename>, which is
383 relative to the Toaster root directory
384 <filename>TOASTER_DIR</filename>.
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500385 For more information on the Toaster configuration file,
386 see the
387 <link linkend='configuring-toaster'>Configuring Toaster</link>
388 chapter.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500389 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500390
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500391 <para>
392 This line also runs the <filename>checksettings</filename>
393 command, which configures the location of the Toaster
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500394 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build directory</ulink>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500395 The Toaster root directory <filename>TOASTER_DIR</filename>
396 determines where the Toaster build directory
397 is created on the file system.
398 In the example above,
399 <filename>TOASTER_DIR</filename> is set as follows:
400 <literallayout class="monospaced">
401 /var/www/toaster/poky
402 </literallayout>
403 This setting causes the Toaster build directory to be:
404 <literallayout class="monospaced">
405 /var/www/toaster/poky/build
406 </literallayout>
407 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500408
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500409 <para>
410 Finally, the <filename>collectstatic</filename> command
411 is a Django framework command that collects all the
412 statically served files into a designated directory to
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600413 be served up by the Apache web server as defined by
414 <filename>STATIC_ROOT</filename>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500415 </para></listitem>
416 <listitem><para>
417 Add an Apache configuration file for Toaster to your Apache web
418 server's configuration directory.
419 If you are using Ubuntu or Debian, put the file here:
420 <literallayout class='monospaced'>
421 /etc/apache2/conf-available/toaster.conf
422 </literallayout>
423 If you are using Fedora or RedHat, put it here:
424 <literallayout class='monospaced'>
425 /etc/httpd/conf.d/toaster.conf
426 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600427 If you are using OpenSUSE, put it here:
428 <literallayout class='monospaced'>
429 /etc/apache2/conf.d/toaster.conf
430 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500431 Following is a sample Apache configuration for Toaster
432 you can follow:
433 <literallayout class='monospaced'>
434 Alias /static /var/www/toaster/static_files
435 &lt;Directory /var/www/toaster/static_files&gt;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600436 &lt;IfModule mod_access_compat.c&gt;
437 Order allow,deny
438 Allow from all
439 &lt;/IfModule&gt;
440 &lt;IfModule !mod_access_compat.c&gt;
441 Require all granted
442 &lt;/IfModule&gt;
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500443 &lt;/Directory&gt;
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500444
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600445 &lt;Directory /var/www/toaster/poky/bitbake/lib/toaster/toastermain&gt;
446 &lt;Files "wsgi.py"&gt;
447 Require all granted
448 &lt;/Files&gt;
449 &lt;/Directory&gt;
450
451 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 -0500452
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500453 WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
454 &lt;Location /&gt;
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600455 WSGIProcessGroup toaster_wsgi
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500456 &lt;/Location&gt;
457 </literallayout>
458 If you are using Ubuntu or Debian,
459 you will need to enable the config and module for Apache:
460 <literallayout class='monospaced'>
461 $ sudo a2enmod wsgi
462 $ sudo a2enconf toaster
463 $ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
464 </literallayout>
465 Finally, restart Apache to make sure all new configuration
466 is loaded.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600467 For Ubuntu, Debian, and OpenSUSE use:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500468 <literallayout class='monospaced'>
469 $ sudo service apache2 restart
470 </literallayout>
471 For Fedora and RedHat use:
472 <literallayout class='monospaced'>
473 $ sudo service httpd restart
474 </literallayout>
475 </para></listitem>
476 <listitem><para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600477 Prepare the systemd service to run Toaster builds.
478 Here is a sample configuration file for the service:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500479 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600480 [Unit]
481 Description=Toaster runbuilds
482
483 [Service]
484 Type=forking
485 User=toaster
486 ExecStart=/usr/bin/screen -d -m -S runbuilds /var/www/toaster/poky/bitbake/lib/toaster/runbuilds-service.sh start
487 ExecStop=/usr/bin/screen -S runbuilds -X quit
488 WorkingDirectory=/var/www/toaster/poky
489
490 [Install]
491 WantedBy=multi-user.target
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500492 </literallayout>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600493 Prepare the <filename>runbuilds-service.sh</filename>
494 script that you need to place in the
495 <filename>/var/www/toaster/poky/bitbake/lib/toaster/</filename>
496 directory by setting up executable permissions:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500497 <literallayout class='monospaced'>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600498 #!/bin/bash
499
500 #export http_proxy=http://proxy.host.com:8080
501 #export https_proxy=http://proxy.host.com:8080
502 #export GIT_PROXY_COMMAND=$HOME/bin/gitproxy
503
504 cd ~/poky/
505 source ./oe-init-build-env build
506 source ../bitbake/bin/toaster $1 noweb
507 [ "$1" == 'start' ] &amp;&amp; /bin/bash
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500508 </literallayout>
509 </para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600510 <listitem><para>
511 Run the service:
512 <literallayout class='monospaced'>
513 # service runbuilds start
514 </literallayout>
515 Since the service is running in a detached screen
516 session, you can attach to it using this command:
517 <literallayout class='monospaced'>
518 $ sudo su - toaster
519 $ screen -rS runbuilds
520 </literallayout>
521 You can detach from the service again using "Ctrl-a"
522 followed by "d" key combination.
523 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500524 </orderedlist>
525 You can now open up a browser and start using Toaster.
526 </para>
527 </section>
528 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500529
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500530 <section id='using-the-toaster-web-interface'>
531 <title>Using the Toaster Web Interface</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500532
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500533 <para>
534 The Toaster web interface allows you to do the following:
535 <itemizedlist>
536 <listitem><para>
537 Browse published layers in the
538 <ulink url='http://layers.openembedded.org'>OpenEmbedded Metadata Index</ulink>
539 that are available for your selected version of the build
540 system.
541 </para></listitem>
542 <listitem><para>
543 Import your own layers for building.
544 </para></listitem>
545 <listitem><para>
546 Add and remove layers from your configuration.
547 </para></listitem>
548 <listitem><para>
549 Set configuration variables.
550 </para></listitem>
551 <listitem><para>
552 Select a target or multiple targets to build.
553 </para></listitem>
554 <listitem><para>
555 Start your builds.
556 </para></listitem>
557 <listitem><para>
558 See what was built (recipes and packages) and what
559 packages were installed into your final image.
560 </para></listitem>
561 <listitem><para>
562 Browse the directory structure of your image.
563 </para></listitem>
564 <listitem><para>
565 See the value of all variables in your build configuration,
566 and which files set each value.
567 </para></listitem>
568 <listitem><para>
569 Examine error, warning and trace messages to aid in
570 debugging.
571 </para></listitem>
572 <listitem><para>
573 See information about the BitBake tasks executed and
574 reused during your build, including those that used
575 shared state.
576 </para></listitem>
577 <listitem><para>
578 See dependency relationships between recipes, packages
579 and tasks.
580 </para></listitem>
581 <listitem><para>
582 See performance information such as build time, task time,
583 CPU usage, and disk I/O.
584 </para></listitem>
585 </itemizedlist>
586 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500587
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500588 <section id='web-interface-videos'>
589 <title>Toaster Web Interface Videos</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500590
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500591 <para>
592 Following are several videos that show how to use the Toaster GUI:
593 <itemizedlist>
594 <listitem><para><emphasis>Build Configuration:</emphasis>
595 This
596 <ulink url='https://www.youtube.com/watch?v=qYgDZ8YzV6w'>video</ulink>
597 overviews and demonstrates build configuration for Toaster.
598 </para></listitem>
599 <listitem><para><emphasis>Build Custom Layers:</emphasis>
600 This
601 <ulink url='https://www.youtube.com/watch?v=QJzaE_XjX5c'>video</ulink>
602 shows you how to build custom layers that are used with
603 Toaster.
604 </para></listitem>
605 <listitem><para><emphasis>Toaster Homepage and Table Controls:</emphasis>
606 This
607 <ulink url='https://www.youtube.com/watch?v=QEARDnrR1Xw'>video</ulink>
608 goes over the Toaster entry page, and provides
609 an overview of the data manipulation capabilities of
610 Toaster, which include search, sorting and filtering by
611 different criteria.
612 </para></listitem>
613 <listitem><para><emphasis>Build Dashboard:</emphasis>
614 This
615 <ulink url='https://www.youtube.com/watch?v=KKqHYcnp2gE'>video</ulink>
616 shows you the build dashboard, a page providing an
617 overview of the information available for a selected build.
618 </para></listitem>
619 <listitem><para><emphasis>Image Information:</emphasis>
620 This
621 <ulink url='https://www.youtube.com/watch?v=XqYGFsmA0Rw'>video</ulink>
622 walks through the information Toaster provides
623 about images: packages installed and root file system.
624 </para></listitem>
625 <listitem><para><emphasis>Configuration:</emphasis>
626 This
627 <ulink url='https://www.youtube.com/watch?v=UW-j-T2TzIg'>video</ulink>
628 provides Toaster build configuration information.
629 </para></listitem>
630 <listitem><para><emphasis>Tasks:</emphasis>
631 This
632 <ulink url='https://www.youtube.com/watch?v=D4-9vGSxQtw'>video</ulink>
633 shows the information Toaster provides about the
634 tasks run by the build system.
635 </para></listitem>
636 <listitem><para><emphasis>Recipes and Packages Built:</emphasis>
637 This
638 <ulink url='https://www.youtube.com/watch?v=x-6dx4huNnw'>video</ulink>
639 shows the information Toaster provides about recipes
640 and packages built.
641 </para></listitem>
642 <listitem><para><emphasis>Performance Data:</emphasis>
643 This
644 <ulink url='https://www.youtube.com/watch?v=qWGMrJoqusQ'>video</ulink>
645 shows the build performance data provided by
646 Toaster.
647 </para></listitem>
648 </itemizedlist>
649 </para>
650 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500651
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500652 <section id='a-note-on-the-local-yocto-project-release'>
653 <title>Additional Information About the Local Yocto Project Release</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500654
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500655 <para>
656 This section only applies if you have set up Toaster
657 for local development, as explained in the
658 "<link linkend='starting-toaster-for-local-development'>Starting Toaster for Local Development</link>"
659 section.
660 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500661
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500662 <para>
663 When you create a project in Toaster, you will be asked to
664 provide a name and to select a Yocto Project release.
665 One of the release options you will find is called
666 "Local Yocto Project".
667 <imagedata fileref="figures/new-project.png" align="center" width="9in" />
668 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500669
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500670 <para>
671 When you select the "Local Yocto Project" release, Toaster
672 will run your builds using the local Yocto
673 Project clone you have in your computer: the same clone
674 you are using to run Toaster.
675 Unless you manually update
676 this clone, your builds will always use the same Git revision.
677 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500678
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500679 <para>
680 If you select any of the other release options, Toaster
681 will fetch the tip of your selected release from the upstream
682 <ulink url='https://git.yoctoproject.org'>Yocto Project repository</ulink>
683 every time you run a build.
684 Fetching this tip effectively
685 means that if your selected release is updated upstream, the
686 Git revision you are using for your builds will change.
687 If you are doing development locally, you might not want this
688 change to happen.
689 In that case, the "Local Yocto Project"
690 release might be the right choice.
691 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500692
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500693 <para>
694 However, the "Local Yocto Project" release
695 will not provide you with any compatible layers, other than the
696 three core layers that come with the Yocto Project:
697 <itemizedlist>
698 <listitem><para>
699 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/openembedded-core/'>openembedded-core</ulink>
700 </para></listitem>
701 <listitem><para>
702 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-poky/'>meta-poky</ulink>
703 </para></listitem>
704 <listitem><para>
705 <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-yocto-bsp/'>meta-yocto-bsp</ulink>
706 </para></listitem>
707 </itemizedlist>
708 <imagedata fileref="figures/compatible-layers.png" align="center" width="9in" />
709 </para>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500710
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500711 <para>
712 If you want to build any other layers, you will need to
713 manually import them into your Toaster project, using the
714 "Import layer" page.
715 <imagedata fileref="figures/import-layer.png" align="center" width="9in" />
716 </para>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500717
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500718 </section>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500719
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500720 <section id='toaster-web-interface-preferred-version'>
721 <title>Building a Specific Recipe Given Multiple Versions</title>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500722
723 <para>
724 Occasionally, a layer might provide more than one version of
725 the same recipe.
726 For example, the <filename>openembedded-core</filename> layer
727 provides two versions of the <filename>bash</filename> recipe
728 (i.e. 3.2.48 and 4.3.30-r0) and two versions of the
729 <filename>which</filename> recipe (i.e. 2.21 and 2.18).
730 The following figure shows this exact scenario:
731 <imagedata fileref="figures/bash-oecore.png" align="center" width="9in" depth="6in" />
732 </para>
733
734 <para>
735 By default, the OpenEmbedded build system builds one of the
736 two recipes.
737 For the <filename>bash</filename> case, version 4.3.30-r0 is
738 built by default.
739 Unfortunately, Toaster as it exists, is not able to override
740 the default recipe version.
741 If you would like to build bash 3.2.48, you need to set the
742 <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
743 variable.
744 You can do so from Toaster, using the "Add variable" form,
745 which is available in the "BitBake variables" page of the
746 project configuration section as shown in the following screen:
747 <imagedata fileref="figures/add-variable.png" align="center" width="9in" depth="6in" />
748 </para>
749
750 <para>
751 To specify <filename>bash</filename> 3.2.48 as the version to build,
752 enter "PREFERRED_VERSION_bash" in the "Variable" field, and "3.2.48"
753 in the "Value" field.
754 Next, click the "Add variable" button:
755 <imagedata fileref="figures/set-variable.png" align="center" width="9in" depth="6in" />
756 </para>
757
758 <para>
759 After clicking the "Add variable" button, the settings for
760 <filename>PREFERRED_VERSION</filename> are added to the bottom
761 of the BitBake variables list.
762 With these settings, the OpenEmbedded build system builds the
763 desired version of the recipe rather than the default version:
764 <imagedata fileref="figures/variable-added.png" align="center" width="9in" depth="6in" />
765 </para>
766 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500767 </section>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500768</chapter>