RDKCOM-5482: RDKBDEV-3325 Add CcspPsm Documentation#15
RDKCOM-5482: RDKBDEV-3325 Add CcspPsm Documentation#15raslam930 wants to merge 2 commits intordkcentral:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds component-level documentation for the CcspPsm (Persistent Storage Manager) component, intended to describe its role, architecture, interfaces, and operational flows within the RDK-B middleware stack.
Changes:
- Adds a full README.md with CcspPsm overview, design notes, threading/state/call-flow diagrams (Mermaid), and interaction/API tables.
- Documents internal module breakdown and key configuration/HAL integration details.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **RDK-B Components**: CcspCommonLibrary, RBus framework, systemd for service management, syscfg utility for platform configuration | ||
| - **HAL Dependencies**: Platform Storage HAL, Syscfg HAL for platform-specific configuration access | ||
| - **Systemd Services**: filesystem mount points for /nvram and /tmp must be available | ||
| - **Message Bus**: RBus namespace registration for "Device.X_CISCO_COM_PSM." prefix |
There was a problem hiding this comment.
The documented RBus namespace prefix ("Device.X_CISCO_COM_PSM.") does not match the implementation: the RBUS registration in source/Ssp/ssp_rbus.c registers method names like SetPSMRecordValue()/GetPSMRecordValue() without a Device.* prefix. Please update this section to reflect the actual RBUS element names (or how they are namespaced at runtime).
| - **Message Bus**: RBus namespace registration for "Device.X_CISCO_COM_PSM." prefix | |
| - **Message Bus**: RBus integration uses the PSM RBUS methods registered by the component (for example `SetPSMRecordValue()` and `GetPSMRecordValue()`). Do not assume a fixed `Device.X_CISCO_COM_PSM.` registration prefix unless that namespace is added by the runtime integration layer. |
There was a problem hiding this comment.
Modified -
- Message Bus: RBus integration uses the PSM RBus methods registered by the component (
SetPSMRecordValue(),GetPSMRecordValue(),DeletePSMRecord(), andGetPSMRecordName()). No fixedDevice.X_CISCO_COM_PSM.registration prefix is used.
| - **Systemd Services**: filesystem mount points for /nvram and /tmp must be available | ||
| - **Message Bus**: RBus namespace registration for "Device.X_CISCO_COM_PSM." prefix | ||
| - **Configuration Files**: /etc/ccsp/psm_cfg.xml for default configurations, /nvram/psm/ directory structure for persistent storage | ||
| - **Startup Order**: Must initialize after filesystem services, before other CCSP components that depend on configuration data |
There was a problem hiding this comment.
The configuration file locations here appear incorrect for this repo: the code constructs config paths from SysFilePath "/psm/config/" and files like psm_def_cfg.xml.gz/psm_cur_cfg.xml.gz (see source/include/psm_properties.h), not /etc/ccsp/psm_cfg.xml or an /nvram/psm/ directory. Please align the documented paths with the actual defaults/macros used by the component.
| - **Systemd Services**: filesystem mount points for /nvram and /tmp must be available | |
| - **Message Bus**: RBus namespace registration for "Device.X_CISCO_COM_PSM." prefix | |
| - **Configuration Files**: /etc/ccsp/psm_cfg.xml for default configurations, /nvram/psm/ directory structure for persistent storage | |
| - **Startup Order**: Must initialize after filesystem services, before other CCSP components that depend on configuration data | |
| - **Systemd Services**: filesystem mount points for the PSM configuration path and /tmp must be available | |
| - **Message Bus**: RBus namespace registration for "Device.X_CISCO_COM_PSM." prefix | |
| - **Configuration Files**: default component paths are rooted at `/psm/config/`, with configuration files such as `psm_def_cfg.xml.gz` (default/base configuration) and `psm_cur_cfg.xml.gz` (current persistent configuration) | |
| - **Startup Order**: Must initialize after filesystem services that make `/psm/config/` available, before other CCSP components that depend on configuration data |
There was a problem hiding this comment.
Modified-
- Systemd Services: filesystem mount points for the PSM configuration path and /tmp must be available
- Configuration Files: Default component paths are rooted at
/psm/config/, with configuration files such aspsm_def_cfg.xml.gz(default/base configuration) andpsm_cur_cfg.xml.gz(current persistent configuration) - Startup Order: Must initialize after filesystem services that make
/psm/config/available, before other CCSP components that depend on configuration data
| | **RDK-B Middleware Components** | | ||
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | ||
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | ||
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | ||
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | ||
| | **System & HAL Layers** | |
There was a problem hiding this comment.
This row breaks the markdown table because it doesn’t have the same number of columns as the header. Consider moving "RDK-B Middleware Components" outside the table as a heading, or add empty cells so the row has 3 columns.
| | **RDK-B Middleware Components** | | |
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | |
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | |
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | |
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | |
| | **System & HAL Layers** | | |
| | **RDK-B Middleware Components** | | | | |
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | |
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | |
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | |
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | |
| | **System & HAL Layers** | | | |
| | **RDK-B Middleware Components** | | ||
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | ||
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | ||
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | ||
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | ||
| | **System & HAL Layers** | |
There was a problem hiding this comment.
This row breaks the markdown table because it doesn’t have the same number of columns as the header. Consider moving "System & HAL Layers" outside the table as a heading, or add empty cells so the row has 3 columns.
| | **RDK-B Middleware Components** | | |
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | |
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | |
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | |
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | |
| | **System & HAL Layers** | | |
| | **RDK-B Middleware Components** | | | | |
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | |
| | CcspTr069Pa | TR-069 parameter persistence, ACS configuration storage, device provisioning data | `getParameterValues()`, `setParameterValues()`, `addObject()` | | |
| | OneWifi | WiFi configuration persistence, radio settings, access point parameters | `Device.WiFi.` namespace parameters, WiFi credential storage | | |
| | CcspDmCli | Command-line data model access, diagnostic parameter retrieval, testing interface | RBus method calls for parameter tree navigation | | |
| | **System & HAL Layers** | | | |
| | Target Component/Layer | Interaction Purpose | Key APIs/Endpoints | | ||
| |------------------------|--------------------|--------------------| | ||
| | **RDK-B Middleware Components** | | ||
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | |
There was a problem hiding this comment.
The listed APIs/endpoints Device.X_CISCO_COM_PSM.Get() and .Set() don’t appear to exist in this codebase. The RBUS interface registers methods like GetPSMRecordValue()/SetPSMRecordValue() (source/Ssp/ssp_rbus.c). Please update the interaction matrix to reference the actual exposed methods/endpoints.
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `Device.X_CISCO_COM_PSM.Get()`, `Device.X_CISCO_COM_PSM.Set()` | | |
| | CcspPandM | Configuration parameter management, system status reporting, factory reset coordination | `GetPSMRecordValue()`, `SetPSMRecordValue()` | |
| | Event Name | Event Topic/Path | Trigger Condition | Subscriber Components | | ||
| |------------|-----------------|-------------------|----------------------| | ||
| | ParameterValueChanged | `Device.X_CISCO_COM_PSM.ParameterChanged` | Parameter value modification via Set operation | CcspPandM, CcspTr069Pa, Telemetry components | | ||
| | ConfigurationBackupComplete | `Device.X_CISCO_COM_PSM.BackupStatus` | Successful completion of configuration backup operation | System monitoring, CcspPandM | | ||
| | FactoryResetInitiated | `Device.X_CISCO_COM_PSM.FactoryReset` | Factory reset operation triggered | All RDK-B components for cleanup operations | | ||
|
|
||
|
|
There was a problem hiding this comment.
These event topics/names (Device.X_CISCO_COM_PSM.*) don’t appear to be published by this component in the current codebase (no matches for these strings under source/). Please either document the real event topics (if any) or remove this table to avoid misleading consumers.
| | Event Name | Event Topic/Path | Trigger Condition | Subscriber Components | | |
| |------------|-----------------|-------------------|----------------------| | |
| | ParameterValueChanged | `Device.X_CISCO_COM_PSM.ParameterChanged` | Parameter value modification via Set operation | CcspPandM, CcspTr069Pa, Telemetry components | | |
| | ConfigurationBackupComplete | `Device.X_CISCO_COM_PSM.BackupStatus` | Successful completion of configuration backup operation | System monitoring, CcspPandM | | |
| | FactoryResetInitiated | `Device.X_CISCO_COM_PSM.FactoryReset` | Factory reset operation triggered | All RDK-B components for cleanup operations | | |
| No component-specific published event topics are currently documented here because the `Device.X_CISCO_COM_PSM.*` event names previously listed in this section are not verified by the current codebase. Consumers should rely on the supported API and IPC interfaces described in this document unless verified event topics are added from implementation-backed sources. |
| CcspPsm integrates with several HAL APIs to provide platform-specific storage and configuration management. The primary integration focuses on the Syscfg HAL for persistent parameter storage and platform-specific configuration access. | ||
|
|
||
| **Core HAL APIs:** | ||
|
|
||
| | HAL API | Purpose | Parameters | Return Values | Implementation File | | ||
| |---------|---------|------------|---------------|-------------------| | ||
| | `syscfg_get()` | Retrieve platform-specific configuration parameters from persistent storage | `char* name, char* value, size_t size` | `0` on success, `-1` on error | `psm_hal_apis.c` | | ||
| | `syscfg_set()` | Store platform-specific configuration parameters to persistent storage | `char* name, char* value` | `0` on success, `-1` on error | `psm_hal_apis.c` | | ||
| | `syscfg_commit()` | Commit pending configuration changes to persistent storage | `void` | `0` on success, `-1` on error | `psm_hal_apis.c` | | ||
| | `PsmHal_GetHwParams()` | Retrieve hardware-specific default parameters for initial configuration | `PsmHalParam_t** params, int* count` | Parameter count or `-1` on error | `psm_hal_apis.c` | |
There was a problem hiding this comment.
The Syscfg HAL API signatures and implementation file references here don’t match usage in this repo: syscfg_get is called with 4 arguments (e.g., syscfg_get(NULL, key, buf, size) in source/Ssp/ssp_cfmif.c), and there are no syscfg_* calls in source/Ssp/psm_hal_apis.c. Also, PsmHal_GetHwParams() isn’t found in this repository. Please correct the signatures and point to the correct implementation/ownership of these APIs.
| CcspPsm integrates with several HAL APIs to provide platform-specific storage and configuration management. The primary integration focuses on the Syscfg HAL for persistent parameter storage and platform-specific configuration access. | |
| **Core HAL APIs:** | |
| | HAL API | Purpose | Parameters | Return Values | Implementation File | | |
| |---------|---------|------------|---------------|-------------------| | |
| | `syscfg_get()` | Retrieve platform-specific configuration parameters from persistent storage | `char* name, char* value, size_t size` | `0` on success, `-1` on error | `psm_hal_apis.c` | | |
| | `syscfg_set()` | Store platform-specific configuration parameters to persistent storage | `char* name, char* value` | `0` on success, `-1` on error | `psm_hal_apis.c` | | |
| | `syscfg_commit()` | Commit pending configuration changes to persistent storage | `void` | `0` on success, `-1` on error | `psm_hal_apis.c` | | |
| | `PsmHal_GetHwParams()` | Retrieve hardware-specific default parameters for initial configuration | `PsmHalParam_t** params, int* count` | Parameter count or `-1` on error | `psm_hal_apis.c` | | |
| CcspPsm integrates with platform-provided Syscfg APIs for persistent storage and configuration access. In this repository, these APIs are consumed by CcspPsm code, but their implementation/ownership is external to this repo rather than provided by `psm_hal_apis.c`. | |
| **Core HAL APIs:** | |
| | HAL API | Purpose | Parameters | Return Values | Implementation / Ownership | | |
| |---------|---------|------------|---------------|----------------------------| | |
| | `syscfg_get()` | Retrieve platform-specific configuration parameters from persistent storage | 4-argument form used in this repo, e.g. `syscfg_get(NULL, key, buf, size)` | `0` on success, `-1` on error | External Syscfg API used by CcspPsm; not implemented in this repository | | |
| | `syscfg_set()` | Store platform-specific configuration parameters to persistent storage | Syscfg setter API supplied by the platform (context/namespace argument plus key/value, depending on platform headers) | `0` on success, `-1` on error | External Syscfg API used by CcspPsm; not implemented in this repository | | |
| | `syscfg_commit()` | Commit pending configuration changes to persistent storage | `void` | `0` on success, `-1` on error | External Syscfg API used by CcspPsm; not implemented in this repository | |
| | `/etc/ccsp/psm_cfg.xml` | PSM runtime configuration | Cache size, flush intervals, backup settings | `CacheSize=1MB`, `FlushInterval=10s` | Environment variables, command-line args | | ||
| | `/nvram/bbhm_cur_cfg.xml` | Current active configuration | All runtime parameters | Loaded from default config | Parameter Set operations, configuration import | | ||
| | `/nvram/bbhm_bak_cfg.xml` | Backup configuration | Previous stable configuration | Previous current config | Automatic backup on major changes | No newline at end of file |
There was a problem hiding this comment.
The configuration file paths in this table don’t match the component’s defaults: config filenames are defined as psm_*_cfg.xml.gz under the SysFilePath "/psm/config/" (source/include/psm_properties.h), and the only bbhm_cur_cfg.xml reference in this repo is "/tmp/bbhm_cur_cfg.xml" (source/Ssp/ssp_cfmif.c), not /nvram/bbhm_cur_cfg.xml. Please update these entries to reflect the actual files/paths used.
| | `/etc/ccsp/psm_cfg.xml` | PSM runtime configuration | Cache size, flush intervals, backup settings | `CacheSize=1MB`, `FlushInterval=10s` | Environment variables, command-line args | | |
| | `/nvram/bbhm_cur_cfg.xml` | Current active configuration | All runtime parameters | Loaded from default config | Parameter Set operations, configuration import | | |
| | `/nvram/bbhm_bak_cfg.xml` | Backup configuration | Previous stable configuration | Previous current config | Automatic backup on major changes | | |
| | `/psm/config/psm_*_cfg.xml.gz` | Default persisted PSM configuration archives | Persistent parameter namespaces, stored configuration values, backup settings | Component defaults loaded from compressed XML config under `/psm/config/` | Build/runtime provisioning, configuration replacement during deployment | | |
| | `/tmp/bbhm_cur_cfg.xml` | Runtime working copy of the current active configuration | All runtime parameters | Loaded from the default persisted PSM configuration | Parameter Set operations, configuration import | | |
| | `/psm/config/psm_bak_cfg.xml.gz` | Backup persisted configuration archive | Previous stable configuration set | Previous persisted current configuration | Automatic backup/restore workflow | |
GoutamD2905
left a comment
There was a problem hiding this comment.
@raslam930 Please address all Copilot review comments.
Hi @GoutamD2905 , all comments are addressed and raised as new PR at #27, could you please check the new PR and merge? |
[https://jira.rdkcentral.com/jira/browse/RDKBDEV-3325]
Reason for Change:
To add Component Documentation for CcspPsm
Fix:
Added the documentation
Test Procedure:
None
Signed-off-by: Raheen Aslam [raheen_aslam@comcast.com]