Yocto Build Host Software

The build host tools need to be setup before the server can be built.

Warning

  • The Pyro branch (Yocto 2.3) is now EOL and no longer supported.

  • The Kirkstone branch (Yocto 4.0) is currently supported.

  • The meta-yumapro recipes will no longer work with older Yocto versions such as Pyro.

  • Refer to Migration Guide for details on the Yocto syntax changes.

  • The meta-yumapro layer is designed to work with the Yocto 4.0 release (Kirkstone).

  • Older meta-yumapro releases (prior to 21.10-13) are not compatible with this Yocto branch. The 'Pyro' branch must continue to be used for those older releases.

The following diagram shows the directories that the user is expected to setup (in blue) and the directories that the supplied software will add.

../_images/yocto_file_tree.png

poky

Yocto installation of poky build system

build

Root of all build directories

conf

Build configuration directory. Edit local.conf and bblayers.conf

tmp

Root of all bitbake generated build files

meta-*

Several opensource layer directories

meta-yumapro

Root of the yumapro layer bitbake files

recipes-server

Root directory for all yumapro server recipes

netconfd-pro

Root directory of all netconfd-pro recipes (IoT and SDN)

The netconfd-pro-iot and netconfd-pro-sdn recipes are designed to integrate with certain open source recipes, in order to automatically produce a system image with a running system, upon first boot.

The following recipes are used by the yumapro server recipes:

  • base-files: Used to add yp-shell to /etc/shells

  • dropbear: Used to integrate netconfd-pro-iot support into dropbear and configure boot-time parameters

  • openssh: Used to configure netconfd-pro-sdn boot-time parameters into OpenSSH

  • lighttpd: Used to configure RESTCONF server boot-time parameters for lighttpd WEB server

  • net-snmp: Used to integrate SNMP protocol support and configure boot-time SNMP parameters

Setup Yocto Linux

These instructions do not override the Yocto documentation.

This document is not a yocto tutorial. Refer to the Yocto documentation for details on using the Yocto and bitbake software.

Yocto Project Quick Start Guide

Yocto Project Mega Manual

Yocto Project Developer Manual

Building your own recipe:

Bitbake User Manual

Install Yocto

Follow the instructions in the Yocto Quick Start guide.

Example Ubuntu Install.

Note

Use the Yocto instructions online from the Yocto Project: The example below may be out of date.

  1. Install dependencies

    > sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
      build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
      xz-utils debianutils iputils-ping libsdl1.2-dev xterm
    
  2. Install poky and select branch

    > git clone git://git.yoctoproject.org/poky
    > cd poky
    
    # Checkout branch that matches the meta-yumapro tarball.
    > git checkout kirkstone
    
  3. Add meta-webserver layer

    # make sure this is done from poky directory
    > git clone git://git.openembedded.org/meta-openembedded
    > cd meta-openembedded
    > git checkout kirkstone
    > cd ..
    
  4. Add meta-yumaro layer

Setup Build Configuration

Starting in the 'poky' directory, source the environment file to enable bitbake.

Then cd to the “conf” directory and edit the configuration files.

> source oe-init-build-env

build> cd conf

build/conf>

Edit local.conf:

  1. Enable a target platform. The default is the i586 architecture on the qemu86 virtual target. Refer to the Yocto Quick start guide to enable different targets and board support packages (BSPs).

  2. Add the netconfd-pro server recipe to the image. Choose eithernetconfd-pro-iotornetconfd-pro-sdn, but not both. Example for netconfd-pro-sdn:

IMAGE_INSTALL_append = " netconfd-pro-sdn"

Starting with the Hardknott release(3.3) of OpenEmbedded, bitbake is using a new variable override syntax. For Hardknott and later releases, the netconfd-pro server recipe should be added like this:

IMAGE_INSTALL:append = " netconfd-pro-sdn"

Edit bblayers.conf:

  1. Enable layers needed to build the desired Yocto Linux system variants. The following example shows the layers needed for all variants of the netconfd-pro server. The file locations will be different depending on your Yocto installation location.

    In this example replace /home/andy/swdev with the real path to the 'poky' directory on your system.

