Rbdk: Base Build and Flash Steps

In this section, you are going to learn

How to build a base image for rdkb ?

How to generate full base rdkb image for RPI-4B ?

How to flash full base rdkb image for RPI-4B ?

How to run minicom and work remotely with RPI-4B ?

How to do pre-build and post-build checks ?

  • Install the required packages to avoid package related dependencies or errors.

$ 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 python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
  pylint3 xterm bmap-tools

$ sudo apt-get install git cmake autoconf texinfo openjdk-8-jdk openjdk-8-jre \
  m4 libtool libtool-bin curl pkg-config lib32z1 doxygen
  • In this section we will see how to setup the repository.

  • Create a bin directory and add it to the PATH environment variable

$ mkdir ~/bin
$ PATH=~/bin:$PATH
  • Download repo tool using the following command

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
  • Create an account in rdkcentral.com and add to your ssh key in order to clone the repository.

$ vi ~/.netrc
machine code.rdkcentral.com
login <YOUR_USERNAME>
password <YOUR_PASSWORD>
  • create a repo file with the following instructions

  • Replace the repo file in bin folder with the above repo file.

    $ cp -arvf repo ~/bin/repo
    
  • In this section, we will see how to clone and sync the repository

  • Create the rdkb workspace directory

    $ cd $HOME
    $ mkdir rdbk_build
    $ cd rdkb_build
    
  • Clone the rdkb repository inside the rdkb build directory

$ repo init -u https://code.rdkcentral.com/r/manifests -b dunfell -m rdkb-extsrc.xml
  • Sync the repository to download new or update the lastest changes

$ repo sync -j nproc --no-clone-bundle
  • Run this configuration command to indicate the build machine and service

$ MACHINE=raspberrypi4-64-rdk-broadband source meta-cmf-raspberrypi/setup-environment
  • In this section we will see how to do pre-build check

  • Check whether the configuration command is given correctly for the RPI4 specification

$ MACHINE=raspberrypi4-64-rdk-broadband source meta-cmf-raspberrypi/setup-environment
$ pwd
$HOME/rdkb_build/build
$ cd tmp/hosttools
  • Once all the configurations is added run bitbake from build directory to build the base rdkb image.

$ cd $HOME/rdkb_build/build/
$ bitbake rdk-generic-broadband-image

In this section you will learn how to do Post-build checks

  • In this section we will see how to do static image verification checks

$ pwd
$HOME/rdkb

$ cd build/tmp/deploy/images/raspberrypi4/

See that binary called helloworld is present inside directory ?

  • In this section, we will how to do runtime image verification checks

  • Extract the final image “.wic” using the bzip2 command.

$ pwd
$HOME/rdkb/build/tmp/deploy/images/raspberrypi4/

$ bzip2 -d rdk-generic-broadband-image-raspberrypi4-64-rdk-broadband.wic.bz2
  • Flash the image to SD-card using the following command.

$ sudo -E bmaptool copy --nobmap rdk-generic-broadband-image-raspberrypi4-64-rdk-broadband.wic /dev/sdb
  • Run minicom to boot the image.

$ sudo minicom -D /dev/ttyUSBO
  • Confirm you are on linux prompt if the console display looks like below

root'@'raspberrypi4-64-rdk-broadband:~
  • To find the “BUILD ID” we can cat image.manifest and grep for “BUILD ID”

root'@'raspberrypi4-64-rdk-broadband:~  cat image.manifest | grep BUILD_ID
BUILD_ID=2022.01.11.07.00.00
  • Check the os-release version using the following command.

root'@'raspberrypi4-64-rdk-broadband:~  cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="Yocto Project 3.5.1 (Dunfell)"
  • Check the version release using the following command

root'@'raspberrypi4-64-rdk-broadband:~  cat /etc/rdkb-release
Yocto Project Release 3.5.1 (Dunfell)
  • Check the rdkb version using the following command

root'@'raspberrypi4-64-rdk-broadband:~ rdk-version --version
RDK Version 2.1.0
  • Check if rdkb package is installed or not using dpkg command

root'@'raspberrypi4-64-rdk-broadband:~ dpkg -l | grep rdk
ii  rdk-core          2.1.0-1       armhf        Reference Design Kit Core Components
ii  rdk-utils         1.2.5-3       armhf        Utility tools for RDK