# rdkcentral/rdkfwupdater architecture

> Architecture diagram of the GitHub repository rdkcentral/rdkfwupdater, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rdkcentral/rdkfwupdater
- Repository: https://github.com/rdkcentral/rdkfwupdater

## Overview

This repository implements RDK firmware update and recovery: an invoked updater gathers device/RFC context, queries XCONF, interprets firmware instructions, downloads the selected image, and flashes it while reporting status. A D-Bus-facing manager and asynchronous client API provide another product interface. The README documents the main upgrade sequence; the source index confirms several module references, but unsampled implementations limit confidence about finer-grained calls and some integrations.

Main entry points: [`src/rdkv_upgrade.c`](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_upgrade.c) (Upgrade orchestration), [`src/rdkv_main.c`](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_main.c) (Updater main), [`src/dbus/rdkFwupdateMgr_handlers.c`](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/dbus/rdkFwupdateMgr_handlers.c) (D-Bus handlers), [`src/deviceutils/device_api.c`](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/deviceutils/device_api.c) (Device information)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Update workflow"]
  node_main["Updater main<br/>[rdkv_main.c]"]
  node_json["XCONF response parsing<br/>[json_process.c]"]
  node_upgradecheck["Upgrade selection<br/>[rdkFwupdateMgr.c]"]
end

subgraph group_download["Download and recovery"]
  node_upgrade["Upgrade orchestration<br/>[rdkv_upgrade.c]"]
  node_direct["Direct CDN download<br/>[directcdn.c]"]
  node_chunk["Chunk download<br/>[chunk.c]"]
  node_flash["Image flashing<br/>[flash.c]"]
end

subgraph group_platform["Device integration"]
  node_device["Device information<br/>[device_api.c]"]
  node_utils["Device utilities<br/>[deviceutils.c]"]
  node_rfc["RFC settings<br/>[rfcinterface.c]"]
  node_cedm["mTLS credentials<br/>[mtlsUtils.c]"]
  node_status["Download status"]
  node_state["Device and recovery state"]
  node_iarm["IARM events<br/>[iarmInterface.c]"]
end

subgraph group_interfaces["Application interfaces"]
  node_dbus["D-Bus server<br/>[rdkv_dbus_server.c]"]
  node_handlers["D-Bus handlers"]
  node_asyncapi["Async client API"]
  node_asyncwork["Async operations"]
end

node_script(("Update script"))
node_xconf(("XCONF service"))
node_codebig(("Codebig / SSR"))
node_storage[("Device flash storage")]

node_script -->|"invokes"| node_main
node_main -->|"reads context"| node_device
node_main -->|"reads settings"| node_rfc
node_main -.->|"uses credentials"| node_cedm
node_main -->|"requests firmware"| node_xconf
node_main -->|"processes response"| node_json
node_main -->|"checks upgrade"| node_upgradecheck
node_upgradecheck -->|"triggers download"| node_upgrade
node_upgrade -->|"selects download"| node_direct
node_upgrade -->|"falls back"| node_codebig
node_upgrade -.->|"downloads chunks"| node_chunk
node_upgrade -->|"checks recovery"| node_state
node_upgrade -->|"flashes image"| node_flash
node_flash -->|"writes image"| node_storage
node_upgrade -->|"updates status"| node_status
node_upgrade -->|"reports events"| node_iarm
node_main -.->|"starts service"| node_dbus
node_dbus -->|"dispatches"| node_handlers
node_handlers -->|"uses device APIs"| node_device
node_handlers -->|"uses upgrade API"| node_upgrade
node_asyncapi -->|"starts operations"| node_asyncwork
node_device -->|"uses utilities"| node_utils

