You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This document explains about how to build RDKB containerization image and use it. In addition it also has some useful commands which can be used to handle the containers

Build steps

Compile/build

 Go to the <workspace> and execute the following command:

source meta-cmf-raspberrypi/setup-environment

 A list is obtained, select the following option from among the list:

12) meta-cmf-raspberrypi/conf/machine/raspberrypi-rdk-broadband-lxc.conf

 The path is automatically directed to:

<workspace>/build-raspberrypi-rdk-broadband-lxc/

 Use the following command to compile the code:

bitbake rdk-generic-broadband-lxc-image


 Image path 

Once the code generation for containerization is compiled, the image for the same is found under the path:

 <workspace>/build-raspberrypi-rdk-broadband-lxc/tmp/deploy/images/raspberrypi-rdk-broadband-lxc/<ImageName.rootfs.rpi-sdimg>

 Ex:

 container-work/build-raspberrypi-rdk-broadband-lxc/tmp/deploy/images/raspberrypi-rdk-broadband-lxcrdk-generic-broadband-lxc-image_default_20190327101556.rootfs.rpi-sdimg

 

Command to flash the image 

Above image is flashed into an SD card using the command:

sudo dd if=<path to ImageName.rootfs.rpi-sdimg> of=<path to SD card space> bs=4M

Ex:

sudo dd if=rdkb-generic-broadband-image_default_20181026100202.rootfs.rpi-sdimg of=/dev/sdd bs=4M

The SD card is run on a Raspberry Pi board and booted to check for containers created.

The Raspberry Pi board is connected to the PC via a USB to serial converter and the logs can be checked in console


Steps/commands to be used for identifying container process running after board boots up are as follows

Steps/commands

 1. Check all the processes running in regard to lxc.

            ps -Af | grep lxc

            Output in the Pi terminal should be as below:


5530

root

0.00

/usr/bin/lxc-execute -n PSMSSP -f /container/PSMSSP/conf/lxc.conf -- /usr/bin/PsmSsp -subsys eRT .

5534

psm

0.00

/init.lxc.static –gid 705 –uid 705 -- /usr/bin/PsmSsp -subsys eRT .

6433

root

0.00

/usr/bin/lxc-execute -n CCSPPANDM -f /container/CCSPPANDM/conf/lxc.conf -- /usr/bin/gw_prov_utopia

6435

pandm

0.00

/init.lxc.static –gid 706 –uid 706 -- /usr/bin/gw_prov_utopia

6520

root

0.00

/usr/bin/lxc-execute -n DBUS -f /container/DBUS/conf/lxc.conf -- /usr/bin/dbus-daemon –system –nofork –nopidfile –systemd-activation

6532

dbus

0.00

/init.lxc.static –gid 703 –uid 703 -- /usr/bin/dbus-daemon –system –nofork –nopidfile –systemd-activation

6574

root

0.00

/usr/bin/lxc-execute -n CCSPCR -f /container/CCSPCR/conf/lxc.conf -- /usr/bin/CcspCrSsp -subsys eRT .

6577

ccspcr

0.00

/init.lxc.static –gid 704 –uid 704 -- /usr/bin/CcspCrSsp -subsys eRT .

6737

root

0.00

grep lxc


Invoking containers manually

1.  Run respective container scripts to execute individual container when container fails in boot up process

            sh /container/<Container Name>/launcher/<container.sh> start

            Ex:

            sh /container/PSMSSP/launcher/PsmSsp.sh start

            The above command can be executed to run PSM container and see its logs in Console.

 

2. Run command/commands inside the container specified by the Name when the container is already running 

            lxc-attach -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf

            Ex:

            lxc-attach -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf

            The above command can be executed to run the commands specified by lxc.conf file.

Containers and their respective files

 DBUS

 i. Service file used:

            /lib/systemd/system/dbus.service

 ii. Directory name:

            /container/DBUS/

 iii. Conf file used for it:

            /container/DBUS/conf/lxc.conf

 iv. Summary of this component:

            DBUS acts as a message bus. DBUS container contains commands which initialize the message bus and connects all the components to each other for communication. Dbus path differs for each component.

 PSM

 i. Service file used:

            /lib/systemd/system/PsmSsp.service

 ii. Directory name:

            /container/PSMSSP/

 iii. Conf file used for it:

            /container/PSMSSP/conf/lxc.conf

 iv. Summary of this component:

            Persistent Storage Manager container stores current/default system configurations and retrieves them from backup files when required on behalf of other component containers.

 P and M

 i. Service file used:

            /lib/systemd/system/CcspPandMSsp.service

 ii. Directory name:

            /container/CCSPPANDM/

 iii. Conf file used for it:

            /container/CCSPPANDM/conf/lxc.conf

 iv. Summary of this component:

            Provisioning and Management container acts an an interface and responds to any query or setting of variables. It keeps a track of changes in attributes and notifies to other component containers.

            This container also handles Gateway provisioning for provisioning LAN and DOCSIS which includes IP addressing, routing and other gateway initialisation. It initiates registration of all servies on boot up. 

WiFi Agent

 i. Service file used:

            /lib/systemd/system/ccspwifiagent.service

 ii. Directory name:

            /container/CCSPWIFI/

 iii. Conf file used for it:

            /container/CCSPWIFI/conf/lxc.conf

 iv. Summary of this component:

            WiFi Agent container provides each component container, the access to data model APIs and driver specific APIs to manage WiFi specific parameters through a component specific Abstraction layer. It helps to manage and configure the gateway’s wifi access point interface.         

CR

 i. Service file used:

            /lib/systemd/system/CcspCrSsp.service

 ii. Directory name:

            /container/CCSPCR/

 iii. Conf file used for it:

            /container/CCSPCR/conf/lxc.conf

 iv. Summary of this component:

            Component registrar acts as a centralized container for registration of all the component containers with their respective name, version, dbus path and namespace.


Useful commands 

lxc-execute

 This command is used to quickly launch a container in an isolated environment. It mainly runs the specified command into the container via intermediate process lxc-init (forwards the received signal to starting command). Lxc-execute uses the configurations specified by the lxc-create process. 

Ex:

lxc-execute -n DBUS -f /container/DBUS/conf/lxc.conf

lxc-execute -n PSMSSP -f /container/PSMSSP/conf/lxc.conf

lxc-execute -n CCSPPANDM -f /container/CCSPPANDM/conf/lxc.conf

lxc-execute -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf

lxc-execute -n CCSPCR -f /container/CCSPCR/conf/lxc.conf 

lxc-attach 

This command attaches to the container namespace and run a specified command inside, the already executing container.

 Ex:

lxc-attach -n DBUS -f /container/DBUS/conf/lxc.conf

lxc-attach -n PSMSSP -f /container/PSMSSP/conf/lxc.conf

lxc-attach -n CCSPPANDM -f /container/CCSPPANDM/conf/lxc.conf

lxc-attach -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf

lxc-attach -n CCSPCR -f /container/CCSPCR/conf/lxc.conf


  • No labels