BBLAYERS ?= " \
  /home/andy/swdev/poky/meta \
  /home/andy/swdev/poky/meta-poky \
  /home/andy/swdev/poky/meta-yocto-bsp \
  /home/andy/swdev/poky/meta-openembedded/meta-oe \
  /home/andy/swdev/poky/meta-openembedded/meta-python \
  /home/andy/swdev/poky/meta-openembedded/meta-networking \
  /home/andy/swdev/poky/meta-openembedded/meta-webserver \
  /home/andy/swdev/poky/meta-yumapro \
"

meta-yumapro Layer

The meta-yumapro tarball contains “yumapro” layer files required to build, install, and integrate a multi-protocol server for Yocto Linux.

Installation

If you have access to the 'yumapro' and 'yumapro-server' source tarballs then use the 'meta-yumapro' tarball that includes the source code.

If you have access to the 'yumapro-server2' or 'yumapro-server3' source tarballs then use the 'meta-yumapro-raw' tarball that does not include the source code. An extra step to add source code and edit the recipe is needed in this case.

Tarball Naming Conventions

The filename structure of the tarball file is as follows:

meta-yumapro-<version>.gz

Example Filename:

meta-yumapro-21.10-3.tar.gz

Extract to the poky Directory

The files need to be extracted to the poky directory so subtrees can be integrated into the build environment for the server.

Extraction Example:

> cd poky
> tar xvf meta-yumapro-21.10-3.tar.gz

Creates a directory named meta-yumapro in the current directory.

Extra Installation Steps for meta-yumapro-raw

The 'yumapro-server2' and 'yumapro-server3' source packages do not contain the the 'yp-shell' source code. The WITH_CLI=1 make flag has to be removed from the recipe files.

First add the source tarball to the corrrect file location.

Example:

> cp yumapro-server2-21.10-3.tar.gz poky/meta-yumapro/recipes-server/netconfd-pro/files/

Second, edit the 'netconfd-pro.inc' file in the 'poky/meta-yumapro/recipes-server/netconfd-pro' directory.

netconfd-pro.inc file section before editing:

# add for CLI protocol (yp-shell over SSH)
###  CLI NOT AVAILABLE IN SERVER2; MUST COMMENT OUT IF SERVER2
EXTRA_OEMAKE += "WITH_CLI=1"
DEPENDS += "ncurses libssh2"
FILES:${PN} += "${bindir}/yp-shell"
RPROVIDES:${PN} += "yp-shell"
CONFFILES:${PN} += "${sysconfdir}/yumapro/yangcli-pro.conf"

netconfd-pro.inc file section after editing:

# add for CLI protocol (yp-shell over SSH)
###  CLI NOT AVAILABLE IN SERVER2; MUST COMMENT OUT IF SERVER2
#EXTRA_OEMAKE += "WITH_CLI=1"
#DEPENDS += "ncurses libssh2"
#FILES:${PN} += "${bindir}/yp-shell"
#RPROVIDES:${PN} += "yp-shell"
#CONFFILES:${PN} += "${sysconfdir}/yumapro/yangcli-pro.conf"

Configuration

The only recipes supported at this time are “netconfd-pro-iot” and “netconfd-pro-sdn”. The configuration files for these recipes are located in the directory poky/meta-yumapro/recipes-server/netconfd-pro. There are several features that can be enabled or disabled by uncommenting or commenting a set of directives.

The set of recipe files:

  • netconfd-pro.inc: common recipe file

  • netconfd-pro-iot.inc: IoT configuration recipe file

  • netconfd-pro-sdn.inc: SDN configuration recipe file

  • netconfd-pro-iot_21.10.bb: IoT configuration main recipe file for 21.10 release train. (Actual number will depend on the release train.)

  • netconfd-pro-sdn_21.10.bb: SDN configuration main recipe file for 21.10 release train. (Actual number will depend on the release train.)