click node_main "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_main.c"
click node_device "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/deviceutils/device_api.c"
click node_utils "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/deviceutils/deviceutils.c"
click node_rfc "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rfcInterface/rfcinterface.c"
click node_cedm "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/cedmInterface/mtlsUtils.c"
click node_json "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/json_process.c"
click node_upgradecheck "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkFwupdateMgr.c"
click node_upgrade "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_upgrade.c"
click node_direct "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/directcdn.c"
click node_chunk "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/chunk.c"
click node_flash "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/flash.c"
click node_status "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/download_status_helper.c"
click node_state "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/device_status_helper.c"
click node_iarm "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/iarmInterface/iarmInterface.c"
click node_dbus "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/dbus/rdkv_dbus_server.c"
click node_handlers "https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/dbus/rdkFwupdateMgr_handlers.c"
click node_asyncapi "https://github.com/rdkcentral/rdkfwupdater/blob/develop/librdkFwupdateMgr/src/rdkFwupdateMgr_api.c"
click node_asyncwork "https://github.com/rdkcentral/rdkfwupdater/blob/develop/librdkFwupdateMgr/src/rdkFwupdateMgr_async.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_json,node_upgradecheck toneBlue
class node_upgrade,node_direct,node_chunk,node_flash,node_storage toneAmber
class node_device,node_utils,node_rfc,node_cedm,node_status,node_state,node_iarm toneMint
class node_dbus,node_handlers,node_asyncapi,node_asyncwork toneRose
class node_script,node_xconf,node_codebig toneIndigo
```

## Components

### Update workflow

- [Updater main](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_main.c): `src/rdkv_main.c`
- [XCONF response parsing](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/json_process.c): `src/json_process.c`
- [Upgrade selection](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkFwupdateMgr.c): `src/rdkFwupdateMgr.c`

### Download and recovery

- [Upgrade orchestration](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rdkv_upgrade.c): `src/rdkv_upgrade.c`
- [Direct CDN download](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/directcdn.c): `src/directcdn.c`
- [Chunk download](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/chunk.c): `src/chunk.c`
- [Image flashing](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/flash.c): `src/flash.c`

### Device integration

- [Device information](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/deviceutils/device_api.c): `src/deviceutils/device_api.c`
- [Device utilities](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/deviceutils/deviceutils.c): `src/deviceutils/deviceutils.c`
- [RFC settings](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/rfcInterface/rfcinterface.c): `src/rfcInterface/rfcinterface.c`
- [mTLS credentials](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/cedmInterface/mtlsUtils.c): `src/cedmInterface/mtlsUtils.c`
- [Download status](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/download_status_helper.c): `src/download_status_helper.c`
- [Device and recovery state](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/device_status_helper.c): `src/device_status_helper.c`
- [IARM events](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/iarmInterface/iarmInterface.c): `src/iarmInterface/iarmInterface.c`

### Application interfaces

- [D-Bus server](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/dbus/rdkv_dbus_server.c): `src/dbus/rdkv_dbus_server.c`
- [D-Bus handlers](https://github.com/rdkcentral/rdkfwupdater/blob/develop/src/dbus/rdkFwupdateMgr_handlers.c): `src/dbus/rdkFwupdateMgr_handlers.c`
- [Async client API](https://github.com/rdkcentral/rdkfwupdater/blob/develop/librdkFwupdateMgr/src/rdkFwupdateMgr_api.c): `librdkFwupdateMgr/src/rdkFwupdateMgr_api.c`
- [Async operations](https://github.com/rdkcentral/rdkfwupdater/blob/develop/librdkFwupdateMgr/src/rdkFwupdateMgr_async.c): `librdkFwupdateMgr/src/rdkFwupdateMgr_async.c`

### Other components

- **Update script**
- **XCONF service**
- **Codebig / SSR**
- **Device flash storage**

## Connections

- Update script → Updater main: invokes (evidence: `README`)
- Updater main → Device information: reads context (evidence: `README`)
- Updater main → RFC settings: reads settings (evidence: `README`)
- Updater main → mTLS credentials: uses credentials
- Updater main → XCONF service: requests firmware (evidence: `README`)
- Updater main → XCONF response parsing: processes response (evidence: `README`)
- Updater main → Upgrade selection: checks upgrade (evidence: `README`)
- Upgrade selection → Upgrade orchestration: triggers download (evidence: `README`)
- Upgrade orchestration → Direct CDN download: selects download (evidence: `README`)
- Upgrade orchestration → Codebig / SSR: falls back (evidence: `README`)
- Upgrade orchestration → Chunk download: downloads chunks
- Upgrade orchestration → Device and recovery state: checks recovery (evidence: `README`)
- Upgrade orchestration → Image flashing: flashes image (evidence: `README`)
- Image flashing → Device flash storage: writes image (evidence: `README`)
- Upgrade orchestration → Download status: updates status (evidence: `README`)
- Upgrade orchestration → IARM events: reports events (evidence: `README`)
- Updater main → D-Bus server: starts service
- D-Bus server → D-Bus handlers: dispatches (evidence: `src/dbus/rdkv_dbus_server.c`)
- D-Bus handlers → Device information: uses device APIs (evidence: `src/dbus/rdkFwupdateMgr_handlers.c`)
- D-Bus handlers → Upgrade orchestration: uses upgrade API (evidence: `src/dbus/rdkFwupdateMgr_handlers.c`)
- Async client API → Async operations: starts operations (evidence: `librdkFwupdateMgr/src/rdkFwupdateMgr_api.c`)
- Device information → Device utilities: uses utilities (evidence: `src/deviceutils/device_api.c`)
