toaster-manual-setup-and-use.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <!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. <!--SPDX-License-Identifier: CC-BY-2.0-UK-->
  5. <chapter id='toaster-manual-setup-and-use'>
  6. <title>Setting Up and Using Toaster</title>
  7. <section id='starting-toaster-for-local-development'>
  8. <title>Starting Toaster for Local Development</title>
  9. <para>
  10. Once you have set up the Yocto Project and installed the
  11. Toaster system dependencies as described in the
  12. "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>"
  13. chapter, you are ready to start Toaster.
  14. </para>
  15. <para>
  16. Navigate to the root of your
  17. <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
  18. (e.g. <filename>poky</filename>):
  19. <literallayout class='monospaced'>
  20. $ cd poky
  21. </literallayout>
  22. Once in that directory, source the build environment script:
  23. <literallayout class='monospaced'>
  24. $ source oe-init-build-env
  25. </literallayout>
  26. Next, from the build directory (e.g.
  27. <filename>poky/build</filename>), start Toaster using this
  28. command:
  29. <literallayout class='monospaced'>
  30. $ source toaster start
  31. </literallayout>
  32. You can now run your builds from the command line, or with
  33. Toaster as explained in section
  34. "<link linkend='using-the-toaster-web-interface'>Using the Toaster Web Interface</link>".
  35. </para>
  36. <para>
  37. To access the Toaster web interface, open your favorite
  38. browser and enter the following:
  39. <literallayout class='monospaced'>
  40. http://127.0.0.1:8000
  41. </literallayout>
  42. </para>
  43. </section>
  44. <section id='setting-a-different-port'>
  45. <title>Setting a Different Port</title>
  46. <para>
  47. By default, Toaster starts on port 8000.
  48. You can use the <filename>WEBPORT</filename> parameter to
  49. set a different port.
  50. For example, the following command sets the port to "8400":
  51. <literallayout class='monospaced'>
  52. $ source toaster start webport=8400
  53. </literallayout>
  54. </para>
  55. </section>
  56. <section id='setting-up-toaster-without-a-web-server'>
  57. <title>Setting Up Toaster Without a Web Server</title>
  58. <para>
  59. You can start a Toaster environment without starting its
  60. web server. This is useful for the following:
  61. <itemizedlist>
  62. <listitem><para>
  63. Capturing a command-line build's statistics into
  64. the Toaster database for examination later.
  65. </para></listitem>
  66. <listitem><para>
  67. Capturing a command-line build's statistics when
  68. the Toaster server is already running.
  69. </para></listitem>
  70. <listitem><para>
  71. Having one instance of the Toaster web server
  72. track and capture multiple command-line builds,
  73. where each build is started in its own "noweb"
  74. Toaster environment.
  75. </para></listitem>
  76. </itemizedlist>
  77. The following commands show how to start a Toaster environment
  78. without starting its web server, perform BitBake operations,
  79. and then shut down the Toaster environment.
  80. Once the build is complete, you can close the Toaster environment.
  81. Before closing the environment, however, you should allow a few
  82. minutes to ensure the complete transfer of its BitBake build
  83. statistics to the Toaster database.
  84. If you have a separate Toaster web server instance running, you
  85. can watch this command-line build's progress and examine the
  86. results as soon as they are posted:
  87. <literallayout class='monospaced'>
  88. $ source toaster start noweb
  89. $ bitbake <replaceable>target</replaceable>
  90. $ source toaster stop
  91. </literallayout>
  92. </para>
  93. </section>
  94. <section id='setting-up-toaster-without-a-build-server'>
  95. <title>Setting Up Toaster Without a Build Server</title>
  96. <para>
  97. You can start a Toaster environment with the
  98. "New Projects" feature disabled.
  99. Doing so is useful for the following:
  100. <itemizedlist>
  101. <listitem><para>
  102. Sharing your build results over the web server while
  103. blocking others from starting builds on your host.
  104. </para></listitem>
  105. <listitem><para>
  106. Allowing only local command-line builds to be captured
  107. into the Toaster database.
  108. </para></listitem>
  109. </itemizedlist>
  110. Use the following command to set up Toaster without a
  111. build server:
  112. <literallayout class='monospaced'>
  113. $ source toaster start nobuild webport=<replaceable>port</replaceable>
  114. </literallayout>
  115. </para>
  116. </section>
  117. <section id='setting-up-external-access'>
  118. <title>Setting up External Access</title>
  119. <para>
  120. By default, Toaster binds to the loop back address
  121. (i.e. localhost), which does not allow access from
  122. external hosts. To allow external access, use the
  123. <filename>WEBPORT</filename> parameter to open an
  124. address that connects to the network, specifically the
  125. IP address that your NIC uses to connect to the network.
  126. You can also bind to all IP addresses the computer
  127. supports by using the shortcut
  128. "0.0.0.0:<replaceable>port</replaceable>".
  129. </para>
  130. <para>
  131. The following example binds to all IP addresses on the
  132. host:
  133. <literallayout class='monospaced'>
  134. $ source toaster start webport=0.0.0.0:8400
  135. </literallayout>
  136. This example binds to a specific IP address on the host's
  137. NIC:
  138. <literallayout class='monospaced'>
  139. $ source toaster start webport=192.168.1.1:8400
  140. </literallayout>
  141. </para>
  142. </section>
  143. <section id='the-directory-for-cloning-layers'>
  144. <title>The Directory for Cloning Layers</title>
  145. <para>
  146. Toaster creates a <filename>_toaster_clones</filename>
  147. directory inside your Source Directory
  148. (i.e. <filename>poky</filename>) to clone any layers
  149. needed for your builds.
  150. </para>
  151. <para>
  152. Alternatively, if you would like all of your Toaster related
  153. files and directories to be in a particular location other than
  154. the default, you can set the <filename>TOASTER_DIR</filename>
  155. environment variable, which takes precedence over your current
  156. working directory.
  157. Setting this environment variable causes Toaster to create and use
  158. <filename>$TOASTER_DIR./_toaster_clones</filename>.
  159. </para>
  160. </section>
  161. <section id='toaster-the-build-directory'>
  162. <title>The Build Directory</title>
  163. <para>
  164. Toaster creates a build directory within your Source
  165. Directory (e.g. <filename>poky</filename>) to execute
  166. the builds.
  167. </para>
  168. <para>
  169. Alternatively, if you would like all of your Toaster related files
  170. and directories to be in a particular location, you can set
  171. the <filename>TOASTER_DIR</filename> environment variable,
  172. which takes precedence over your current working directory.
  173. Setting this environment variable causes Toaster to use
  174. <filename>$TOASTER_DIR/build</filename> as the build directory.
  175. </para>
  176. </section>
  177. <section id='toaster-creating-a-django-super-user'>
  178. <title>Creating a Django Superuser</title>
  179. <para>
  180. Toaster is built on the
  181. <ulink url='https://www.djangoproject.com/'>Django framework</ulink>.
  182. Django provides an administration interface you can use
  183. to edit Toaster configuration parameters.
  184. </para>
  185. <para>
  186. To access the Django administration interface, you must
  187. create a superuser by following these steps:
  188. <orderedlist>
  189. <listitem><para>
  190. If you used <filename>pip3</filename>, which is
  191. recommended, to set up the Toaster system dependencies,
  192. you need be sure the local user path is in your
  193. <filename>PATH</filename> list.
  194. To append the pip3 local user path, use the following
  195. command:
  196. <literallayout class='monospaced'>
  197. $ export PATH=$PATH:$HOME/.local/bin
  198. </literallayout>
  199. </para></listitem>
  200. <listitem><para>
  201. From the directory containing the Toaster database,
  202. which by default is the
  203. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
  204. invoke the <filename>createsuperuser</filename> command
  205. from <filename>manage.py</filename>:
  206. <literallayout class='monospaced'>
  207. $ cd ~/poky/build
  208. $ ../bitbake/lib/toaster/manage.py createsuperuser
  209. </literallayout>
  210. </para></listitem>
  211. <listitem><para>
  212. Django prompts you for the username, which you need to
  213. provide.
  214. </para></listitem>
  215. <listitem><para>
  216. Django prompts you for an email address, which is
  217. optional.
  218. </para></listitem>
  219. <listitem><para>
  220. Django prompts you for a password, which you must provide.
  221. </para></listitem>
  222. <listitem><para>
  223. Django prompts you to re-enter your password for verification.
  224. </para></listitem>
  225. </orderedlist>
  226. After completing these steps, the following confirmation message
  227. appears:
  228. <literallayout class='monospaced'>
  229. Superuser created successfully.
  230. </literallayout>
  231. </para>
  232. <para>
  233. Creating a superuser allows you to access the Django administration
  234. interface through a browser.
  235. The URL for this interface is the same as the URL used for the
  236. Toaster instance with "/admin" on the end.
  237. For example, if you are running Toaster locally, use the
  238. following URL:
  239. <literallayout class='monospaced'>
  240. http://127.0.0.1:8000/admin
  241. </literallayout>
  242. You can use the Django administration interface to set Toaster
  243. configuration parameters such as the build directory, layer sources,
  244. default variable values, and BitBake versions.
  245. </para>
  246. </section>
  247. <section id='toaster-setting-up-a-production-instance-of-toaster'>
  248. <title>Setting Up a Production Instance of Toaster</title>
  249. <para>
  250. You can use a production instance of Toaster to share the
  251. Toaster instance with remote users, multiple users, or both.
  252. The production instance is also the setup that can handle
  253. heavier loads on the web service.
  254. Use the instructions in the following sections to set up
  255. Toaster to run builds through the Toaster web interface.
  256. </para>
  257. <section id='toaster-production-instance-requirements'>
  258. <title>Requirements</title>
  259. <para>
  260. Be sure you meet the following requirements:
  261. <note>
  262. You must comply with all Apache,
  263. <filename>mod-wsgi</filename>, and Mysql requirements.
  264. </note>
  265. <itemizedlist>
  266. <listitem><para>
  267. Have all the build requirements as described in the
  268. "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>"
  269. chapter.
  270. </para></listitem>
  271. <listitem><para>
  272. Have an Apache webserver.
  273. </para></listitem>
  274. <listitem><para>
  275. Have <filename>mod-wsgi</filename> for the Apache
  276. webserver.
  277. </para></listitem>
  278. <listitem><para>
  279. Use the Mysql database server.
  280. </para></listitem>
  281. <listitem><para>
  282. If you are using Ubuntu 16.04, run the following:
  283. <literallayout class='monospaced'>
  284. $ sudo apt-get install apache2 libapache2-mod-wsgi-py3 mysql-server python3-pip libmysqlclient-dev
  285. </literallayout>
  286. </para></listitem>
  287. <listitem><para>
  288. If you are using Fedora 24 or a RedHat distribution, run
  289. the following:
  290. <literallayout class='monospaced'>
  291. $ sudo dnf install httpd python3-mod_wsgi python3-pip mariadb-server mariadb-devel python3-devel
  292. </literallayout>
  293. </para></listitem>
  294. <listitem><para>
  295. If you are using openSUSE Leap 42.1, run
  296. the following:
  297. <literallayout class='monospaced'>
  298. $ sudo zypper install apache2 apache2-mod_wsgi-python3 python3-pip mariadb mariadb-client python3-devel
  299. </literallayout>
  300. </para></listitem>
  301. </itemizedlist>
  302. </para>
  303. </section>
  304. <section id='toaster-installation-steps'>
  305. <title>Installation</title>
  306. <para>
  307. Perform the following steps to install Toaster:
  308. <orderedlist>
  309. <listitem><para>
  310. Create toaster user and set its home directory to
  311. <filename>/var/www/toaster</filename>:
  312. <literallayout class='monospaced'>
  313. $ sudo /usr/sbin/useradd toaster -md /var/www/toaster -s /bin/false
  314. $ sudo su - toaster -s /bin/bash
  315. </literallayout>
  316. </para></listitem>
  317. <listitem><para>
  318. Checkout a copy of <filename>poky</filename>
  319. into the web server directory.
  320. You will be using <filename>/var/www/toaster</filename>:
  321. <literallayout class='monospaced'>
  322. $ git clone git://git.yoctoproject.org/poky
  323. $ git checkout &DISTRO_NAME_NO_CAP;
  324. </literallayout>
  325. </para></listitem>
  326. <listitem><para>
  327. Install Toaster
  328. dependencies using the --user flag which
  329. keeps the Python packages
  330. isolated from your system-provided packages:
  331. <literallayout class='monospaced'>
  332. $ cd /var/www/toaster/
  333. $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
  334. $ pip3 install --user mysqlclient
  335. </literallayout>
  336. <note>
  337. Isolating these packages is not required but is
  338. recommended.
  339. Alternatively, you can use your operating system's
  340. package manager to install the packages.
  341. </note>
  342. </para></listitem>
  343. <listitem><para>
  344. Configure Toaster by editing
  345. <filename>/var/www/toaster/poky/bitbake/lib/toaster/toastermain/settings.py</filename>
  346. as follows:
  347. <itemizedlist>
  348. <listitem><para>
  349. Edit the
  350. <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#databases'>DATABASES</ulink>
  351. settings:
  352. <literallayout class='monospaced'>
  353. DATABASES = {
  354. 'default': {
  355. 'ENGINE': 'django.db.backends.mysql',
  356. 'NAME': 'toaster_data',
  357. 'USER': 'toaster',
  358. 'PASSWORD': 'yourpasswordhere',
  359. 'HOST': 'localhost',
  360. 'PORT': '3306',
  361. }
  362. }
  363. </literallayout>
  364. </para></listitem>
  365. <listitem><para>
  366. Edit the
  367. <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-SECRET_KEY'>SECRET_KEY</ulink>:
  368. <literallayout class='monospaced'>
  369. SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
  370. </literallayout>
  371. </para></listitem>
  372. <listitem><para>
  373. Edit the
  374. <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATIC_ROOT'>STATIC_ROOT</ulink>:
  375. <literallayout class='monospaced'>
  376. STATIC_ROOT = '/var/www/toaster/static_files/'
  377. </literallayout>
  378. </para></listitem>
  379. </itemizedlist>
  380. </para></listitem>
  381. <listitem><para>
  382. Add the database and user to the <filename>mysql</filename>
  383. server defined earlier:
  384. <literallayout class='monospaced'>
  385. $ mysql -u root -p
  386. mysql> CREATE DATABASE toaster_data;
  387. mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
  388. mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
  389. mysql> quit
  390. </literallayout>
  391. </para></listitem>
  392. <listitem><para>
  393. Get Toaster to create the database schema,
  394. default data, and gather the statically-served files:
  395. <literallayout class='monospaced'>
  396. $ cd /var/www/toaster/poky/
  397. $ ./bitbake/lib/toaster/manage.py migrate
  398. $ TOASTER_DIR=`pwd` TEMPLATECONF='poky' \
  399. ./bitbake/lib/toaster/manage.py checksettings
  400. $ ./bitbake/lib/toaster/manage.py collectstatic
  401. </literallayout>
  402. In the previous example, from the <filename>poky</filename>
  403. directory, the <filename>migrate</filename> command
  404. ensures the database schema changes have propagated
  405. correctly (i.e. migrations).
  406. The next line sets the Toaster root directory
  407. <filename>TOASTER_DIR</filename> and the location
  408. of the Toaster configuration file
  409. <filename>TOASTER_CONF</filename>, which is relative to
  410. <filename>TOASTER_DIR</filename>.
  411. The <filename>TEMPLATECONF</filename> value reflects the
  412. contents of <filename>poky/.templateconf</filename>, and
  413. by default, should include the string "poky".
  414. For more information on the Toaster configuration
  415. file, see the
  416. "<link linkend='configuring-toaster'>Configuring Toaster</link>"
  417. section.</para>
  418. <para>This line also runs the <filename>checksettings</filename>
  419. command, which configures the location of the Toaster
  420. <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
  421. The Toaster root directory <filename>TOASTER_DIR</filename>
  422. determines where the Toaster build directory
  423. is created on the file system.
  424. In the example above,
  425. <filename>TOASTER_DIR</filename> is set as follows:
  426. <literallayout class="monospaced">
  427. /var/www/toaster/poky
  428. </literallayout>
  429. This setting causes the Toaster build directory to be:
  430. <literallayout class="monospaced">
  431. /var/www/toaster/poky/build
  432. </literallayout></para>
  433. <para>Finally, the <filename>collectstatic</filename> command
  434. is a Django framework command that collects all the
  435. statically served files into a designated directory to
  436. be served up by the Apache web server as defined by
  437. <filename>STATIC_ROOT</filename>.
  438. </para></listitem>
  439. <listitem><para>
  440. Test and/or use the Mysql integration with Toaster's
  441. Django web server.
  442. At this point, you can start up the normal Toaster
  443. Django web server with the Toaster database in Mysql.
  444. You can use this web server to confirm that the database
  445. migration and data population from the Layer Index is
  446. complete.</para>
  447. <para>To start the default Toaster Django web server with
  448. the Toaster database now in Mysql, use the standard
  449. start commands:
  450. <literallayout class='monospaced'>
  451. $ source oe-init-build-env
  452. $ source toaster start
  453. </literallayout>
  454. Additionally, if Django is sufficient for your requirements,
  455. you can use it for your release system and migrate later
  456. to Apache as your requirements change.
  457. </para></listitem>
  458. <listitem><para>
  459. Add an Apache configuration file for Toaster to your Apache web
  460. server's configuration directory.
  461. If you are using Ubuntu or Debian, put the file here:
  462. <literallayout class='monospaced'>
  463. /etc/apache2/conf-available/toaster.conf
  464. </literallayout>
  465. If you are using Fedora or RedHat, put it here:
  466. <literallayout class='monospaced'>
  467. /etc/httpd/conf.d/toaster.conf
  468. </literallayout>
  469. If you are using OpenSUSE, put it here:
  470. <literallayout class='monospaced'>
  471. /etc/apache2/conf.d/toaster.conf
  472. </literallayout>
  473. Following is a sample Apache configuration for Toaster
  474. you can follow:
  475. <literallayout class='monospaced'>
  476. Alias /static /var/www/toaster/static_files
  477. &lt;Directory /var/www/toaster/static_files&gt;
  478. &lt;IfModule mod_access_compat.c&gt;
  479. Order allow,deny
  480. Allow from all
  481. &lt;/IfModule&gt;
  482. &lt;IfModule !mod_access_compat.c&gt;
  483. Require all granted
  484. &lt;/IfModule&gt;
  485. &lt;/Directory&gt;
  486. &lt;Directory /var/www/toaster/poky/bitbake/lib/toaster/toastermain&gt;
  487. &lt;Files "wsgi.py"&gt;
  488. Require all granted
  489. &lt;/Files&gt;
  490. &lt;/Directory&gt;
  491. WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/.local/lib/python3.4/site-packages
  492. WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
  493. &lt;Location /&gt;
  494. WSGIProcessGroup toaster_wsgi
  495. &lt;/Location&gt;
  496. </literallayout>
  497. If you are using Ubuntu or Debian,
  498. you will need to enable the config and module for Apache:
  499. <literallayout class='monospaced'>
  500. $ sudo a2enmod wsgi
  501. $ sudo a2enconf toaster
  502. $ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
  503. </literallayout>
  504. Finally, restart Apache to make sure all new configuration
  505. is loaded.
  506. For Ubuntu, Debian, and OpenSUSE use:
  507. <literallayout class='monospaced'>
  508. $ sudo service apache2 restart
  509. </literallayout>
  510. For Fedora and RedHat use:
  511. <literallayout class='monospaced'>
  512. $ sudo service httpd restart
  513. </literallayout>
  514. </para></listitem>
  515. <listitem><para>
  516. Prepare the systemd service to run Toaster builds.
  517. Here is a sample configuration file for the service:
  518. <literallayout class='monospaced'>
  519. [Unit]
  520. Description=Toaster runbuilds
  521. [Service]
  522. Type=forking
  523. User=toaster
  524. ExecStart=/usr/bin/screen -d -m -S runbuilds /var/www/toaster/poky/bitbake/lib/toaster/runbuilds-service.sh start
  525. ExecStop=/usr/bin/screen -S runbuilds -X quit
  526. WorkingDirectory=/var/www/toaster/poky
  527. [Install]
  528. WantedBy=multi-user.target
  529. </literallayout>
  530. Prepare the <filename>runbuilds-service.sh</filename>
  531. script that you need to place in the
  532. <filename>/var/www/toaster/poky/bitbake/lib/toaster/</filename>
  533. directory by setting up executable permissions:
  534. <literallayout class='monospaced'>
  535. #!/bin/bash
  536. #export http_proxy=http://proxy.host.com:8080
  537. #export https_proxy=http://proxy.host.com:8080
  538. #export GIT_PROXY_COMMAND=$HOME/bin/gitproxy
  539. cd ~/poky/
  540. source ./oe-init-build-env build
  541. source ../bitbake/bin/toaster $1 noweb
  542. [ "$1" == 'start' ] &amp;&amp; /bin/bash
  543. </literallayout>
  544. </para></listitem>
  545. <listitem><para>
  546. Run the service:
  547. <literallayout class='monospaced'>
  548. # service runbuilds start
  549. </literallayout>
  550. Since the service is running in a detached screen
  551. session, you can attach to it using this command:
  552. <literallayout class='monospaced'>
  553. $ sudo su - toaster
  554. $ screen -rS runbuilds
  555. </literallayout>
  556. You can detach from the service again using "Ctrl-a"
  557. followed by "d" key combination.
  558. </para></listitem>
  559. </orderedlist>
  560. You can now open up a browser and start using Toaster.
  561. </para>
  562. </section>
  563. </section>
  564. <section id='using-the-toaster-web-interface'>
  565. <title>Using the Toaster Web Interface</title>
  566. <para>
  567. The Toaster web interface allows you to do the following:
  568. <itemizedlist>
  569. <listitem><para>
  570. Browse published layers in the
  571. <ulink url='http://layers.openembedded.org'>OpenEmbedded Layer Index</ulink>
  572. that are available for your selected version of the build
  573. system.
  574. </para></listitem>
  575. <listitem><para>
  576. Import your own layers for building.
  577. </para></listitem>
  578. <listitem><para>
  579. Add and remove layers from your configuration.
  580. </para></listitem>
  581. <listitem><para>
  582. Set configuration variables.
  583. </para></listitem>
  584. <listitem><para>
  585. Select a target or multiple targets to build.
  586. </para></listitem>
  587. <listitem><para>
  588. Start your builds.
  589. </para></listitem>
  590. <listitem><para>
  591. See what was built (recipes and packages) and what
  592. packages were installed into your final image.
  593. </para></listitem>
  594. <listitem><para>
  595. Browse the directory structure of your image.
  596. </para></listitem>
  597. <listitem><para>
  598. See the value of all variables in your build configuration,
  599. and which files set each value.
  600. </para></listitem>
  601. <listitem><para>
  602. Examine error, warning and trace messages to aid in
  603. debugging.
  604. </para></listitem>
  605. <listitem><para>
  606. See information about the BitBake tasks executed and
  607. reused during your build, including those that used
  608. shared state.
  609. </para></listitem>
  610. <listitem><para>
  611. See dependency relationships between recipes, packages
  612. and tasks.
  613. </para></listitem>
  614. <listitem><para>
  615. See performance information such as build time, task time,
  616. CPU usage, and disk I/O.
  617. </para></listitem>
  618. </itemizedlist>
  619. </para>
  620. <section id='web-interface-videos'>
  621. <title>Toaster Web Interface Videos</title>
  622. <para>
  623. Following are several videos that show how to use the Toaster GUI:
  624. <itemizedlist>
  625. <listitem><para><emphasis>Build Configuration:</emphasis>
  626. This
  627. <ulink url='https://www.youtube.com/watch?v=qYgDZ8YzV6w'>video</ulink>
  628. overviews and demonstrates build configuration for Toaster.
  629. </para></listitem>
  630. <listitem><para><emphasis>Build Custom Layers:</emphasis>
  631. This
  632. <ulink url='https://www.youtube.com/watch?v=QJzaE_XjX5c'>video</ulink>
  633. shows you how to build custom layers that are used with
  634. Toaster.
  635. </para></listitem>
  636. <listitem><para><emphasis>Toaster Homepage and Table Controls:</emphasis>
  637. This
  638. <ulink url='https://www.youtube.com/watch?v=QEARDnrR1Xw'>video</ulink>
  639. goes over the Toaster entry page, and provides
  640. an overview of the data manipulation capabilities of
  641. Toaster, which include search, sorting and filtering by
  642. different criteria.
  643. </para></listitem>
  644. <listitem><para><emphasis>Build Dashboard:</emphasis>
  645. This
  646. <ulink url='https://www.youtube.com/watch?v=KKqHYcnp2gE'>video</ulink>
  647. shows you the build dashboard, a page providing an
  648. overview of the information available for a selected build.
  649. </para></listitem>
  650. <listitem><para><emphasis>Image Information:</emphasis>
  651. This
  652. <ulink url='https://www.youtube.com/watch?v=XqYGFsmA0Rw'>video</ulink>
  653. walks through the information Toaster provides
  654. about images: packages installed and root file system.
  655. </para></listitem>
  656. <listitem><para><emphasis>Configuration:</emphasis>
  657. This
  658. <ulink url='https://www.youtube.com/watch?v=UW-j-T2TzIg'>video</ulink>
  659. provides Toaster build configuration information.
  660. </para></listitem>
  661. <listitem><para><emphasis>Tasks:</emphasis>
  662. This
  663. <ulink url='https://www.youtube.com/watch?v=D4-9vGSxQtw'>video</ulink>
  664. shows the information Toaster provides about the
  665. tasks run by the build system.
  666. </para></listitem>
  667. <listitem><para><emphasis>Recipes and Packages Built:</emphasis>
  668. This
  669. <ulink url='https://www.youtube.com/watch?v=x-6dx4huNnw'>video</ulink>
  670. shows the information Toaster provides about recipes
  671. and packages built.
  672. </para></listitem>
  673. <listitem><para><emphasis>Performance Data:</emphasis>
  674. This
  675. <ulink url='https://www.youtube.com/watch?v=qWGMrJoqusQ'>video</ulink>
  676. shows the build performance data provided by
  677. Toaster.
  678. </para></listitem>
  679. </itemizedlist>
  680. </para>
  681. </section>
  682. <section id='a-note-on-the-local-yocto-project-release'>
  683. <title>Additional Information About the Local Yocto Project Release</title>
  684. <para>
  685. This section only applies if you have set up Toaster
  686. for local development, as explained in the
  687. "<link linkend='starting-toaster-for-local-development'>Starting Toaster for Local Development</link>"
  688. section.
  689. </para>
  690. <para>
  691. When you create a project in Toaster, you will be asked to
  692. provide a name and to select a Yocto Project release.
  693. One of the release options you will find is called
  694. "Local Yocto Project".
  695. <imagedata fileref="figures/new-project.png" align="center" width="9in" />
  696. </para>
  697. <para>
  698. When you select the "Local Yocto Project" release, Toaster
  699. will run your builds using the local Yocto
  700. Project clone you have in your computer: the same clone
  701. you are using to run Toaster.
  702. Unless you manually update
  703. this clone, your builds will always use the same Git revision.
  704. </para>
  705. <para>
  706. If you select any of the other release options, Toaster
  707. will fetch the tip of your selected release from the upstream
  708. <ulink url='https://git.yoctoproject.org'>Yocto Project repository</ulink>
  709. every time you run a build.
  710. Fetching this tip effectively
  711. means that if your selected release is updated upstream, the
  712. Git revision you are using for your builds will change.
  713. If you are doing development locally, you might not want this
  714. change to happen.
  715. In that case, the "Local Yocto Project"
  716. release might be the right choice.
  717. </para>
  718. <para>
  719. However, the "Local Yocto Project" release
  720. will not provide you with any compatible layers, other than the
  721. three core layers that come with the Yocto Project:
  722. <itemizedlist>
  723. <listitem><para>
  724. <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/openembedded-core/'>openembedded-core</ulink>
  725. </para></listitem>
  726. <listitem><para>
  727. <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-poky/'>meta-poky</ulink>
  728. </para></listitem>
  729. <listitem><para>
  730. <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-yocto-bsp/'>meta-yocto-bsp</ulink>
  731. </para></listitem>
  732. </itemizedlist>
  733. <imagedata fileref="figures/compatible-layers.png" align="center" width="9in" />
  734. </para>
  735. <para>
  736. If you want to build any other layers, you will need to
  737. manually import them into your Toaster project, using the
  738. "Import layer" page.
  739. <imagedata fileref="figures/import-layer.png" align="center" width="9in" />
  740. </para>
  741. </section>
  742. <section id='toaster-web-interface-preferred-version'>
  743. <title>Building a Specific Recipe Given Multiple Versions</title>
  744. <para>
  745. Occasionally, a layer might provide more than one version of
  746. the same recipe.
  747. For example, the <filename>openembedded-core</filename> layer
  748. provides two versions of the <filename>bash</filename> recipe
  749. (i.e. 3.2.48 and 4.3.30-r0) and two versions of the
  750. <filename>which</filename> recipe (i.e. 2.21 and 2.18).
  751. The following figure shows this exact scenario:
  752. <imagedata fileref="figures/bash-oecore.png" align="center" width="9in" depth="6in" />
  753. </para>
  754. <para>
  755. By default, the OpenEmbedded build system builds one of the
  756. two recipes.
  757. For the <filename>bash</filename> case, version 4.3.30-r0 is
  758. built by default.
  759. Unfortunately, Toaster as it exists, is not able to override
  760. the default recipe version.
  761. If you would like to build bash 3.2.48, you need to set the
  762. <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
  763. variable.
  764. You can do so from Toaster, using the "Add variable" form,
  765. which is available in the "BitBake variables" page of the
  766. project configuration section as shown in the following screen:
  767. <imagedata fileref="figures/add-variable.png" align="center" width="9in" depth="6in" />
  768. </para>
  769. <para>
  770. To specify <filename>bash</filename> 3.2.48 as the version to build,
  771. enter "PREFERRED_VERSION_bash" in the "Variable" field, and "3.2.48"
  772. in the "Value" field.
  773. Next, click the "Add variable" button:
  774. <imagedata fileref="figures/set-variable.png" align="center" width="9in" depth="6in" />
  775. </para>
  776. <para>
  777. After clicking the "Add variable" button, the settings for
  778. <filename>PREFERRED_VERSION</filename> are added to the bottom
  779. of the BitBake variables list.
  780. With these settings, the OpenEmbedded build system builds the
  781. desired version of the recipe rather than the default version:
  782. <imagedata fileref="figures/variable-added.png" align="center" width="9in" depth="6in" />
  783. </para>
  784. </section>
  785. </section>
  786. </chapter>