Versions Compared

Key

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

...

  • PCI
  • PDRI
  • Remote Firmware
  • Additional supports to deploy and updates security certificate bundles 

Repository

rdkcentral/rdkfwupdater


draw.io Diagram
bordertrue
diagramNameFirmware manager
simpleViewerfalse
width600
linksauto
tbstyletop
lboxtrue
diagramWidth726
height568
revision1

...

This service provides the download location (URL) required for RDK download Manager for dynamic Apps/packages/certs/tools installation. This module is responsible to trigger RDM Application. The module will do the security evaluation of the downloaded packages and verify the signature to ensure the installation of packages. 

RDK Firmware Upgrader

The App or binary name as part of rootfs is "rdkvfwupgrader". This module having below components

...

  1. In case of X1 device this module is trigger by system service called swupdate.service and in case of TV this module is trigger by Maintenance Manager. And the trigger time is during boot up and maintenance window time and App trigger.
  2. In case of non-RDKE swupdate.service or maintenance manager is calling "swupdate_utils.sh". Then swupdate_utils.sh will call "rdkvfwupgrader" if the RDK Firmware RFC is true else script based download will start. 
  3. In case of RDK-E maintenance manager is calling rdkvfwupdater using system call.
  4. Once the rdkvfwupgradr start it gets all device info like MAC, partner id, current running image, pdri image, peripheral image etc and create XCONF query request. Below is the sample XCONF query request.
    tbd
  5. Once the query request is formed then this module send the request to XCONF server and get the response. This response is in json format.
    tbd
  6. Once the XCONF response received then it processes the response and add to the data structure for future use.
  7. Then this module does the image validation if image is invalid then this module is exit with error message.
  8. Once the image validation pass then it goes for PCI download. If the download fail then it has 3 times retry before make download status fail. If the download completed successfully then this image is flashed to the flash memory. Before image download start this module will check if any chunk of the image already present if it present then download start from where it left last time.
  9. After 3 retry happen because of http error code 0 then download switch to codebig server download. This kind of proxy server. If this download pass, then status is successfully else download is failed.
  10. If the download is failed due to certificate validation error, then state red recovery download will trigger. This is a kind of recovery server which is use static certificate to download image.
  11. If no failure during download and download completed successfully then this image is flashed to flash memory. Before flashing the image sign verification happen.
  12. Same above step 7 to 10 repeat for PDRI image and peripheral image.
  13. Once the download completed the status of the download is send to maintenance manager and some other service using IARM event.

Firmware Download Trigger Sequence Diagram in RDK-V Device:

Below Sequence diagram is for device where maintenance manager is running

draw.io Diagram
bordertrue
diagramNamerdk-firmware-download
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth794
height631
revision1


Sequence Diagram RDKE

...


PlantUML Macro
@startuml
title Reference
legend
  |<back:Green>   | Libraries       |
  |<back:Yellow>  | Cloud Endpoints |
  |<back:Grey>    | Daemon          |
end legend
@enduml

...

  1. In above Sequence Diagram Maintenance Manager is parg of rdkservices module. Which is responsible for all the device maintenance activity.
  2. rdkvfwupdater is a binary having iarm, rfc and flash app in a single monolithic image.
  3. download lib, utils lib and jason parser all 3 are part of common-utilities component. This module will provide all 3 shared library which can link to other module. 

New Refactor Design[WORK IN PROGRESS]


PlantUML Macro
scriptrefactorsequencediag
@startuml
participant mm
participant rdkvfwupdater
participant iarmlib #Green
participant rfclib #Green
participant jsonlib #Green
participant upgradelib #Green
participant utilslib #Green
participant downloadlib #Green
participant xconfserver #Yellow
participant parsinglib #Green
participant ssrserver #Yellow
participant flashapp

mm -> rdkvfwupdater : trigger
rdkvfwupdater -> rdkvfwupdater : initial validation
alt validation success
    rdkvfwupdater -> utilslib : get device details
    utilslib --> rdkvfwupdater : device details
    rdkvfwupdater -> rfclib : get rfc data
    rfclib --> rdkvfwupdater : rfc data
    rdkvfwupdater -> jsonlib : create json request
    jsonlib -> parsinglib : generic JSON parse/construct
    parsinglib --> jsonlib : result
    jsonlib --> rdkvfwupdater : json payload
    rdkvfwupdater -> upgradelib : request xconf connection
    upgradelib -> downloadlib : connect to xconf server
    downloadlib -> xconfserver : request
    alt xconf response success
        xconfserver --> downloadlib : success response
        downloadlib --> upgradelib : success response
        upgradelib --> rdkvfwupdater : success response
        rdkvfwupdater -> jsonlib : parse json data
        jsonlib -> parsinglib : generic JSON parse/construct
        parsinglib --> jsonlib : result
        alt parsing success
            jsonlib --> rdkvfwupdater : success response
            rdkvfwupdater -> rdkvfwupdater : process json data
            alt new image different
                rdkvfwupdater -> upgradelib : download image
                upgradelib -> downloadlib : download image
                downloadlib -> ssrserver : request
                ssrserver --> downloadlib : server status
                alt server status 0
                    downloadlib --> upgradelib : success response
                    upgradelib --> rdkvfwupdater : success response
                    rdkvfwupdater -> flashapp : flash image
                    flashapp --> rdkvfwupdater : flash status
                    rdkvfwupdater -> iarmlib : success status
                    iarmlib --> mm : success status
                else server status 18 or 28
                    downloadlib --> upgradelib : chunkdownload
                    upgradelib --> rdkvfwupdater : chunkdownload
                    rdkvfwupdater -> flashapp : flash image
                    flashapp --> rdkvfwupdater : flash status
                    rdkvfwupdater -> iarmlib : success status
                    iarmlib --> mm : success status
                else server status 58
                    rdkvfwupdater -> rdkvfwupdater : recovery download
                else other server status
                    downloadlib --> upgradelib : retry download
                    upgradelib --> rdkvfwupdater : retry download
                    rdkvfwupdater -> iarmlib : fail status
                    iarmlib --> mm : fail status
                end
            else same image
                rdkvfwupdater -> iarmlib : success status
                iarmlib --> mm : success status
            end
        else parsing fail
            rdkvfwupdater -> iarmlib : fail status
            iarmlib --> mm : fail status
        end
    else xconf response fail
        xconfserver --> downloadlib : fail response
        downloadlib --> upgradelib : fail response
        upgradelib --> rdkvfwupdater : fail response
        rdkvfwupdater -> iarmlib : fail status
        iarmlib --> mm : fail status
    end
else validation fail
    rdkvfwupdater -> iarmlib : error status
    iarmlib --> mm : error status
end
@enduml

...