Skip to content
This repository was archived by the owner on Apr 19, 2019. It is now read-only.

Commit e4e0094

Browse files
committed
Merge pull request #82 from pohly/ostro-1.0-doc
manual combo-layer run
2 parents 77f15f2 + b125ba4 commit e4e0094

File tree

2 files changed

+103
-13
lines changed

2 files changed

+103
-13
lines changed

conf/combo-layer.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ src_uri = git@github.com:ostroproject/meta-ostro.git
2929
dest_dir = .
3030
hook = conf/combo-layerhook-generic.sh
3131
branch = master
32-
last_revision = 3c2b33199550139622e5aee5719b847f1320591f
32+
last_revision = f8b6a7ef574c3c280b1d324160ad9bfb7ae12bb6
3333

3434
[meta-ostro-fixes]
3535
src_uri = git@github.com:ostroproject/meta-ostro-fixes.git

doc/howtos/building-images.rst

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Initial Steps
1313
=============
1414

1515
#. If your development system is behind a firewall, verify that your proxy settings are configured
16-
to allow access to the internet for http, https, ftp, and git resources needed by
16+
to allow access to the internet for HTTP, HTTPS, FTP, and Git resources needed by
1717
the Yocto Project build tools, as explained in `Yocto Project Quick Start: Building Images`_
1818
and with more details in `Yocto Project: Working Behind a Network Proxy`_
1919

@@ -42,18 +42,19 @@ Initial Steps
4242
image using :command:`bitbake`. (additional build target options are explained
4343
in the sections below.) ::
4444

45-
$ bitbake ostro-image-noswupd
45+
$ bitbake -k ostro-image-noswupd
4646

4747
Depending on the number of processors and cores, the amount of RAM, the speed of the internet connection and
48-
other factors, the build process could take several hours the first time you run it.
48+
other factors, the build process could take several hours the first time you run it. The ``-k`` option tells
49+
bitbake to continue as far as possible after finding an error (instead of stopping at the first error).
4950
It will download and compile all the source code needed to create the binary image, including the Linux kernel,
5051
compiler tools, upstream components and Ostro OS-specific patches. (If you haven't
5152
done so yet, this might be a good time to read through
5253
the `Yocto Project Quick Start Guide`_.) Subsequent builds
5354
run much faster since parts of the build are cached.
5455

5556
If errors occur during the build, refer to the `Yocto Project Errors and Warnings`_ documentation to help
56-
resolve the issues, and repeat the ``bitbake ostro-image-noswupd`` command to continue.
57+
resolve the issues, and repeat the ``bitbake -k ostro-image-noswupd`` command to continue.
5758

5859
When the build process completes, the generated image will be in the folder
5960
:file:`build/tmp-glibc/deploy/images/$(MACHINE)`
@@ -134,7 +135,7 @@ Target MACHINE Architecture
134135

135136
The build's default target architecture ``MACHINE`` is ``intel-corei7-64``, appropriate for the
136137
MinnowBoard Turbot and GigaByte platforms,
137-
as configured in :file:`build/conf/local.conf`.
138+
as configured in :file:`conf/local.conf`.
138139
You can edit the :file:`local.conf` file to change this to a different machine appropriate for your platform.
139140

140141
For currently :ref:`platforms`, the appropriate ``MACHINE`` selections are:
@@ -203,6 +204,17 @@ In your cloned ``ostro-os`` repository folder, ``./meta-ostro/classes/ostro-imag
203204
contains the base definitions for building Ostro OS images. ``./meta-ostro/recipes-image/images/``
204205
contains some example image recipes.
205206

207+
A Yocto Project recipe is a set of instructions for building packages, including:
208+
* where to obtain the upstream sources (``SRC_URI``) and which patches to apply (Yocto Project call this "fetching")
209+
* dependencies on libraries or other recipes: ``DEPENDS`` and ``RDEPENDS``.
210+
* configuration and compilation options: ``EXTRA_OECONF, EXTRA_OEMAKE``
211+
* define which files go into what output packages: ``FILES_*``
212+
213+
Recipes can build one or more packages from source code, including the kernel as well as userspace applications.
214+
Recipes can also build package groups and even full system images. Inheritance can be used for
215+
common design patterns by providing a class file which is then inherited by other recipes.
216+
217+
206218
The ``ostro-image.bbclass`` can be used in two modes, depending on the ``swupd`` image feature:
207219

208220
* swupd active: produces a swupd update stream when building images and in
@@ -213,8 +225,7 @@ The ``ostro-image.bbclass`` can be used in two modes, depending on the ``swupd``
213225

