blob: 3a46b61b730d762195c4f159196ca469710aeb7d [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-reference'>
6
7<title>Concepts and Reference</title>
8
9 <para>
10 In order to configure and use Toaster, you should understand some
11 concepts and have some basic command reference material available.
12 This final chapter provides conceptual information on layer sources,
13 releases, and JSON configuration files.
14 Also provided is a quick look at some useful
15 <filename>manage.py</filename> commands that are Toaster-specific.
16 Information on <filename>manage.py</filename> commands does exist
17 across the Web and the information in this manual by no means
18 attempts to provide a command comprehensive reference.
19 </para>
20
21 <section id='layer-source'>
22 <title>Layer Source</title>
23
24 <para>
25 In general, a "layer source" is a source of information about
26 existing layers.
27 In particular, we are concerned with layers that you can use
28 with the Yocto Project and Toaster.
29 This chapter describes a particular type of layer source called
30 a "layer index."
31 </para>
32
33 <para>
34 A layer index is a web application that contains information
35 about a set of custom layers.
36 A good example of an existing layer index is the
37 OpenEmbedded Metadata Index.
38 A public instance of this layer index exists at
39 <ulink url='http://layers.openembedded.org'></ulink>.
40 You can find the code for this layer index's web application at
41 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>.
42 </para>
43
44 <para>
45 When you tie a layer source into Toaster, it can query the layer
46 source through a
47 <ulink url='http://en.wikipedia.org/wiki/Representational_state_transfer'>REST</ulink>
48 API, store the information about the layers in the Toaster
49 database, and then show the information to users.
50 Users are then able to view that information and build layers
51 from Toaster itself without worrying about cloning or editing
52 the BitBake layers configuration file
53 <filename>bblayers.conf</filename>.
54 </para>
55
56 <para>
57 Tying a layer source into Toaster is convenient when you have
58 many custom layers that need to be built on a regular basis by
59 a community of developers.
60 In fact, Toaster comes pre-configured with the OpenEmbedded
61 Metadata Index.
62 <note>
63 You do not have to use a layer source to use Toaster.
64 Tying into a layer source is optional.
65 </note>
66 </para>
67
68 <section id='layer-source-using-with-toaster'>
69 <title>Setting Up and Using a Layer Source</title>
70
71 <para>
72 To use your own layer source, you need to set up the layer
73 source and then tie it into Toaster.
74 This section describes how to tie into a layer index in a manner
75 similar to the way Toaster ties into the OpenEmbedded Metadata
76 Index.
77 </para>
78
79 <section id='understanding-your-layers'>
80 <title>Understanding Your Layers</title>
81
82 <para>
83 The obvious first step for using a layer index is to have
84 several custom layers that developers build and access using
85 the Yocto Project on a regular basis.
86 This set of layers needs to exist and you need to be
87 familiar with where they reside.
88 You will need that information when you set up the
89 code for the web application that "hooks" into your set of
90 layers.
91 </para>
92
93 <para>
94 For general information on layers, see the
95 "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
96 and
97 "<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>"
98 sections in the Yocto Project Board Support Package (BSP)
99 Developer's Guide.
100 </para>
101 </section>
102
103 <section id='configuring-toaster-to-hook-into-your-layer-source'>
104 <title>Configuring Toaster to Hook Into Your Layer Index</title>
105
106 <para>
107 If you want Toaster to use your layer index, you must host
108 the web application in a server to which Toaster can
109 connect.
110 You also need to give Toaster the information about your
111 layer index.
112 In other words, you have to configure Toaster to use your
113 layer index.
114 This section describes two methods by which you can
115 configure and use your layer index.
116 </para>
117
118 <para>
119 In the previous section, the code for the OpenEmbedded
120 Metadata Index (i.e.
121 <ulink url='http://layers.openembedded.org'></ulink>) was
122 referenced.
123 You can use this code, which is at
124 <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>,
125 as a base to create your own layer index.
126 </para>
127
128 <section id='use-the-administration-interface'>
129 <title>Use the Administration Interface</title>
130
131 <para>
132 Access the administration interface through a
133 browser by entering the URL of your Toaster instance and
134 adding "<filename>/admin</filename>" to the end of the
135 URL.
136 As an example, if you are running Toaster locally, use
137 the following URL:
138 <literallayout class='monospaced'>
139 http://127.0.0.1:8000/admin
140 </literallayout>
141 </para>
142
143 <para>
144 The administration interface has a "Layer sources"
145 section that includes an "Add layer source" button.
146 Click that button and provide the required information.
147 Make sure you select "layerindex" as the layer source type.
148 </para>
149 </section>
150
151 <section id='select-the-toasterconf-json-file'>
152 <title>Use the <filename>toasterconf.json</filename> File</title>
153
154 <para>
155 If you do not want to use the Administration
156 Interface, you can edit the
157 <link linkend='toaster-json-files'><filename>toasterconf.json</filename></link>
158 file and reload it to Toaster.
159 </para>
160
161 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500162 The Toaster startup script in
163 <filename>/bitbake/bin/toaster</filename> specifies
164 the location of a Toaster configuration file
165 <filename>toasterconf.json</filename> as the value of
166 the <filename>TOASTER_CONF</filename> variable.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500167 This configuration file is used to set up the initial
168 configuration values within the Toaster database
169 including the layer sources.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500170 Two versions of the configuration file exist:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500171 <itemizedlist>
172 <listitem><para>
173 The first version of the file is found in the
174 <filename>conf</filename> directory of the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500175 <filename>meta-poky</filename> layer
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500176 (i.e.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500177 <filename>meta-poky/conf/toasterconf.json</filename>).
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500178 This version contains the default Yocto Project
179 configuration for Toaster.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500180 </para></listitem>
181 <listitem><para>
182 The second version of the file is in the
183 <filename>conf</filename> directory of the
184 <filename>openembedded-core</filename> layer
185 (i.e. <filename>meta/conf/toasterconf.json</filename>).
186 This version contains the default OpenEmbedded
187 configuration for Toaster.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500188 </para></listitem>
189 </itemizedlist>
190 </para>
191 </section>
192
193 <section id='edit-the-configuration-file'>
194 <title>Edit the Configuration File</title>
195
196 <para>
197 Edit the version of the
198 <filename>toasterconf.json</filename> file you
199 used to set up your Toaster instance.
200 In the file, you will find a section for layer sources
201 such as the following:
202 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500203 "layersources": [
204 {
205 "name": "Local Yocto Project",
206 "sourcetype": "local",
207 "apiurl": "../../",
208 "branches": ["HEAD" ],
209 "layers": [
210 {
211 "name": "openembedded-core",
212 "local_path": "meta",
213 "vcs_url": "remote:origin",
214 "dirpath": "meta"
215 },
216 {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500217 "name": "meta-poky",
218 "local_path": "meta-poky",
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500219 "vcs_url": "remote:origin",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500220 "dirpath": "meta-poky"
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500221 },
222 {
223 "name": "meta-yocto-bsp",
224 "local_path": "meta-yocto-bsp",
225 "vcs_url": "remote:origin",
226 "dirpath": "meta-yocto-bsp"
227 }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500228
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500229 ]
230 },
231 {
232 "name": "OpenEmbedded",
233 "sourcetype": "layerindex",
234 "apiurl": "http://layers.openembedded.org/layerindex/api/",
235 "branches": ["master", "jethro" ,"fido"]
236 },
237 {
238 "name": "Imported layers",
239 "sourcetype": "imported",
240 "apiurl": "",
241 "branches": ["master", "jethro","fido", "HEAD"]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500243 }
244 ],
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500245 </literallayout>
246 You should add your own layer source to this section by
247 following the same format used for the "OpenEmbedded"
248 layer source shown above.
249 </para>
250
251 <para>
252 Give your layer source a name, provide the URL of your
253 layer source API, use the source type "layerindex", and
254 indicate which branches from your layer source you want
255 to make available through Toaster.
256 For example, the OpenEmbedded layer source makes
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500257 available only its "master", "fido", and "jethro"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500258 branches.
259 </para>
260
261 <para>
262 The branches must match the branch you
263 set when configuring your releases.
264 For example, if you configure one release in Toaster
265 by setting its branch to "branch-one" and you configure
266 another release in Toaster by setting its branch to
267 "branch-two", the branches in your layer source should
268 be "branch-one" and "branch-two" as well.
269 Doing so creates a connection between the releases
270 and the layer information from your layer source.
271 Thus, when users create a project with a given
272 release, they will see the appropriate layers from
273 your layer source.
274 This connection ensures that only layers that are
275 compatible with the selected project release can be
276 selected for building.
277 </para>
278
279 <para>
280 Once you have added this information to the
281 <filename>toasterconf.json</filename> file, save your
282 changes.
283 </para>
284
285 <para>
286 In a terminal window, navigate to the directory that
287 contains the Toaster database, which by default is the
288 root of the Yocto Project
289 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
290 Once you are located in that directory, run the
291 "<filename>loadconf</filename>" command, which takes as
292 an argument the full path to the
293 <filename>toasterconf.json</filename> file you just edited.
294 For example, if you cloned the
295 <filename>poky</filename> repository and you edited the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500296 <filename>meta-poky/conf/toasterconf.json</filename> file,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500297 you would type something like the following:
298 <literallayout class='monospaced'>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500299 $ bitbake/lib/toaster/manage.py loadconf /home/scottrif/poky/meta-poky/conf/toasterconf.json
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500300 </literallayout>
301 After entering this command, you need to update the
302 Toaster database with the information coming from your
303 new layer source.
304 To do that, you should run the
305 "<filename>lsupdates</filename>" command from the directory
306 that contains the Toaster database.
307 Here is an example:
308 <literallayout class='monospaced'>
309 $ bitbake/lib/toaster/manage.py lsupdates
310 </literallayout>
311 If Toaster can reach the API URL, you should see a message
312 telling you that Toaster is updating the layer source
313 information.
314 </para>
315
316 <para>
317 Once the information has been updated, verify the new layer
318 information is available by using the Toaster web interface.
319 To do that, visit the "All compatible layers" page inside a
320 Toaster project.
321 The layers from your layer source should be listed there.
322 </para>
323 </section>
324 </section>
325 </section>
326 </section>
327
328 <section id='toaster-releases'>
329 <title>Releases</title>
330
331 <para>
332 When you create a Toaster project using the web interface,
333 you are asked to choose a "Release."
334 In the context of Toaster, the term "Release" refers to a set of
335 layers and a BitBake version the OpenEmbedded build system uses
336 to build something.
337 As shipped, Toaster is pre-configured with releases that
338 correspond to Yocto Project release branches.
339 However, you can modify, delete, and create new releases
340 according to your needs.
341 This section provides some background information on releases.
342 </para>
343
344 <section id='toaster-releases-supported'>
345 <title>Pre-Configured Releases</title>
346
347 <para>
348 As shipped, Toaster is configured to use a specific set of
349 releases.
350 Of course, you can always configure Toaster to use any
351 release.
352 For example, you might want your project to build against a
353 specific commit of any of the "out-of-the-box" releases.
354 Or, you might want your project to build against different
355 revisions of OpenEmbedded and BitBake.
356 </para>
357
358 <para>
359 As shipped, Toaster is configured to work with the following
360 releases:
361 <itemizedlist>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500362 <listitem><para><emphasis>Yocto Project 2.0 "Jethro" or OpenEmbedded "Jethro":</emphasis>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500363 This release causes your Toaster projects to
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500364 build against the head of the jethro branch at
365 <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=jethro'></ulink>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500366 or
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500367 <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=jethro'></ulink>.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500368 </para></listitem>
369 <listitem><para><emphasis>Yocto Project 1.8 "Fido" or OpenEmbedded "Fido":</emphasis>
370 This release causes your Toaster projects to
371 build against the head of the fido branch at
372 <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=fido'></ulink>
373 or
374 <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=fido'></ulink>.
375 </para></listitem>
376 <listitem><para><emphasis>Yocto Project "Master" or OpenEmbedded "Master":</emphasis>
377 This release causes your Toaster Projects to
378 build against the head of the master branch, which is
379 where active development takes place, at
380 <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/'></ulink>
381 or
382 <ulink url='http://git.openembedded.org/openembedded-core/log/'></ulink>.
383 </para></listitem>
384 <listitem><para><emphasis>Local Yocto Project or Local OpenEmbedded:</emphasis>
385 This release causes your Toaster Projects to
386 build against the head of the <filename>poky</filename>
387 or <filename>openembedded-core</filename> clone you
388 have local to the machine running Toaster.
389 </para></listitem>
390 </itemizedlist>
391 </para>
392 </section>
393
394 <section id='toaster-releases-comprised-of'>
395 <title>What Makes Up a Release?</title>
396
397 <para>
398 A release consists of the following:
399 <itemizedlist>
400 <listitem><para><emphasis>Name:</emphasis>
401 The name of the release (<filename>name</filename>).
402 This release name never appears in the the Toaster
403 web interface.
404 Consequently, a user never sees the release name.
405 </para></listitem>
406 <listitem><para><emphasis>Description:</emphasis>
407 The textual description of the release
408 (<filename>description</filename>).
409 This description is what users encounter when creating
410 projects with the Toaster web interface.
411 When you configure your release, be sure to use
412 a description that sufficiently describes and is
413 understandable.
414 If Toaster has more than one release configured, the
415 release descriptions appear listed in a drop down menu
416 when a user creates a new project.
417 If Toaster has only one release configured, all
418 projects created using the web interface take that
419 release and the drop down menu does not display in the
420 Toaster web interface.
421 </para></listitem>
422 <listitem><para><emphasis>BitBake:</emphasis>
423 The Bitbake version (<filename>bitbake</filename>)
424 used to build layers set in the current release.
425 This version is described by a name, a Git URL, a
426 branch in the Git URL, and a directory path in the
427 Git repository.
428 As an example, consider the following snippet from
429 a Toaster JSON configuration file.
430 This BitBake version uses the master branch from the
431 OpenEmbedded repository:
432 <literallayout class='monospaced'>
433 "bitbake" : [
434 {
435 "name": "master",
436 "giturl": "git://git.openembedded.org/bitbake",
437 "branch": "master",
438 "dirpath": ""
439 }
440 ]
441 </literallayout>
442 Here is more detail on each of the items that comprise
443 the BitBake version:
444 <itemizedlist>
445 <listitem><para><emphasis>Name:</emphasis>
446 A string
447 (<filename>name</filename>) used to refer to
448 the version of BitBake you are using with
449 Toaster.
450 This name is never exposed through Toaster.
451 </para></listitem>
452 <listitem><para><emphasis>Git URL:</emphasis>
453 The URL (<filename>giturl</filename>)
454 for the BitBake Git repository cloned
455 for Toaster projects.
456 </para></listitem>
457 <listitem><para><emphasis>Branch:</emphasis>
458 The Git branch, or revision,
459 (<filename>branch</filename>) of the BitBake
460 repository used with Toaster.
461 </para></listitem>
462 <listitem><para><emphasis>Directory Path:</emphasis>
463 The sub-directory of the BitBake repository
464 (<filename>dirpath</filename>).
465 If the Git URL includes more than one
466 repository, you need to set this directory.
467 If the URL does not include more than a single
468 repository, you can set
469 <filename>dirpath</filename> to a null string
470 (i.e. "").
471 </para></listitem>
472 </itemizedlist>
473 </para></listitem>
474 <listitem><para><emphasis>Branch:</emphasis>
475 The branch for the layer source
476 (<filename>branch</filename>) used with the release.
477 For example, for the OpenEmbedded layer source, the
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500478 "master", "fido", and "jethro" branches are available.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500479 </para></listitem>
480 <listitem><para><emphasis>Default Layers:</emphasis>
481 The set of default layers
482 (<filename>defaultlayers</filename>) automatically
483 added to the project configuration when a project is
484 created.
485 </para></listitem>
486 <listitem><para><emphasis>Layer Source Priorities</emphasis>
487 A specification of
488 <link linkend='layer-source'>layer source</link>
489 priorities (<filename>layersourcepriority</filename>).
490 In order for Toaster to work as intended, the
491 "Imported layers" layer source should have the highest
492 priority, which means that layers manually imported by
493 users with the "Import layer" functionality will
494 always be visible and available for selection.
495 </para></listitem>
496 <listitem><para><emphasis>Help Text:</emphasis>
497 Help text (<filename>helptext</filename>) that explains
498 what the release does when selected.
499 This help text appears below the release drop-down
500 menu when you create a Toaster project.
501 The help text should assist users in making the correct
502 decision regarding the release to use for a given
503 project.
504 </para></listitem>
505 </itemizedlist>
506 </para>
507
508 <para>
509 To summarize what comprises a release, consider the following
510 example from a Toaster JSON file.
511 The configuration names the release "master" and uses the
512 "master" branch provided by the layer source of type
513 "layerindex", which is called "OpenEmbedded", and sets
514 the <filename>openembedded-core</filename> layer as the one
515 to be added by default to any projects created in Toaster.
516 The BitBake version used would be defined as shown earlier
517 in the previous list:
518 <literallayout class='monospaced'>
519 "releases": [
520 {
521 "name": "master",
522 "description": "OpenEmbedded master",
523 "bitbake": "master",
524 "branch": "master",
525 "defaultlayers": [ "openembedded-core" ],
526 "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" : 0 },
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500527 "helptext": "Toaster will run your builds using the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\"&gt;Yocto Project master branch&lt;/a&gt;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500528 }
529 ]
530 </literallayout>
531 </para>
532 </section>
533 </section>
534
535 <section id='toaster-json-files'>
536 <title>JSON Files</title>
537
538 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500539 You must configure Toaster before using it.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500540 Configuration customizes layer source settings and Toaster defaults
541 for all users and is performed by the person responsible for
542 Toaster Configuration (i.e the Toaster Administrator).
543 The Toaster Administrator performs this configuration through the
544 Django administration interface.
545 </para>
546
547 <para>
548 To make it easier to initially start Toaster, you can import a
549 pre-defined configuration file using the
550 <link linkend='toaster-command-loadconf'><filename>loadconf</filename></link>
551 command.
552 <note>
553 The configuration file is a JSON-formatted text file with
554 specific fields that Toaster recognizes.
555 It is not a data dump from the database, so it cannot be
556 loaded directly in the database.
557 </note>
558 </para>
559
560 <para>
561 By convention, the supplied configuration files are named
562 <filename>toasterconf.json</filename>.
563 The Toaster Administrator can customize the file prior to loading
564 it into Toaster.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500565 The <filename>TOASTER_CONF</filename> variable in the
566 Toaster startup script at <filename>bitbake/bin/toaster</filename>
567 specifies the location of the <filename>toasterconf.json</filename> file.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500568 </para>
569
570 <section id='json-file-choices'>
571 <title>Configuration File Choices</title>
572
573 <para>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500574 Two versions of the configuration file exist:
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500575 <itemizedlist>
576 <listitem><para>
577 The
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500578 <filename>meta-poky/conf/toasterconf.json</filename>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500579 in the <filename>conf</filename> directory of the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500580 Yocto Project's <filename>meta-poky</filename> layer.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500581 This version contains the default Yocto Project
582 configuration for Toaster.
583 You are prompted to select this file during the Toaster
584 set up process if you cloned the
585 <filename>poky</filename> repository (i.e.
586 <filename>&YOCTO_GIT_URL;/poky</filename>).
587 </para></listitem>
588 <listitem><para>
589 The <filename>meta/conf/toasterconf.json</filename>
590 in the <filename>conf</filename> directory of the
591 OpenEmbedded's <filename>openembedded-core</filename>
592 layer.
593 This version contains the default OpenEmbedded
594 configuration for Toaster.
595 You are prompted to select this file during the Toaster
596 set up process if you had cloned the
597 <filename>openembedded-core</filename> repository (i.e.
598 <filename>git://git.openembedded.org/openembedded-core</filename>).
599 </para></listitem>
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500600 </itemizedlist>
601 </para>
602 </section>
603
604 <section id='json-structure'>
605 <title>File Structure</title>
606
607 <para>
608 The <filename>toasterconf.json</filename> file consists of
609 easily readable areas: configuration, layer sources, BitBake,
610 default release, and releases.
611 </para>
612
613 <section id='json-config-area'>
614 <title>Configuration Area</title>
615
616 <para>
617 This area of the JSON file sets which variables are exposed
618 to users through the Toaster web interface.
619 Users can easily edit these variables.
620 </para>
621
622 <para>
623 The variables you set here are displayed in the
624 "Configuration variables" page in Toaster.
625 Minimally, you should set the
626 <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
627 variable, which appears to users as part of the project
628 page in Toaster.
629 </para>
630
631 <para>
632 Here is the default <filename>config</filename> area:
633 <literallayout class='monospaced'>
634 "config": {
635 "MACHINE" : "qemux86",
636 "DISTRO" : "poky",
637 "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
638 "IMAGE_INSTALL_append": "",
639 "PACKAGE_CLASSES": "package_rpm",
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500640 },
641 </literallayout>
642 </para>
643 </section>
644
645 <section id='json-layersources-area'>
646 <title>Layer Sources Area</title>
647
648 <para>
649 This area of the JSON file defines the
650 <link linkend='layer-source'>layer sources</link>
651 Toaster uses.
652 Toaster reads layer information from layer sources.
653 Three types of layer sources exist that Toaster
654 recognizes: Local, LayerIndex, and Imported.
655 </para>
656
657 <para>
658 The Local layer source reads layers from Git clones
659 available on your local drive.
660 Using a local layer source enables you to easily test
661 Toaster.
662 <note>
663 If you are setting up a hosted version of Toaster,
664 it does not make sense to have a local layer source.
665 </note>
666 </para>
667
668 <para>
669 The LayerIndex layer source uses a REST API exposed by
670 instances of the Layer Index application (e.g the public
671 <ulink url='http://layers.openembedded.org/'></ulink>)
672 to read layer data.
673 </para>
674
675 <para>
676 The Imported layer source is reserved for layer data
677 manually introduced by the user or Toaster Administrator
678 through the GUI.
679 This layer source lets users import their own layers
680 and build them with Toaster.
681 You should not remove the imported layer source.
682 </para>
683
684 <para>
685 Here is the default <filename>layersources</filename> area:
686 <literallayout class='monospaced'>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500687 "layersources": [
688 {
689 "name": "Local Yocto Project",
690 "sourcetype": "local",
691 "apiurl": "../../",
692 "branches": ["HEAD" ],
693 "layers": [
694 {
695 "name": "openembedded-core",
696 "local_path": "meta",
697 "vcs_url": "remote:origin",
698 "dirpath": "meta"
699 },
700 {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500701 "name": "meta-poky",
702 "local_path": "meta-poky",
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500703 "vcs_url": "remote:origin",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500704 "dirpath": "meta-poky"
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500705 },
706 {
707 "name": "meta-yocto-bsp",
708 "local_path": "meta-yocto-bsp",
709 "vcs_url": "remote:origin",
710 "dirpath": "meta-yocto-bsp"
711 }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500712
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500713 ]
714 },
715 {
716 "name": "OpenEmbedded",
717 "sourcetype": "layerindex",
718 "apiurl": "http://layers.openembedded.org/layerindex/api/",
719 "branches": ["master", "jethro" ,"fido"]
720 },
721 {
722 "name": "Imported layers",
723 "sourcetype": "imported",
724 "apiurl": "",
725 "branches": ["master", "jethro","fido", "HEAD"]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500726
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500727 }
728 ],
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500729 </literallayout>
730 </para>
731 </section>
732
733 <section id='json-bitbake-area'>
734 <title>BitBake Area</title>
735
736 <para>
737 This area of the JSON file defines the version of
738 BitBake Toaster uses.
739 As shipped, Toaster is configured to recognize four
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500740 versions of BitBake: master, fido, jethro, and HEAD.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500741 <note>
742 HEAD is a special option that builds whatever is
743 available on disk, without checking out any remote
744 Git repositories.
745 </note>
746 </para>
747
748 <para>
749 Here is the default <filename>bitbake</filename> area:
750 <literallayout class='monospaced'>
751 "bitbake" : [
752 {
753 "name": "master",
754 "giturl": "remote:origin",
755 "branch": "master",
756 "dirpath": "bitbake"
757 },
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500758 {
759 "name": "jethro",
760 "giturl": "remote:origin",
761 "branch": "jethro",
762 "dirpath": "bitbake"
763 },
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500764 {
765 "name": "fido",
766 "giturl": "remote:origin",
767 "branch": "fido",
768 "dirpath": "bitbake"
769 },
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500770 {
771 "name": "HEAD",
772 "giturl": "remote:origin",
773 "branch": "HEAD",
774 "dirpath": "bitbake"
775 }
776 ],
777 </literallayout>
778 </para>
779 </section>
780
781 <section id='json-default-area'>
782 <title>Default Area</title>
783
784 <para>
785 This area of the JSON file establishes a default
786 release used by Toaster.
787 As shipped, Toaster uses the "master" release.
788 </para>
789
790 <para>
791 Here is the statement in the JSON file that establishes
792 the default release:
793 <literallayout class='monospaced'>
794 "defaultrelease": "master",
795 </literallayout>
796 </para>
797 </section>
798
799 <section id='json-releases-area'>
800 <title>Releases Area</title>
801
802 <para>
803 This area of the JSON file defines the versions of the
804 OpenEmbedded build system Toaster recognizes.
805 As shipped, Toaster is configured to work with the four
806 releases described in the
807 "<link linkend='toaster-releases-supported'>Pre-Configured Releases</link>"
808 section.
809 </para>
810
811 <para>
812 Here is the default <filename>releases</filename> area:
813 <literallayout class='monospaced'>
814 "releases": [
815 {
816 "name": "master",
817 "description": "Yocto Project master",
818 "bitbake": "master",
819 "branch": "master",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500820 "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500821 "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
822 "helptext": "Toaster will run your builds using the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/\"&gt;Yocto Project master branch&lt;/a&gt;, where active development takes place. This is not a stable branch, so your builds might not work as expected."
823 },
824 {
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500825 "name": "jethro",
826 "description": "Yocto Project 2.0 Jethro",
827 "bitbake": "jethro",
828 "branch": "jethro",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500829 "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500830 "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
831 "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=jethro\"&gt;Yocto Project 2.0 \"Jethro\"&lt;/a&gt; branch."
832 },
833 {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500834 "name": "fido",
835 "description": "Yocto Project 1.8 Fido",
836 "bitbake": "fido",
837 "branch": "fido",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500838 "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500839 "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
840 "helptext": "Toaster will run your builds with the tip of the &lt;a href=\"http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=fido\"&gt;Yocto Project 1.8 \"Fido\"&lt;/a&gt; branch."
841 },
842 {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500843 "name": "local",
844 "description": "Local Yocto Project",
845 "bitbake": "HEAD",
846 "branch": "HEAD",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500847 "defaultlayers": [ "openembedded-core", "meta-poky", "meta-yocto-bsp"],
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500848 "layersourcepriority": { "Imported layers": 99, "Local Yocto Project" : 10, "OpenEmbedded" : 0 },
849 "helptext": "Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer."
850 }
851 ]
852 </literallayout>
853 </para>
854 </section>
855 </section>
856 </section>
857
858 <section id='toaster-useful-commands'>
859 <title>Useful Commands</title>
860
861 <para>
862 In addition to the web user interface and the scripts that start
863 and stop Toaster, command-line commands exist through the
864 <filename>manage.py</filename> management script.
865 You can find general documentation on
866 <filename>manage.py</filename> at the
867 <ulink url='https://docs.djangoproject.com/en/1.7/topics/settings/'>Django</ulink>
868 site.
869 However, several <filename>manage.py</filename> commands have been
870 created that are specific to Toaster and are used to control
871 configuration and back-end tasks.
872 You can locate these commands in the
873 <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
874 (e.g. <filename>poky</filename>) at
875 <filename>bitbake/lib/manage.py</filename>.
876 This section documents those commands.
877 <note>
878 <para>
879 When using <filename>manage.py</filename> commands given
880 a default configuration, you must be sure that your
881 working directory is set to the
882 <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
883 Using <filename>manage.py</filename> commands from the
884 Build Directory allows Toaster to find the
885 <filename>toaster.sqlite</filename> file, which is located
886 in the Build Directory.
887 </para>
888
889 <para>
890 For non-default database configurations, it is possible
891 that you can use <filename>manage.py</filename> commands
892 from a directory other than the Build directory.
893 To do so, the
894 <filename>toastermain/settings.py</filename> file must be
895 configured to point to the correct database backend.
896 </para>
897 </note>
898 </para>
899
900 <section id='toaster-command-buildslist'>
901 <title><filename>buildslist</filename></title>
902
903 <para>
904 The <filename>buildslist</filename> command lists all builds
905 that Toaster has recorded.
906 Access the command as follows:
907 <literallayout class='monospaced'>
908 $ bitbake/lib/toaster/manage.py buildslist
909 </literallayout>
910 The command returns a list, which includes numeric
911 identifications, of the builds that Toaster has recorded in the
912 current database.
913 </para>
914
915 <para>
916 You need to run the <filename>buildslist</filename> command
917 first to identify existing builds in the database before
918 using the
919 <link linkend='toaster-command-builddelete'><filename>builddelete</filename></link>
920 command.
921 Here is an example that assumes default repository and build
922 directory names:
923 <literallayout class='monospaced'>
924 $ cd ~/poky/build
925 $ python ../bitbake/lib/toaster/manage.py buildslist
926 </literallayout>
927 If your Toaster database had only one build, the above
928 <filename>buildslist</filename> command would return something
929 like the following:
930 <literallayout class='monospaced'>
931 1: qemux86 poky core-image-minimal
932 </literallayout>
933 </para>
934 </section>
935
936 <section id='toaster-command-builddelete'>
937 <title><filename>builddelete</filename></title>
938
939 <para>
940 The <filename>builddelete</filename> command deletes data
941 associated with a build.
942 Access the command as follows:
943 <literallayout class='monospaced'>
944 $ bitbake/lib/toaster/manage.py builddelete <replaceable>build_id</replaceable>
945 </literallayout>
946 The command deletes all the build data for the specified
947 <replaceable>build_id</replaceable>.
948 This command is useful for removing old and unused data from
949 the database.
950 </para>
951
952 <para>
953 Prior to running the <filename>builddelete</filename>
954 command, you need to get the ID associated with builds
955 by using the
956 <link linkend='toaster-command-buildslist'><filename>buildslist</filename></link>
957 command.
958 </para>
959 </section>
960
961 <section id='toaster-command-perf'>
962 <title><filename>perf</filename></title>
963
964 <para>
965 The <filename>perf</filename> command measures Toaster
966 performance.
967 Access the command as follows:
968 <literallayout class='monospaced'>
969 $ bitbake/lib/toaster/manage.py perf
970 </literallayout>
971 The command is a sanity check that returns page loading
972 times in order to identify performance problems.
973 </para>
974 </section>
975
976 <section id='toaster-command-checksettings'>
977 <title><filename>checksettings</filename></title>
978
979 <para>
980 The <filename>checksettings</filename> command verifies
981 existing Toaster settings.
982 Access the command as follows:
983 <literallayout class='monospaced'>
984 $ bitbake/lib/toaster/manage.py checksettings
985 </literallayout>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500986 Toaster uses settings that are based on the
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500987 database to configure the building tasks.
988 The <filename>checksettings</filename> command verifies that
989 the database settings are valid in the sense that they have
990 the minimal information needed to start a build.
991 </para>
992
993 <para>
994 In order for the <filename>checksettings</filename> command
995 to work, the database must be correctly set up and not have
996 existing data.
997 To be sure the database is ready, you can run the following:
998 <literallayout class='monospaced'>
999 $ bitbake/lib/toaster/mana​ge.py syncdb
1000 $ bitbake/lib/toaster/mana​ge.py migrate orm
1001 $ bitbake/lib/toaster/mana​ge.py migrate bldcontrol
1002 </literallayout>
1003 After running these commands, you can run the
1004 <filename>checksettings</filename> command.
1005 </para>
1006 </section>
1007
1008 <section id='toaster-command-loadconf'>
1009 <title><filename>loadconf</filename></title>
1010
1011 <para>
1012 The <filename>loadconf</filename> command loads an
1013 existing Toaster configuration file (JSON file).
1014 You must run this on a new database that does not have any
1015 data.
1016 Running this command on an existing database that has data
1017 results in errors.
1018 Access the command as follows:
1019 <literallayout class='monospaced'>
1020 $ bitbake/lib/toaster/manage.py loadconf <replaceable>filepath</replaceable>
1021 </literallayout>
1022 The <filename>loadconf</filename> command configures a database
1023 based on the supplied existing
1024 <filename>toasterconf.json</filename> file.
1025 For information on the <filename>toasterconf.json</filename>,
1026 see the
1027 "<link linkend='toaster-json-files'>JSON Files</link>"
1028 section.
1029 </para>
1030 </section>
1031
1032 <section id='toaster-command-runbuilds'>
1033 <title><filename>runbuilds</filename></title>
1034
1035 <para>
1036 The <filename>runbuilds</filename> command launches
1037 scheduled builds.
1038 Access the command as follows:
1039 <literallayout class='monospaced'>
1040 $ bitbake/lib/toaster/manage.py runbuilds
1041 </literallayout>
1042 The <filename>runbuilds</filename> command checks if
1043 scheduled builds exist in the database and then launches them
1044 per schedule.
1045 The command returns after the builds start but before they
1046 complete.
1047 The Toaster Logging Interface records and updates the database
1048 when the builds complete.
1049 </para>
1050 </section>
1051 </section>
1052</chapter>