Introduction


This manual describes the rdk-generic-broadband-image build procedure for Yocto 4.0 builds. This will upgrade the build system used in RDKB, from dunfell(3.1) to kirkstone(4.0). In addition to upgrades to opensource packages, Yocto 4.0 also contain Long term Support release feature. The current version lacks the variety of features available in the kirkstone. The upgraded build tools will be used to generate rdk-generic-broadband-image for Raspberrypi reference platform. 

Yocto 4.0  Upgradation support the following:

  • Yocto BSP layer for meta-raspberrypi.
  • OpenEmbedded and Yocto kirkstone.
  • Linux kernel 5.10.32.
  • Version upgrades for bitbake, and other oe/python recipes.

Each component in RDK is a standalone repository with its own individual build tools producing a library or set of binaries. When we upgrade the OE layers to the newer versions, we need to make necessary changes in the RDK layers which use these components, to avoid build failures.

Host Setup

The OpenEmbedded build system should be able to run on Ubuntu 20.0 distribution/other compatible linux distribution with the following versions for Git, tar, and Python.

  • Git 2.25.1 or greater
  • tar 1.30 or greater
  • Python 3.10.4 or greater
  • Coreutils(E.g realpath)

Note: You should also have about 50 Gbytes of free disk space for building images.

The essential packages you need for a supported Ubuntu or Debian distribution are shown in the following command:

$ 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


Repo Setup

In order to use Yocto build system, the repo tool must be properly installed on the machine.

To install Repo make sure you have a /bin directory in your home directory and that it is included in your path

Repo Setup Steps
$ mkdir ~/bin
$ 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

Note: it is also recommended to put credentials in ~/.netrc when interacting with repo.

A sample ~/.netrc file is illustrated below

.netrc
machine code.rdkcentral.com login YOUR_USERNAME password YOUR_PASSWORD

Yocto Build Steps

To build, follow below instructions

Build Steps
$ mkdir <workspace dir>
$ cd <workspace dir>
$ repo init -u https://code.rdkcentral.com/r/manifests -b kirkstone -m rdkb-extsrc.xml
$ repo sync -j`nproc` --no-clone-bundle
$ MACHINE=raspberrypi4-64-rdk-broadband source meta-cmf-raspberrypi/setup-environment

Please use the below MACHINE command for enabling the debug tools as part of the build,
$ MACHINE=raspberrypi4-64-rdk-broadband DISTRO_NAME=enable_debug_tool source meta-cmf-raspberrypi/setup-environment

$ bitbake rdk-generic-broadband-image 

Flashing Procedure

Following command can be used to flash the RPI image to sd card using linux machine . bmap tool should be available in linux

Flash command
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-generic-broadband-image-raspberrypi4-64-rdk-broadband.wic.bz2
$ sudo -E bmaptool copy --nobmap rdk-generic-broadband-image-raspberrypi4-64-rdk-broadband.wic /dev/sdb

Validated Functionalities

No

Feature

Supported

1LAN Connected Devices-Ethernet(tick)
2WAN Connected Devices-Wi-Fi(tick)
3Parental Control(error)
4Firewall settings(tick) 
5Advanced Config: Port Triggering(error)
6Advanced Config: Port Forwarding(tick) 
7Advanced Config: Remote Management(tick)
8Advanced Config: DMZ(tick)
9Xfinity Wi-Fi 2.4/5 GHz – Public Hotspot(error)
10Test and Diagnostics(tick)
11Local WebUI Configuration(tick)
12Factory Reset(tick)
13DHCP /Reserved IP(tick)
15Eth Agent(tick)
162.4 GHz Band Support(tick)
175 GHz Band Support(tick)
18Bridge Mode Support(error)
19Persistent Storage Management(tick)
20WebPA for Comcast,community(tick)
21Lost and Found(error)
22Bluetooth(error)
22Harvester Support(error)
23TR-69(error)
24SNMP  (tick) 
27Boot time data measurement(error)
28Wireless Protection Setup(WPS - 2G support)  (tick) 
29Captive Portal  (tick) 
30Wi-Fi MAC Filtering (error)
31Log Rotation Support (tick)
32Firmware Upgrade Support (tick)
34Telemetry Support (tick)
35IPV6 (error)
 36

