A tutorial to set up your environment and Download Source Code

Hardware Configurations

Below are the box configuration for Raspberry Pi 4 Model B 8GB RAM:

Build Setup Instructions

Setting up the Host Environment

Configure Git

Upgrade your Git version to 1.8.x or higher

On Ubuntu 16.04 LTS, if you are unable to upgrade your git version using apt-get, then follow the below steps in order to upgrade 

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

Once git is installed, configure your name and email using the below commands

# review your existing configuration
git config --list --show-origin

# configure user name and email address
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

# configure git cookies. Needed for Gerrit to only contact the LDAP backend once.
git config --global http.cookieFile /tmp/gitcookie.txt
git config --global http.saveCookies true


Configure repo

In order to use Yocto build system, first you need to make sure that repo is properly installed on the machine:

# create a bin directory
mkdir ~/bin
export PATH=~/bin:$PATH

# Download the repo tool and ensure that it is executable
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo


Trivia Repo is a repository management tool that is built on top of Git. Its main purpose is to help manage projects that consist of many Git repositories, it can also be used to manage uploads to the CMF Gerrit instance and automate aspects of the development workflow.

Repo does not replace Git, it simply aids management of projects that contain multiple Git repositories into a single local working directory. Git will still be used for local operation such as commits etc.

Repo manages this for you by means of an XML based Manifest file. The Manifest file defines which repositories the project uses and links to appropriate revisions of each git repository, i.e where the upstream repositories reside and where they should be cloned locally. It is the manifest.xml (or default.xml) that determines which Git repositories and revisions repo will manage. This manifest.xml file is hosted in a Git repository along with all the other git repositories.

Credential configuration

Note: It is also recommended to put credentials in .netrc when interacting with the repo. (Here in login we need to give public user id which created to login code.rdkcentral.com)

For Signup - https://wiki.rdkcentral.com/signup.action

A sample .netrc file is illustrated below

machine code.rdkcentral.com login <YOUR_USERNAME> password <YOUR_PASSWORD>

machine github.com login <YOUR_USERNAME> password <YOUR_PASSWORD>


Downloading Source Code & Building

Downloading Source Code

Following commands fetch the source code using repo tool

$ mkdir <Directory-Name> && cd <Directory-Name>

Please use the following repo init command

repo init -u https://code.rdkcentral.com/r/rdkcmf/manifests -b kirkstone -m rdkv-nosrc.xml

repo sync -j `nproc` --no-clone-bundle --no-tags

Building

MACHINE=raspberrypi4-64-rdk-android-ipstb-oss source meta-cmf-raspberrypi/setup-environment

bitbake lib32-rdk-ipstb-oss-image

The above step configures and sets up your directory to start an appropriate build.  And bitbake  <image-name> is used to initiate the build 

On Successful build, the ROOTFS (in vmdk format) would be available at the following reference location based on the build type :

build-raspberrypi4-64-rdk-android-ipstb-oss/tmp/deploy/images/raspberrypi4-64-rdk-android-ipstb-oss/imagename.wic.bz2

Flashing the RPI Image

bzcat <IMAGE_NAME>.wic.bz2 | sudo dd of=/dev/sdb bs=4M iflag=fullblock oflag=direct conv=fsync
bzip2 -d <path to ImageName.wic.bz2>
sudo -E bmaptool copy --nobmap <path to ImageName.wic> <path to SD card space>
  
Example:
$ bzip2 -d rdk-ipstb-oss-image_rdk-next_20241208053801.rootfs.wic.bz2
$ sudo -E bmaptool copy --nobmap rdk-ipstb-oss-image_rdk-next_20241208053801.rootfs.wic.bz2 /dev/sda