Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tables of Contents

Table of Contents

Yocto Build

Host Machine Setup

Hardware requirements:

  • Ubuntu 18.04 desktop machine
  • RAM - 8 GB or more
  • Memory - a minimum of 100 GB free space

Refer to the link for host machine setup: Host Setup

Yocto workspace setup

Code Block
languagebashthemeRDark
titlebuild setup
Initialization:
$ repo init -u https://code.rdkcentral.com/r/manifests -m rdkc-nosrc.xml -b dunfell
                                ( or )
$ repo init -u https://code.rdkcentral.com/r/manifests -m rdkvrdkc-nosrcextsrc.xml -b dunfell

Download/Sync:
$ repo sync -j `nproc` --no-clone-bundle --no-tagstag


Code Block
languagebash
titleapply bug fixes
collapsetrue
Apply bug fixes
$ cd meta-rdk-camera
$ git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-rdk-camera" refs/changes/10/49510/2 && git cherry-pick FETCH_HEAD

$ cd meta-cmf-raspberrypi
git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-cmf-raspberrypi" refs/changes/51/51451/1 && git cherry-pick FETCH_HEAD


Code Block
languagebash
titleeSDK fixes
$ cd meta-rdk-video
$ git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-rdk-video" refs/changes/34/51434/1 && git cherry-pick FETCH_HEAD

$ cd meta-rdk
# fix to use eSDK from all supported images
(cd meta-rdk; git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-rdk" refs/changes/37/51037/1 && git cherry-pick FETCH_HEAD
git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-rdk" refs/changes/35/51435/1 && git cherry-pick FETCH_HEAD)

$ cd meta-cmf-raspberrypi
git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-cmf-raspberrypi" refs/changes/36/51436/1 && git cherry-pick FETCH_HEAD

Note: The above bug and eSDK fixes changes are temporary given as instructions. This is not required once the change is get merged into the appropriate layer.

Populate eSDK

...

idframe

...

eSDK

...

$ MACHINE=
raspberrypi
raspberrypi3-rdk-
mc
camera source meta-cmf-raspberrypi/setup-environment
$ bitbake rdk-generic-
mediaclient-wpe
camera-image -c populate_sdk_ext
Command to populate eSDK from hybrid image
Code Block
languagebash
themeRDark
titleimage build
Card
labelHybrid Gateway
title


While building, If you get any compile time error. we should follow "Repo Bug Fixes" and start the build.

The generated eSDK installer resides under the directory build-<MACHINE>/tmp/deploy/sdk/rdk-glibc-x86_64-arm-toolchain-ext-2.0.sh of the Yocto workspace.

Note: The generated eSDK installer script usually occupies 2 to 2.5 GB
Code Block
languagebash
titleApply repo bug fixes
$ cd build-raspberrypi3-rdk-camera/tmp/work/cortexa7t2hf-neon-vfpv4-rdk-linux-gnueabi/thumbnail/git-r0/git
$ git fetch "https://code.rdkcentral.com/r/rdkc/components/opensource/thumbnail" refs/changes/31/49531/1 && git cherry-pick FETCH_HEAD
themeRDark
titleimage build
MACHINE=raspberrypi-rdk-hybrid source meta-cmf-raspberrypi/setup-environment
bitbake rdk-generic-hybrid-wpe-image -c populate_sdk_ext

eSDK Installation

The installer can be done on any x86_64 Linux machines.

...

Installation

Code Block
languagebashthemeRDark
# run the installer script file
# installer asks for a directory to install (default directory ~/rdk_sdk)
# installer asks permission to proceed
./rdk-glibc-x86_64-arm-toolchain-ext-2.0.sh

Below is the result (terminal output) of the installation

xxxuser@yyy

xxxxxxx@dvm-ch2g-

machine

yocto31-

003

007:~/

rpi

yyyyyy/

hyb

31Jan21/

1712$

build-raspberrypi3-

rpi

rdk-

hyb

camera/tmp/deploy/

sdk

sdk$  ./rdk-glibc-x86_64-arm-toolchain-ext-2.0.sh
RDK (A Yocto Project based Distro) Extensible SDK installer version 2.0
=======================================================================
Enter target directory for SDK (default: ~/rdk_sdk):
You are about to install the SDK to "/home/xxxuser/rdk_sdk". Proceed [Y/n]? Y
Extracting SDK................................................................................................................done
Setting it up...
Extracting buildtools...
Preparing build system...

Parsing recipes: 100% |##################################################################| Time: 0:00:52

Initialising tasks: 100% |###############################################################| Time: 0:00:00

Checking sstate mirror object availability: 100% |#######################################| Time: 0:00:00

Loading cache: 100% |####################################################################| Time: 0:00:00

Initialising tasks: 100% |###############################################################| Time: 0:00:00

done

SDK has been successfully set up and is ready to be used. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

    $ . /home/xxxuser/rdk_sdk/environment-setup-cortexa7t2hf-neon-vfpv4-rdk-linux-gnueabi

SDK Installation Done.

Build from eSDK

This section covers how to use the eSDK for component build and image build

...

The installer can be run on any x86_64 Linux based machines.

Code Block
languagebash
themeRDark
# change directory to the installed path
cd ~/rdk_sdk
# setup the eSDK environemnt
source environment-setup-cortexa7t2hf-neon-vfpv4-rdk-linux-gnueabi

...

Add Component

Code Block
languagebashthemeRDark
# way 1
# add a new recipe with URL
devtool add <recipe_name> <source URL>

Example:
# eg. devtool add westerossctplib httpsgit://github.com/rdkcmfrdkcteam/westerosusrsctplib

# way 2
# add a new recipe with external source directory
devtool add <recipe_name> <absolute path>
# eg.
Example:
# devtool add westerossctplib /path/for/source/directory

...

Code Block
languagebash
themeRDark
# modify existing recipe's URL or srctree or to add patches
devtool modify <recipe_name> <new URL>
# eg. devtool modify westeros https://code.rdkcentral.com/r/rdk/components/generic/westeros

Edit Component's recipe

Code Block
languagebashthemeRDark
# modify recipe from an editor
devtool edit-recipe <recipe_name>

Example:
# eg. devtool edit-recipe westeros

Upgrade Component

Code Block
languagebash
themeRDark
# modify existing recipe's URL or srctree or to add patches
devtool upgrade --version <version number> <recipe_name>
# eg. devtool upgrade --version 1.0.21 westeros
sctplib

Build Components

Code Block
languagebash
themeRDark
# Pre-requisite: add a new recipe using devtool
devtool build <recipe_name>

Example:
# eg. devtool build westerossctplib

Deploy binaries

Code Block
languagebash
themeRDark
# Pre-requisite: add a new recipe using devtool
devtool deploy-target <recipe_name> <target_path>

Example:
# eg. devtool deploy-target westerossctplib root@192.168.xx.xx

Build Image

...

Code Block
languagebash
themeRDark
# devtool command to build image from eSDK
# <IMAGE> - rdk-generic-mediaclient-wpecamera-image
devtool or rdk-generic-hybrid-wpe-image
build-image <IMAGE>

Example:
# devtool build-image <IMAGE>rdk-generic-camera-image