Log level control through CcspLogAgent

                   (tick)                 
 37

Band Steering using RSSI

                   (error)
38

Backup and Restore

                   (error)
39

SelfHeal

                   (tick) 
 40Password-Reset                   (tick) 
 41WebUI JST                    (tick) 
 43RdkWanManager                   (tick) 
 44RdkFwUpgradeManager                   (tick) 


References :

We captured all the kirkstone build errors and its fixes in this link RDK-B RPI4 64 bit.

Code Commits

https://code.rdkcentral.com/r/q/topic:RPI_kirkstone_migration


Kirkstone (Yocto 4.0) - Epic Story:

RDK-B RPI4 64 bit:

REFPLTB-1805 - Getting issue details... STATUS  


Jira Tickets :

Key Summary T Created Updated Due Assignee Reporter P Status Resolution
Loading...
Refresh


Technical support:

support@rdkcentral.com

  • No labels

10 Comments

  1. What is the recommended system and minimum hardware requirements to build yocto image?

  2. Hi Unknown User (michal.aleksinski.cog) ,

    To build RDK code in Yocto, we need VM of ubuntu 18 or above, with RAM 16 to 32 GB and recommended storage 256 GB, depending on code size.

    Thank you.

  3. Ended up with following issue, 
    rajesh@ec180c7bc54a:~/rdk-next/build-raspberrypi4-64-rdk-broadband$ bitbake rdk-generic-broadband-image
    ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
      lz4c


    Fix : sudo apt update && sudo apt install -y zstd liblz4-tool

    1. Hi Unknown User (rajesh.b) 

      Does "sudo apt update && sudo apt install -y zstd liblz4-tool" fixed the issue ? 
      Could you please try installing lz4c and try the build.

      Regards,
      Deepika

      1. Hi Deepika, 

        Yes, I was able to build after installing zstd liblz4-tool. 

        When I tried to install lz4c , I got error saying package not found.

  4. Today I could not compile 64-bit rpi4 using kirkstone branch. I was able to a few days ago.

    ERROR: Nothing PROVIDES 'raspberrypi4-64-rdk-broadband'. Close matches:

      meta-environment-extsdk-raspberrypi4-64-rdk-broadband

      meta-environment-raspberrypi4-64-rdk-broadband


    1. Hi bo yu 

      We are not observing the above errors in Kirkstone 64 bit builds. Is it a fresh clone ?
      Could you please try with below commands

      repo init -u https://code.rdkcentral.com/r/rdkcmf/manifests -m rdkb-extsrc.xml -b kirkstone
      repo sync -j`nproc` --no-clone-bundle

      MACHINE=raspberrypi4-64-rdk-broadband source meta-cmf-raspberrypi/setup-environment
      bitbake rdk-generic-broadband-image

  5. facing the error : 

    ERROR: ExpansionError during parsing /home/subhradeep/Subhradeep/rpi/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-xtmagent.bb         | ETA:  0:00:24
    Traceback (most recent call last):
      File "/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 1214, in srcrev_internal_helper(ud=<bb.fetch2.FetchData object at 0x7d46c4dacf70>, d=<bb.data_smart.DataSmart object at 0x7d46c4dae800>, name='XTMAgent'):
             if srcrev == "AUTOINC":
        >        srcrev = ud.method.latest_revision(ud, d, name)
         
      File "/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 1626, in Git.latest_revision(ud=<bb.fetch2.FetchData object at 0x7d46c4dacf70>, d=<bb.data_smart.DataSmart object at 0x7d46c4dae800>, name='XTMAgent'):
                 except KeyError:
        >            revs[key] = rev = self._latest_revision(ud, d, name)
                     return rev
      File "/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/lib/bb/fetch2/git.py", line 748, in Git._latest_revision(ud=<bb.fetch2.FetchData object at 0x7d46c4dacf70>, d=<bb.data_smart.DataSmart object at 0x7d46c4dae800>, name='XTMAgent'):
         
        >        output = self._lsremote(ud, d, "")
                 # Tags of the form ^{} may not work, need to fallback to other form
      File "/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/lib/bb/fetch2/git.py", line 731, in Git._lsremote(ud=<bb.fetch2.FetchData object at 0x7d46c4dacf70>, d=<bb.data_smart.DataSmart object at 0x7d46c4dae800>, search=''):
                         bb.fetch2.check_network_access(d, cmd, repourl)
        >            output = runfetchcmd(cmd, d, True)
                     if not output:
      File "/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/lib/bb/fetch2/__init__.py", line 929, in runfetchcmd(cmd='export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/subhradeep/Subhradeep/rpi/openembedded-core/scripts:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/bin/aarch64-rdk-linux:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot/usr/bin/crossscripts:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/sbin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/bin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/sbin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/bin:/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/bin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/hosttools"; export HOME="/home/subhradeep"; git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat ls-remote https://gerrit.teamccp.com/rdk/rdkb/components/opensource/ccsp/XTMAgent/generic ', d=<bb.data_smart.DataSmart object at 0x7d46c4dac340>, quiet=True, cleanup=[], log=None, workdir=None):
         
        >        raise FetchError(error_message)
         
    bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/subhradeep/Subhradeep/rpi/openembedded-core/scripts:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/bin/aarch64-rdk-linux:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot/usr/bin/crossscripts:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/sbin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/usr/bin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/sbin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/work/cortexa72-rdk-linux/ccsp-xtmagent/fetcheravoidrecurse-fetcheravoidrecurse/recipe-sysroot-native/bin:/home/subhradeep/Subhradeep/rpi/openembedded-core/bitbake/bin:/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/tmp/hosttools"; export HOME="/home/subhradeep"; git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat ls-remote https://gerrit.teamccp.com/rdk/rdkb/components/opensource/ccsp/XTMAgent/generic  failed with exit code 128, output:
    fatal: could not read Username for 'https://gerrit.teamccp.com': No such device or address

    The variable dependency chain for the failure is: SRCPV -> PV -> BP -> FILESPATH

    ERROR: Parsing halted due to errors, see error messages above
    WARNING: /usr/lib/python3.10/multiprocessing/process.py:330: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/cache/bb_codeparser.dat.lock' mode='a+' encoding='UTF-8'>
      traceback.print_exc()

    WARNING: /usr/lib/python3.10/multiprocessing/process.py:330: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/subhradeep/Subhradeep/rpi/build-raspberrypi4-64-rdk-broadband/cache/bb_codeparser.dat.lock.21838' mode='a+' encoding='UTF-8'>
      traceback.print_exc()


    Summary: There were 26 WARNING messages.
    Summary: There were 2 ERROR messages, returning a non-zero exit code.

    =============================================================================================================
    Steps followed : 

    repo init -u https://code.rdkcentral.com/r/rdkcmf/manifests -m rdkb-extsrc.xml -b kirkstone
    repo sync -j`nproc` --no-clone-bundle

    MACHINE=raspberrypi4-64-rdk-broadband source meta-cmf-raspberrypi/setup-environment
    changed line 247 in conf/local.conf : used rpi-rdk.inc instead of existing #RDK_FLAVOR.inc
    bitbake rdk-generic-broadband-image

  6. #require conf/distro/include/##RDK_FLAVOR##.inc

    require conf/distro/include/rdk-rpi.inc


  7. on commenting the following lines then able to proceed with build. 

    diff --git a/recipes-ccsp/ccsp/ccsp-dslagent.bb b/recipes-ccsp/ccsp/ccsp-dslagent.bb
    index bfcd5cd..0238d16 100644
    --- a/recipes-ccsp/ccsp/ccsp-dslagent.bb
    +++ b/recipes-ccsp/ccsp/ccsp-dslagent.bb
    @@ -10,10 +10,11 @@ require ccsp_common.inc
     
     SRC_URI ="${RDKB_CCSP_ROOT_GIT}/DSLAgent/generic;protocol=${RDK_GIT_PROTOCOL};branch=${CCSP_GIT_BRANCH};name=DSLAgent"
     
    -SRCREV_DSLAgent = "${AUTOREV}"
    -SRCREV_FORMAT = "DSLAgent"
    +#SRCREV_DSLAgent = "${AUTOREV}"
    +#SRCREV_FORMAT = "DSLAgent"
     
    -PV = "${RDK_RELEASE}+git${SRCPV}"
    +PV = "${RDK_RELEASE}"
    +#PV = "${RDK_RELEASE}+git${SRCPV}"
     
     S = "${WORKDIR}/git"
     B = "${WORKDIR}/build"
    diff --git a/recipes-ccsp/ccsp/ccsp-vlanagent.bb b/recipes-ccsp/ccsp/ccsp-vlanagent.bb
    index 6df1fda..07710ea 100644
    --- a/recipes-ccsp/ccsp/ccsp-vlanagent.bb
    +++ b/recipes-ccsp/ccsp/ccsp-vlanagent.bb
    @@ -11,11 +11,11 @@ require ccsp_common.inc
     SRC_URI ="${RDKB_CCSP_ROOT_GIT}/VLANAgent/generic;protocol=${RDK_GIT_PROTOCOL};branch=${CCSP_GIT_BRANCH};name=VLANAgent"
     #SRC_URI += "file://vlanagent.tar.gz"
     
    -SRCREV_VLANAgent = "${AUTOREV}"
    -SRCREV_FORMAT = "VLANAgent"
    +#SRCREV_VLANAgent = "${AUTOREV}"
    +#SRCREV_FORMAT = "VLANAgent"
     
    -#PV = "${RDK_RELEASE}"
    -PV = "${RDK_RELEASE}+git${SRCPV}"
    +PV = "${RDK_RELEASE}"
    +#PV = "${RDK_RELEASE}+git${SRCPV}"
     
     S = "${WORKDIR}/git"
     B = "${WORKDIR}/build"
    diff --git a/recipes-ccsp/ccsp/ccsp-xtmagent.bb b/recipes-ccsp/ccsp/ccsp-xtmagent.bb
    index 6d13c16..b8ff356 100644
    --- a/recipes-ccsp/ccsp/ccsp-xtmagent.bb
    +++ b/recipes-ccsp/ccsp/ccsp-xtmagent.bb
    @@ -11,11 +11,11 @@ require ccsp_common.inc
     SRC_URI ="${RDKB_CCSP_ROOT_GIT}/XTMAgent/generic;protocol=${RDK_GIT_PROTOCOL};branch=${CCSP_GIT_BRANCH};name=XTMAgent"
     #SRC_URI += "file://xtmagent.tar.gz"
     
    -SRCREV_XTMAgent = "${AUTOREV}"
    -SRCREV_FORMAT = "XTMAgent"
    +#SRCREV_XTMAgent = "${AUTOREV}"
    +#SRCREV_FORMAT = "XTMAgent"
     
    -#PV = "${RDK_RELEASE}"
    -PV = "${RDK_RELEASE}+git${SRCPV}"
    +PV = "${RDK_RELEASE}"
    +#PV = "${RDK_RELEASE}+git${SRCPV}"
     
     S = "${WORKDIR}/git"
     B = "${WORKDIR}/build"