Versions Compared

Key

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

...

execute the following command:


Code Block
languagebash
$ source meta-cmf-raspberrypi/setup-environment

...

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


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


The path is automatically directed to:

...

Use the following command to compile the complete code:


Code Block
languagebash
titleBuild generation
$ bitbake rdk-generic-broadband-lxc-image



To compile a specific component container use the below command:


Code Block
languagebash
$ bitbake <component> -c compile -f


Ex:


Code Block
languagebash
$ bitbake ccsp-dmcli -c compile -f


The above command will compile the dmcli component container.

...

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


Code Block
languagebash
$ cd <workspace>/build-raspberrypi-rdk-broadband-lxc/tmp/deploy/images/raspberrypi-rdk-broadband-lxc/



The image to be considered:

<ImageName.rootfs.rpi-sdimg>

Ex:

Path:

Code Block
languagebash
$ cd container-work/build-raspberrypi-rdk-broadband-lxc/tmp/deploy/images/

Image:

raspberrypi-rdk-broadband-lxcrdk-generic-broadband-lxc-image_default_20190327101556.rootfs.rpi-sdimg

...

Generated image has to be flashed to an SD card using this command in local PC:


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


Ex:


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


The SD card is inserted to the Raspberry Pi board and booted to check for containers created.

...

The above folders will be created automatically based on the xml files written in the workspace.

Path :


Code Block
languagebash
titleXML File path
<workspace>/meta-cmf-raspberrypi/recipes-containers/lxc-container-generator/files/xml/<container.xml>


Ex:


Code Block
languagebash
container-work/meta-cmf-raspberrypi/recipes-containers/lxc-container-generator/files/xml/lxc_conf_CcspPandMSsp.xml


The above xml file is written for “P and M” container and will be responsible for the generation of the 3 folders mentioned above.

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


         ps

Code Block
languagebash
$ ps -Af | grep lxc



The Pi terminal should show logssimilar to the following:

...

After checking pandm container status which has to be up and running, run the following commands


  • Code Block
    languagebash
    $ sh /lib/rdk/wifi_container.sh

    - this command may return error which can be ignored

  • Code Block
    languagebash
    $ sh /container/CCSPWIFI/launcher/CcspWifiSsp.sh start

Please wait for few seconds/mins till log "Enter WiFi Loop" is observed in the console

  • Code Block
    languagebash
    $ lxc-attach -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf

After execution of above command shell will change to ccspwifi
Inside container shell please run following command 

  • Code Block
    languagebash
    $ hostapd -B /nvram/hostapd0.conf


Now Check (in host shell) if CCSPWIFI container is running with corresponding name 

Now, can able to connect wifi client(Laptop or mobile) using default ssid: RPI3_RDKB-AP0 and password as : rdk@1234

Invoking containers manually in Raspberry Pi terminal

...

1. Run respective container scripts to execute individual container when container fails in boot up process:sh /container/<Container Name>/launcher/<container.sh> start


Code Block
languagebash
sh /container/<Container Name>/launcher/<container.sh> start


Ex:


Code Block
languagebash
$ 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:


Code Block
languagebash
$ lxc-attach -n CCSPWIFI -f /container/CCSPWIFI/conf/lxc.conf


Ex:


Code Block
languagebash
$ 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.

...

DBUS

i. Service file used:


Code Block
languagebash
/lib/systemd/system/dbus.service


ii. Directory name:


Code Block
languagebash
/container/DBUS/

iii. Conf file used for it:


Code Block
languagebash
/container/DBUS/conf/lxc.conf


iv. Service handled by this file:

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:


Code Block
languagebash
/lib/systemd/system/PsmSsp.service


ii. Directory name:


Code Block
languagebash
/container/PSMSSP/


iii. Conf file used for it:


Code Block
languagebash
/container/PSMSSP/conf/lxc.conf


iv. Service handled by this file:

...

P and M

i. Service file used:


Code Block
languagebash
/lib/systemd/system/CcspPandMSsp.service

ii. Directory name:


Code Block
languagebash
/container/CCSPPANDM/


iii. Conf file used for it:


Code Block
languagebash
/container/CCSPPANDM/conf/lxc.conf

iv. Service handled by this file:

...

WiFi Agent

i. Service file used:


Code Block
languagebash
/lib/systemd/system/ccspwifiagent.service

ii. Directory name:


Code Block
languagebash
/container/CCSPWIFI/


iii. Conf file used for it:


Code Block
languagebash
/container/CCSPWIFI/conf/lxc.conf


iv. Service handled by this file:

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:


Code Block
languagebash
/lib/systemd/system/CcspCrSsp.service

ii. Directory name:


Code Block
languagebash
/container/CCSPCR/


iii. Conf file used for it:


Code Block
languagebash
/container/CCSPCR/conf/lxc.conf


iv. Service handled by this file:

...

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:


Code Block
languagebash
$ 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:


Code Block
languagebash
$ 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


hostapd

hostapd is software daemon used for turning the normal network interface to access point.

Ex:


Code Block
languagebash
$ hostapd -B /nvram/hostapd0.conf



Usage of Container based RDKB gateway

...