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