File-/Data-Storage

The files of an app container are unpacked into a read only filesystem mounted via SquashFS, so that the apps cannot save/store data/files in their installation directory at runtime.

 

The app description can be used to specify whether a persistent and/or temporary location is required. This will be created by the AppManager if the corresponding entry is present.

 

Persistent memory is created on a storage medium (e.g. internal or external SD card) and is available again after a restart of the device. It should be noted here that SD cards cannot be rewritten as often as required due to their design and can therefore age. An app may only write files to the medium in rare cases (under no circumstances in short cycles of only a few seconds). The automatic closing of files in case of power failure or reset of the controller is not supported by the system. The app must be able to recognize corrupt files and handle them accordingly.

 

The temporary memory is created as ramdisk and is emptied after each power failure or reset of the controller.

 

The following environment variables from section Directories and environment variables are required:

  • ARP_APPS_DATA_DIR : Root storage directory of the persistent data of all apps
  • ARP_APPS_TEMP_DIR: Root storage directory of the temporary data of all apps

 

If a persistent memory is required by the app, a folder is created under ARP_APPS_DATA_DIR. This folder contains the identifier of the app. An app can store its persistent data in the following folder: ARP_APPS_DATA_DIR/<identifier>

 

If a temporary memory is required by the app, a folder is created under ARP_APPS_TEMP_DIR. This folder contains the identifier of the app. An app can store its temporary data in the following folder: ARP_APPS_TEMP_DIR/<identifier>

Necessary additions in the app description file

If the optional JSON object "datastorage" is present in the app description file, the AppManager knows that configurations for the persistent/temporary folder are located in the app.

The created persistent/temporary folders of an app can be used by all app components.

The "datastorage" entry is structured as follows:

"datastorage":
  {
     "persistentdata": "true",
     "temporarydata": "true"
  }

"persistentdata":

Boolean value for whether persistent memory is required

 

"temporarydata":

Boolean value for whether temporary memory is required

Specifications and restrictions

  • The creation of a persistent/temporary memory does not require a restart of the firmware
  • Stopping an app deletes its persistent/temporary memory

Demo Data Storage App

The procedure for using and configuring a Data Storage App Part is explained in the following demo sections:

 

Support in the firmware

The Data Storage app part type is supported in the firmware from version 19.3.0.

 

 

 

 


 • Published/reviewed: 2020-06-11 • Revision 03 •