Create custom template files

Step 1 - Copy existing files

Standard poky local.conf and bblayers.conf are good starter points to creating custom template (sample) files. Also if you want custom information about images when sourcing environment you can copy conf-notes.txt.

cp ../meta-poky/conf/local.conf.sample ../meta-golemos/conf/
cp ../meta-poky/conf/bblayers.conf.sample ../meta-golemos/conf/
cp ../meta-poky/conf/conf-notes.txt ../meta-golemos/conf/

Note

All commands diplayed are executed from the build directory.

Step 2 - Customize sample files

After copying files you have to customize values to fit your needs. In local.conf.sample change MACHINE and DISTRO values so you will not have to change it every time.

MACHINE ??= "raspberrypi0-wifi"
DISTRO ?= "golemos"

For now this layer is compatible with Raspberry PI 0. If you plan to use with different machine feel free to change it here. You can also overwrite this value when building images with this command.

MACHINE=<machine> bitbake <target>

Step 3 - Add dependency layers

This custom layer has some dependencies. You can also add them to bblayers.conf.sample and not worry about them later. Whole file should contain this output.

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  ##OEROOT##/meta \
  ##OEROOT##/meta-poky \
  ##OEROOT##/meta-yocto-bsp \
  ##OEROOT##/meta-golemos \
  ##OEROOT##/meta-raspberrypi \
  ##OEROOT##/meta-openembedded/meta-oe \
  ##OEROOT##/meta-openembedded/meta-python \
  ##OEROOT##/meta-openembedded/meta-webserver \
  "

Note

If you add this layers to sample file, you have to clone appropriate repositories to satisfy dependencies.

Step 4 - Create custom notes

When sourcing build environment you see notes from poky distribution. They often show which images are available for build. You can create your own notes and always remember what images are available as a bitbake target.

Inside conf-notes.txt place this output to make this happen.

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-full-cmdline
    core-image-sato
    core-image-weston
    meta-toolchain
    meta-ide-support

Targets available from golemos layer:
    datalogger-image
    datalogger-extended-image
    datalogger-dev-image

Other commonly useful commands are:
 - 'devtool' and 'recipetool' handle common recipe tasks
 - 'bitbake-layers' handles common layer tasks
 - 'oe-pkgdata-util' handles common target package tasks

Note

In this file there were adedd custom images which will be created in next step. Do now worry if they do not work already.

Step 5 - Source build environment

From now when sourcing environment you can use your sample files instead of using standard poky files. This can be done by typing this command when you source build environment.

TEMPLATECONF=meta-golemos/conf/ source oe-init-build-env

Summary

At the end your layer structure should look like this.

../meta-golemos
├── conf
│   ├── bblayer.conf.sample
│   ├── conf-notes.txt
│   ├── distro
│   │   └── golemos.conf
│   ├── layer.conf
│   └── local.conf.sample
├── COPYING.MIT
├── README
└── recipes-example
    └── example
        └── example_0.1.bb