214226
Developers are encouraged to start building images the traditional way
215227
by using image recipes like ``ostro-image-noswupd`` where swupd is
216-
turned off and only use swupd during deployment.
217-
228+
turned off and only use swupd during deployment.
218229
That's because image creation based on swupd bundles and swupd bundle
219230
creation itself cause additional overhead (disk space, compile time)
220231
due to the extra work that needs to be done (creating multiple rootfs
@@ -230,17 +241,34 @@ The following instructions assume that swupd is not used.
230241
231242
.. TODO: document how to create custom image recipes based on ostro-image.bbclass.
232243
244+
.. _`ostro-image.bbclass`: https://github.com/ostroproject/meta-ostro/blob/master/meta-ostro/classes/ostro-image.bbclass
233245

234-
Installing Additional Packages without swupd
235-
--------------------------------------------
246+
Installing Additional Packages (without swupd)
247+
----------------------------------------------
248+
249+
An image derived from ``ostro-image.bbclass`` without additional
250+
configuration is minimal and establishes a core OS with components
251+
that must always be present on a device. All additional components beyond
252+
this minimal configuration must be added explicitly by setting
253+
``OSTRO_IMAGE_EXTRA_FEATURES`` and/or ``OSTRO_IMAGE_EXTRA_INSTALL`` adding them
254+
to the image when building without swupd.
255+
256+
The ``ostro-os`` repo contains many layers and recipes that are not enabled
257+
but are available for your use. You can see these by using the commands:::
258+
259+
$ bitbake-layers show-recipes
260+
$ bitbake-layers show-layers
236261

237262
``ostro-image.bbclass`` defines several image features which can be enabled
238-
to install additional sets of components. For example, to install debugging
263+
to install additional sets of pre-defined components. For example, to install debugging
239264
tools, compilers and development files for all components in the image, add::
240265

241266
OSTRO_IMAGE_EXTRA_FEATURES += "tools-debug tools-develop dev-pkgs"
242267

243-
Extend ``OSTRO_IMAGE_EXTRA_INSTALL`` to install additional individual packages,
268+
See your local copy of ``ostro-image.bbclass`` for more image feature options or
269+
you can view `ostro-image.bbclass`_ from the upstream GitHub repository.
270+
271+
Use ``OSTRO_IMAGE_EXTRA_INSTALL`` to install additional individual packages,
244272
for example with::
245273

246274
OSTRO_IMAGE_EXTRA_INSTALL += "strace"
@@ -257,6 +285,68 @@ reconfigure it so that it matches ``ostro-image-swupd-dev``::
257285
OSTRO_IMAGE_NOSWUPD_EXTRA_INSTALL_append = "${OSTRO_IMAGE_INSTALL_DEV}"
258286

259287

288+
Adding a Custom Layer in Ostro OS
289+
---------------------------------
290+
291+
.. _`Creating Your Own Layer`: http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#creating-your-own-layer
292+
.. _`Open Embedded Layers Index`: http://layers.openembedded.org/layerindex/branch/master/layers/
293+
294+
The Yocto Project documentation explains the steps you'd follow for `Creating Your Own Layer`_.
295+
296+
#. Within your
297+
cloned copy of ``ostro-os``, here's how you can easily add a custom layer into your Ostro OS build:::
298+
299+
$ git clone <meta-custom-layer-name> # clone the git repo for your custom layer
300+
$ source oe-init-build-env # initialize the build environment
301+
302+
#. Use the ``bitbake-layers`` command to manipulate the ``bblayers.conf`` file for you:::
303+
304+
$ bitbake-layers add-layer meta-custom-layer-name
305+
$ bitbake-layers show-layers # verify bitbake sees the layer
306+
307+
or alternatively, you can manually edit your ``conf/bblayers.conf`` file and add a line to add the layer:::
308+
309+
BBLAYERS += "/PATH/TO/LAYERS/meta-custom-layer-name"
310+
311+
#. If this new layer depends on others that aren't already included in the build, you'll
312+
need to add additional ``BBLAYERS += "..."`` lines (either manually or by using
313+
the ``bitbake-layers add-layer`` command)
314+
315+
#. Add this to the end of your ``conf/local.conf`` file:::
316+
317+
OSTRO_IMAGE_EXTRA_INSTALL += "one or more recipes from custom-layer-name"
318+
319+
#. And with that, we're ready to do a build:::
320+
321+
$ bitbake -k ostro-image-noswupd # for example
322+
323+
If errors occur during the build, refer to the `Yocto Project Errors and Warnings`_ documentation to help
324+
resolve the issues, and repeat the ``bitbake -k ostro-image-noswupd`` command to continue.
325+
326+
Whitelisting a Recipe
327+
---------------------
328+
329+
The `Open Embedded Layers Index`_ is a database that's searchable by layer and recipe name. For example
330+
if you wanted to add `opencv` (open computer vision layer) you can find the recipe there and also a list
331+
of other layers it depends on.
332+
333+
Only specific recipes from the layers in meta-openembedded are
334+
supported in combination with Ostro OS, even though all of
335+
meta-openembedded gets imported into the ``ostro-os`` combined repository.
336+
Ostro OS maintains a list of approved (white-listed) and unapproved (black-listed) recipies.
337+
338+
To use recipes from meta-openembedded, they must be added to the
339+
respective ``PNWHITELIST`` variables, in ``meta-ostro/conf/ostro/ostro.conf`` for officially supported ones
340+
or in a ``local.conf`` for unofficial ones in a personal build.
341+
You can refer to ``meta-ostro/conf/ostro/ostro.conf`` for more information about white- and black-listing.
342+
343+
For example, you can add the ``tcpdump`` recipe to your default image (from the ``meta-networking`` layer)
344+
by adding these lines to your ``local.conf`` file:::
345+
346+
PNWHITELIST += "tcpdump"
347+
OSTRO_IMAGE_EXTRA_INSTALL += "tcpdump"
348+
349+
260350
Accelerating Build Time Using Shared-State Files Cache
261351
------------------------------------------------------
262352

@@ -285,4 +375,4 @@ Every image built gets copied into the deploy directory. As you're developing,
285375
these repeated builds will start accumulating and use up more and more
286376
disk space. You can save disk space by removing previous images after the
287377
new one is successfully built by adding (or uncommenting) this line in your
288-
:file:`local.conf`: ``RM_OLD_IMAGE = "1"``
378+
:file:`local.conf`: ``RM_OLD_IMAGE = "1"``

0 commit comments

Comments
 (0)