Home
        see - GENIVI Alliance
         Contents
1.          checksumDoesNotMatch  report error      E compareBackupChecksumWithFile    H     checksumDoesNotMatch    error     only checksum availabe        If there is only a checksum file available  and no backup  check if checksum  matches with the original file    If it matches  keep original file otherwise  return error because we are in an  inconsistent state      only backup file available     If there is only a backup file without  checksum available  there is one chance to  recover  check if the backup and original file  are identical    If the two checksums does not match  files  are not identical  we have an inconsistent  state  where we have no information how to  recover    In this case an error code will be returned  En En en  because there is no way to figure out which     checksumMatches  recoverFile         A  Create a backup only       requestShutdown         copyBaFiles      dloseFiles      deleteBsckupFiles      deleteChedsumFiles    requestShutdownOK         e AAA A       Figure 6   Recovery Algorithm    Mentor Graphics  Version 2 5 15    3 6 2 Exclude form backup    It is possible to exclude files from the backup mechanism  For this reason there is the file BackupFileList info in  each application folder  Add the relative path and filename to this file and it will be excluded from the backup  creation     Example    BackupFileList info location    Data mnt c It persistence_client_ library test BackupFileList info   File content     media mediaDatabase db   
2.     The resolution from the given API parameters to the key value data or the file is done in done the following way   e The bid parameter gives a hint which resource configuration table  RCT  to use  o First the RCT in the cached path will be queried  o If the resource can be found in the RCT the storage policy will be queried    o If storage policy is cached use the database in the cached path otherwise in the write through  path     o OxFFFF  gt  application local data  use the RCT in the application folder  o 0x0 3 public data  use RCT in the shared folder  o E g  group 20  gt  use the RCT in the group folder of group 20  e Then the input  key  to the database will be generated using resourceld  user no and seat no  o User 0 and seat 0   it is NODE data   input string is  Node resourcelD  o User 3 and seat 2  it is USER data bound to a SEAT   User 3 Seat2 resourcelD    Mentor Graphics  Version 2 5 12    3 5 1 Example    int ret   0     unsigned int shutdownReg    PCL SHUTDOWN TYPE FAST    PCL SHUTDOWN TYPE NORMAL                  unsigned char buffer READ SIZE     0      pcellnitLibrary   Navigation   shutdownReg               Logical DB ID  OxFF with user 1 and seat 1        gt  local value accessible by all users  user 1  seat 1                  ret   pclKeyReadData 0xFF   pos last position   1  1  buffer  READ SIZI    E     H    memset  buffer  0  READ SIZE                    Logical DB ID  OxFF with user 0 and seat 0   Es    gt  local value accessible by all users  us
3.    Check configuration  e key value or file  e Size does not exceed configured max size  e correct permission  write to a read only resource      f the configuration matches  write data to configured location  o RCT does NOT contain information about the requested resource    Create entry about the resource in the RCT    Configure it as a local cached resource      gt  write data    If there is no information about the requested resource  an application will nevertheless able to store this data  with the restriction that the resource will be stored in the local cached path     Note     Only the persistence administration service or the responsible application is allowed to change the resource  configuration table     Mentor Graphics  Version 2 5 10    3 4 1 Cached and write through Resources    Depending on the used storage media  e g  flash drives  there are a limited number of write cycles possible   Typically around 100000 program erase cycles wear out of the flash device begins  Due to this circumstance  writing of data needs to be controlled  because writing too many times data to a memory device may cause a  SHORTER lifetime of the device     Caching will be needed to reduce the number of data written to the device  so most of the resources are cached  resources     But there are also requirements to write back data directly to the memory device when the data has been  changed  e g  destination address for navigation  because if a reset occurs the user don t need to ent
4.    shutdownReg          ret   pclKeyWriteData OxFF   mapSettings   1  2   northUp    strlen  northUp        ret   pclKeyReadData 0xFF   mapSettings   1  2  buffer  READ SIZE             se          do something       end the usage of PCL    pclDeinitLibrary       Steps to proceed     e Use the PCL initialization function and provide the name of the application the PCL should use  The  example above uses the identifier  navigation   e Create a folder with the identifier name as used for the PCL init  Here the folder must be named   navigation    o inthis example the path must look like  Data mnt c navigation   e Copy the existing RCT and database from the folder It persistence_client_library_test provided in the  test data  o Copy RCT file  resource table cfg itz  into  Data mnt c navigation  o Copy the database  cached itz  to  Data mnt c navigation  e Now you should be able to write and read data like shown in the example above   o Note  As there is no entry for this resource in the RCT  the resource will be stored in the local  cached path   e  f another application wants to use the PCL  e g  a tuner application  just proceed step 1 to 3 using an  appropriate name  e g  tuner  as application name and folder    Mentor Graphics  Version 2 5 28    11  Guidelines and Best Practices    11 1 Shared Data Notification    In the persistence subsystem there is a mechanism to register on notification for shared data change  As there is  the possibility to misuse this feature to bypass
5.   0x00   no user                       Table 3   Interface Concept Details    3 2 1 User Number and Seat Number    The GENIVI user management has a component called profile manager which provides an API to applications to  register for user and seat information  For details about this components please refer to the GENIVI user  management concept in the GENIVI wiki  For details about the profile manager  see profile manager proof of  concept component  see http   git projects genivi org  p user management profile manager git     If there is no component available in the system providing user and seat information  the persistence client  library can still be used using one single static user number and seat number  It is recommended to use as user  number the number one  user_no 0 cannot be used as user ID because    0    is defined as System node  and for  seat the seat number zero     Note  In this case data for different users can t be identifies     Mentor Graphics  Version 2 5 8    3 3 Security  Persistence does not provide an independent security concept  Security is in the system responsibility and  persistence needs to be integrated into this concept     Nevertheless persistence provides access control to persistence data in order prevent data to be accessed by  applications not allowed to     Due to the principle of data separation it is possible to apply different Linux user rights to the different subfolders  of the applications  The application will be execute with
6.  and group data     FS Entry point                  Prefix added to the key  to access the entry locally for       wg Represent a folder in file system  where the POSIX    Access Control List rights are applied     Figure 4   File System Overview    In detail the file system hierarchy looks like the following image     e mnt c  Een d a  bw Se file system partition    20  u         configurableDefaultData    S      write through partition  mana hr   mnt backup    S H     backup partition         Green      RCT     Read only  read write     Access rights     Storage  local shared      Resource type  key file   e Blue  y     Application user data  i     Default data  f     Configurable default data  d e e Magenta      Links to shared application data  e Yellow  navigation le      Backup information   application n      Create backup        mnt wt   Don t create backup    mnt backup                                                                                              link       link             mnt c                              tuner             Data                      D      u     e     D                                             Emergency  l HW Info    Early      Secure                                     Figure 5   File System Details    Mentor Graphics  Version 2 5 7    3 2 Interface Concept    The idea is to provide a simple and easy to use API to the application developers where they are able to quickly  read and write persistent data     The interface provides 
7.  existing IPC in the system it is recommended not to use this  mechanism for such bypass     Use the existing IPC in the system for synchronization and data exchange     11 2  Key value Interface    The intention of the provided key value interface is to set get small data only  not Megabytes or even Gigabytes     The default size limit for key value data will be set to 16kByte by default     11 3  Write Through Data    Be careful about the resource that has the storage policy write through  Use this only for resources that  absolutely need to be written back to the memory device when they were changed  You need take into account  the amount of data and the write frequency the write through resource will be written     Using this policy for to many resources it can reduce the memory device lifetime dramatically  as you may  exceed the max number of program erase cycles     11 4 User and Group Rights    As written in the chapter 3 1 Data Separation the persistent data can be setup using different user and group  rights per applications  Every application is running under a different user  and so it is guaranteed that the data  can t be accessed by other applications     If this policy can t be applied within your system  persistence will work but will lose this security aspect     11 5 RCT customiD    The customID member of the resource configuration table  RCT  could be used to speed up access time to  resources within a custom storage extension plugin     If a hash table or 
8.  expectancy  Performance Slower Faster  Design Complexity More complex Less complex  Typical Use SSDs USB Flash Drives                   Table 6   Dynamic vs  static wear leveling    11 7 SQLite    As there is a demand for more complex queries  e g  for a media databases  support of other databases by the  GENIVI persistence subsystem must be considered     SQLite is a popular choice as database engine in embedded system and due to this circumstance we need to  deal with this database within GENIVI     As there are some concerns when using SQLite according flash lifetime a safe flash memory device usage must  be guaranteed     If SQLite will be used on flash memory devices we can t predict how often data will be written to the device   SQLite for example updates depending on the mode of operation the database for every access  also in read  only operation mode  because of read transactions  Due to their architecture SQLite is creating also a very high  read load on the file system also reduces the lifetime of the flash memory device     Scenarios which are reducing flash lifetime     e Writing to the same erase sector too often    o This problem is solved by wear leveling provided by the file system  File systems with both static  and dynamic wear leveling do a better job than ones with just dynamic wear leveling  Flash  devices typically have endurance between a few thousand cycles and 100 000 cycles per  sector  Wear leveling spreads the cycles uniformly across the sectors 
9.  memory device  e g  eMMC      When writing the file back to e g  eMMC the backup and checksum files are deleted  This is an indicator that the  system has been shut down correctly  If the PCL detects in a new lifecycle that there is a backup and or a  checksum file available this is an indicator that the system hasn t been shut down correctly and the files must be  checked for consistency     Note   A system failure which ends up in a restart of the system can occur at any time within a lifecycle     One critical path is during the pclFileWriteData function call  where the checksum is calculated and stored and  the backup file is created     The other critical path in the shutdown phase  where the backup file and the checksum files are deleted and the  file is transferred from the RAM to the non volatile storage device     To cover this  reset  scenarios in the best way  there are some assumptions on the pclFileOpen function  where  we try to detect such system failures and do a best guess to react properly  The following sequence diagram  explains the recovery algorithm     Mentor Graphics  Version 2 5 14    3 6 1 Recovery Algorithm    The sequence diagram below shows how the recovery mechanism works for files which are accessed via the file  API     PCL  ClientLibraryAPI       If calculated backup file checksum and  stored backup checksum does not  match  just check if stored checksum  matches the original file checksum    If yes  keep original file       keepOriginalFile 
10.  the corresponding Linux user rights     The same concept applies for the shared data  where the access restriction will be done using different Linux  group ID s     Note one or more applications can be started with the same POSIX UID     The Persistence Administration Service is responsible to setup the default file and folder structure with the  corresponding access rights  Linux user and group ID      The following table shows an example how the group management can be configured                             Data Owner group  Appt App1 Appt  App2 App2 App2  App3 App3 App3  Group  Appigp1   App  App1gp1  Appigp2   App  App1gp1  Appigp3   App  App1gp1  App2gp1   Ap2 App2gp1  App3gp1   App3 App3gp1                   Table 4   Linux Group Management    If an application needs access to the data shared by app  in the sub group1 then this application needs to be  added to the specific group app1gp1     The logical database ID is the resolution of the name of the group over the system     Note     The setup of users and running the different applications with a special is in the responsibility of the using  project     PCL and or PAS are not creating any user in the system     To enhance access control also mandatory access control  e g  SMACK  can be used     Mentor Graphics  Version 2 5 9    3 4 Resource Configuration Table    The Resource Configuration Table  RCT  contains configuration details about every persistence resource in the  system  It is one of the security aspects 
11.  which will             be called whenever a change notification          will be received  int myChangeCallback pciNotification a   notifyStruct      printf   Notification received    gt  lbid   d   resource id   s    seat   d   user   d   status   d An   notifyStruct  gt ldbid   notifyStruct  gt resource id   notifyStruct  gt seat_no     notifyStruct  gt user no           notifyStruct  gt pclKeyNotify Status       return 1        Registration works only on group or public data    ret   pclKeyRegisterNotifyOnChange  0x20   links last link2   2  user no     1  seat_no     amp myChangeCallback             Sender Side        Just write data and receiver will be notified    ret   pclKeyWriteData 0x20   links last link2   2  1  dataBuffer   strlen  dataBuffer             Mentor Graphics  Version 2 5    17    4  System Shutdown    During system runtime all modified persistence data  key value items and files  will be cached if it is not  configured as a write through  When the system is going to be shut down the modified key value items and files  will be written back from cache to the non volatile memory device     4 1 Shutdown Controlled by PCL    In the preferred shutdown scenario the write back of the data is under control of persistence client library  PCL      An application using the PCL calls the function pclinitLibrary  providing the information which shutdown  notifications the PCL shall receive  use PCL_SHUTDOWN_TYPE_FAST or  PCL_SHUTDOWN_TYPE_NORMAL for the shutdownMod
12. File to Exclude    Data mnt c It persistence_client_ library test user X seat Y media mediaDatabase db  Note     The file will be excluded from the backup for every user on each seat     3 7 Data Change Notification    The persistence client library provides a notification mechanism to inform applications if a key has been created   changed or deleted by another application  Registering to a notification is only possible on shared data     A notification mechanism on files is not provided by the PCL  it is recommended to use inotify to monitor file  system events the get the information     3 7 1 How the Notification is working    An application interested in notifications about the status change of particular key of another application can  register itself to get this information     The key API provides two functions  pcIKeyHandleRegisterNotifyOnChange and  pclKeyRegisterNotifyOnChange     Both functions have the parameter pclChangeNotifyCallback_t callback  which is a function pointer to a callback  function     This callback function will be called whenever the key under monitor changes its status  this means the key s  content will be changed or it will be created or deleted     The notification function s parameter pclNotification_s notifyStruct can be used to determine the kind of change     The used IPC mechanism between the applications is dbus     Mentor Graphics  Version 2 5 16    3 7 2 Example Code    Receiver Side        implement a notification callback function
13. Mentor Automotive    User Guide  Persistence Client Library    Version 2 5   lt 30 10 2015 gt     O 2015 Mentor Graphics Corporation  All rights reserved     Content    A sie 1  1 1 Nee 1  1 2    REVISION AIS EE 1  1 3 Abbreviations     Terminology                                                            ranma 2   2  Persistente AAA PA 3  2 1 Subsystem Subsystems aian ie a ee 3   2 1 1 Persistence Components in System Contest 4  2 1 2 Persistence Components OvervieW sisi 4  2 2  Persistence Client Library    iii 5  2 2 1 ROSPONSIDIIIES oss ana Sea tube ven en na ee dann 5  2 2 2 Miete Ee 5  2 2 3 Persistence Client Library License             sssessseesseeseesseesessnetnesstntttnttnnttnnntnntnnnnnnenn nenn nenn nenn 5  2 2 4 Persistence Client Library Project Information    5   3  Persistence Concepts nantes 6   31    Data Separatig inician ada drid 6  3 1 1 Data Types and Logical Database ID  6  3 1 2 File System Representation sie 7   3 2 Interface Concept irosit nn a dada 8  3 2 1 User Number and Seat Number    iii 8   CR DOCU oi ii E nates dr od toria 9   3 4 Resource Configuration Table    sisi 10  3 4 1 Cached and write through Resources    11   35  e nun ea em ee re ieee 12  3 5 1 eppes eege Poa bate RR se 13   3 6 Backup and Recovery Strategy issue 14  3 6 1 Recovery Ee eil 680000 ee 15  3 6 2 Exclude form Dau  CuegduEe ne ee 16   3 7    Data Change Notification  ai 16  3 7 1 How the Notification is working    16  3 7 2 Example Code ineeie aana M ns AA MM eme sr en 
14. SM acento 17   4  System A 18  4 1 Shutdown Controlled by POL iii 18   4 1 1 Example Code iii ai 19  4 2 Shutdown Controlled by the Application    ss 20    Mentor Graphics  Version 2 5    4 2 1 Example Code  een 20    5  Default Data Handling  sn nent ane 21  5 1 Reading NR EIER 21  5 2  Writing Default Dalai etae safran ch een lee ein 21  5 8 Configurable default Data    sise 21   6  Persistence Client Library API            uuuususunensnnunnnnnnnnnnnnnnnnnnnnnnnnnnnn 22  6 1 SARI Details  Het tt ead  22  62  Datatype  rca 22  6 3 Persistence  Data Versioning sicario ita 22  6 4  E Re KA e E Beeler Tt VE LEE diaria 22   7  Setup Target Environment    snnns 23  7 1 File System  Partitions sis usine ni nant sinken 23  1 2  GOMPONEMS  iii AA a 23  7 3  Persistence  d e ET 23   Sr   PLUGIN Interface crane esta ea 24  8 1 u Sle  pty Pico tr ae REO Li O tio ie bai 24  8 2       Plugin RE eta at ci ais 24  8 37  Loading  PO cuca babas 25  8 4  Initialization  Type 15245802 ee adas 25  8 5 Configuration File Format    sise 25   8 5 1 Adjusting Configuration File    sis 25   9  HowTo autres eege 26   9 1 Dep  n  dencies seen en mn ra E 26  9 1 1 Persistence Common Object usine 26  GEN ee Fehler  Textmarke nicht definiert    10  Testing and Logging    27  10 1 Running the TESSA ee A e er tant 27  10 2 Quick EE teeter annees Aa a he E EE 28   11  Guidelines and Best Practices    29  11 1 Shared Data Notification iii 29  11 2 Ke   value  InterfaCe  codi adi it 29  11 3 Write Through Dat
15. a    ee 29  11 4 User and Group Rightsz        rria 2 rn tard nati eta cit 29  11 5 ROETCUSOM Da sen a ce scans 29  11 6 Flash Lifetime Consideration sis 30    Mentor Graphics  Version 2 5    11 7 SQUAD 30    11 7 1 In memory Database Approach ss 31  11 7 2 Ramdisk tmpfs Approach ss 32  11 7 3 SQLite OS Backend  VFS                      aai aa ia aiea riii 32  11 7 4 Miscellaneous    adsl llas 32  12  Persistence Usability Rules                                                     33  12 1 Complete Usage of bebe 33  12 2 Partly EE siii a E On S D 33  12 3 Free Access to Persistence Data    se 33  WSs O A ee se 34    Mentor Graphics  Version 2 5    List of Tables  amp  Figures    Tables   Table    Revision History  2    Re ee ati tt 1  Table 2     Abbreviations  amp  Terminology                                           sise 2  Table 3   Interface Concept Details sisi 8  Table 4   Linux Group Management  9  Table 5   AP E ul 12  Table 6   Dynamic vs  static wear leveling                                        uses 30  Figures   Figure 1   System  Context incita a eee 4  Figure 2   Persistence Components Overview usines 4  Figure 3   Data  SeparatiO ET 6  Figure 4  Fil   System e EE 7  Figure  IER TEE H  Figure 6   Recovery Algorithm EE 15  Figure  7   Bue el ere EE 18  Fig  re 8   PCR el RSR MR TR Mt ana den Me trente e tas 22    Mentor Graphics  Version 2 5    1     Introduction    1 1 Purpose    The scope of this document covers interface description  building the library  co
16. a schema less key value store API as well as a file API where applications are able to  store data in files using their own data format     Versioning of persistent data will not be provided by the persistence subsystem  the application itself is  responsible to store any version information in conjunction with the data  The reason not to provide this  functionality is that only the application itself has this information  The versioning schema may differ between  various applications and application supplier  Also when an application will be updated  the version schema may  change including the data structure  this would also result in an update of the persistence client library to support  the changed versioning     The Logical database ID  Idbid  says what kind of data the access requested on  this means local  public or  shared  public or group  data     The Resource ID is the name of the requested resource  it is not needed to be a system wide unique string     The User No and Seat No will be provided by user management to identify the user and seat the data is  requested for     The table below gives an overview about the API parameters     Logical DB ID Resource ID User No Seat No     visibility   name space   location                          single multiple const char  unsigned int unsigned int  persistence persistence  client client  path   key   single Local  OxFFFF  groupID  application  multiple groupID Public  0x0   application  unsigned int node   0x00 no seat 
17. and thus keeps the  cycling within the endurance limit for a longer period  but can t guarantee that this will work for  the lifetime of the car which is minimum 10 years    e Writing to the same sector too quickly    o Here we are looking at the time between two erases of the same sector  This is related to the   previous issue  but not the same  Here again  wear leveling will help   e Reading from the file too often    o Reading from the same location too often can cause read disturbance and loss of bits  This can   be solved by having a read cache in the file system     Scenarios which are flash friendly     Mentor Graphics  Version 2 5 30    Flash memory is organized in so called erase blocks  which typically have the size of 8 or 16 MB  depending on  the memory size     If data will be written to flash memory  an erase block must be deleted first     Taking this into account data to flash memory should be written sequentially in sizes matching the erase block  size  otherwise there is some write overhead     This chapter summarizes different approaches for a save integration of SQlite into the persistence subsystem  environment  Each approach should be carefully considered before it will be used if it fits into project  requirements     11 7 1 In memory Database Approach    SQLite database is normally stores data in a single file on the non volatile memory device  But it is also possible  to store the database in RAM  This approach is able to prevent the issues with flas
18. array will be used to store data in the custom extension plugin  the customID can be used to  generate the hash value into the hash table or the index into the array offline and store this in the RCT for this  resource     If a customiID is available the PCL generates a string using the Ibid and the customID which then will be used as  path parameter for the custom plugin interface functions     This may speed up access time as there is no need to generate the hash value or the index during runtime  but  the hash table and the array must be static and can t be changed during runtime     Mentor Graphics  Version 2 5 29    11 6 Flash Lifetime Consideration    The proposed persistence solution is not a 100  bulletproof out of the box solution to prevent flash memory  device wear out     Depending on the system setup like the specific used memory device and file system     Every memory device  NAND  NOR or eMMC  is different according to the max number of program erase cycles  and the used wear leveling algorithm  static or dynamic      The system setup is specific to the project the PCL will be used in and completely independent  When using the  persistence subsystem an investigation is needed about behavior of the specific system     It s needed take into account the amount of data written  the write frequency  the max number of program erase  cycles of the chip and the used war leveling algorithm              Item Static Dynamic  Endurance Longer life expectancy   Shorter life
19. consumer has finished to  LifecycieRequestNSM_SHUTOOWNTYPE_NORMAL  1  0  prepara for shutdown   he will send a notification back to  the NSM    i  LifecycleRequestComplete     LifecydeRequestComplete 1  NsmErorStatus Ok  0        Figure 7   Lifecycle Interaction    Mentor Graphics  Version 2 5 18    4 1 1 Example Code    The shutdown controlled by persistence client library is the most convenient way for applications as the just red  to call pclinitLibrary and at the end of the lifecycle pclDeinitLibrary        register PCL for    normal shutdown    events     T    unsigned int shutdownReg   PCL SHUTDOWN TYPE NORMAL           provide a system unique application name to the PCL    pclInitLibrary     mediaplayer     shutdownReg          register app to the NSM to receive shutdown events       wait for shutdown events distributed by the NSM       shutdown event has been received  finally write data to PCL       some key value data    ret   pclKeyWriteData PCL LDBID LOCAL   currentTitleNumber   3  2   keyValueDataBuf  strlen keyValueDataBuf                some file data    size   pclFileWriteData  fd  fileDataBuf  strlen fileDataBuf           now trigger PCL to write back modified key value and file data  rval   pclLifecycleSet  PCL SHUTDOWN             now call deinit function    pclDeinitLibrary    Mentor Graphics  Version 2 5 19    4 2 Shutdown Controlled by the Application    Another scenario has been integrated to the PCL the GENIVI lifecycle management is not available for 
20. e parameter      Calling this function registers the PCL to the GENIVI Node State Manager  NSM  as a shutdown client in order  to receive shutdown notifications     Then the application itself must also register itself to the NSM to receive shutdown notifications   When a shutdown occurs the NSM will send first a shutdown notification to the Application   The application writes data for the last time of the current lifecycle to the PCL     Then the PCL receives also the shutdown notification form the NSM and writes the modified data back to the  non volatile memory device     During startup phase    During startup phase a consumer    pailnitLibeang Tuner     PCL_SHUTDOWN_ NORMAL  sod    RegisterShutdownClient NSM_SHUTDOWNTYPE_NORMAL     pelinitLibrary  which is doing the       registration to get the shutdown  Notifications for the persistence  client library itself   RegisterShutdownClientiNSM_SHUTDOWNT YPE_NORMAL   The registration order of the  consumer will be stored in the  1 NSM  pdKeyReacData LOCAL     volume     userOne  seatOne  buffer  bufSize      I  1  1 During shutdown phase i  LitecycieRequest NSM_SHUTDOWNTYPE_NORMAL  2  0      Miers the Let is going to    q  gt 71 d Manager  NSM  will send  pakKeyWriteDMBLOCAL   volume   userOne  seatOne   12   bufSize   shutdown notifications to    registered consumer    LifecycieRequestComplete 2  NsmErrorStatus_Ok  0  The order of the sent shutdown  notifications is vice versa to the  i registration on startup   I  i When a 
21. er 1  seat 1               El     H    ret   pclKeyReadData  0xFF   language country code   1  1  buffer  READ SIZI    pk     Logical DB ID  0x84 with user 2 and seat 1   A    gt  shared user value accessible by A GROUP  user 2 and seat 1            gt  used for shared testing   ef          ret   pclKeyWriteData 0x84   links last link2   2  1   unsigned char    Test  notify shared data   strlen  Test notify shared data        pclDeinitLibrary       Then provided unit tests located under tests  persistence_client_library_test c is also a good code reference how  to use the API     Mentor Graphics  Version 2 5 13    3 6 Backup and Recovery Strategy    A backup and recovery strategy for data accessed by the file API is available in the Persistence Client Library     There is no backup and recovery strategy for data accessed by the key value API in the Persistence Client  Library  The database implemented in the Persistence Common Object must provide this functionality     A backup copy of the file including the generation of a checksum file is created when the file is modified the first  time  Copy on write   There is no backup created if the file will only be read     The checksum file is used during recovery to ensure that the backup copy is not corrupt     A backup copy is created only once during the lifecycle and is removed during the shutdown phase when an  application has successfully written the data using pclFileWriteData and calls writing the file back to non volatile 
22. er the  address again      To cover this requirement there is the possibility to setup a resource as a write through resource     Be careful with the write through resources  as described above excessive usage may harm the flash memory  devices     Mentor Graphics  Version 2 5 11    3 5 API usage    Interface prototype    int pcIKeyWriteData   unsigned int Idbid   const char  resource id   unsigned int user_no   unsigned char seat_no     unsigned char  buf     unsigned long size                          Persistence Client API Persistence lib  from client resource data base  input  Comment  table   OxFF    pos last pos   0  0   Data mnt c Appl 1 cached itz    Node pos last pos  local value  last  position   0    language cur_lang   3  0   Data mnt wt Shared Public wt itz    User 3 language cur_lang  public shared user value   current_language   OxFF    status op_doc   3  2   Data mnt c Appl 1 cached itz    User 3 Seat 2 status op_doc  local user seat value   open_document   20    address home_addr  4  0   Data mnt    User 4 address home_addr  group shared user value  c Shared Group 20 cached itz    home address   OxFF    pos last sat   0 0   Data mnt wt Appl 1 wt itz    Node pos last satellites  local value  last  satellites   0x84    links last link   2  0   Data mnt wt Appl 2 wt itz    84 User 2 links last link  local value  last link   OxFF   media mediaDB db   1  1   Data mnt c Appl 1     User 1 Seat 1 mediaDb db  local file                      Table 5   API usage example
23. ew reasons why GENIVI is developing this area  as opposed to simply saying that  many Linux  storage solutions exist  and leaving it at that  First of all  the goal of standardization of data storage on the  GENIVI platform is so that applications all use a common service for storing data  Secondly the automotive  domain introduces some unique requirements     e Strong robustness and reliability requirements from automotive OEMs for the storage of critical data    e Unreliable electrical environment  with possible power drop out  engine cranking  blown fuses etc     e Lifetime requirements of automotive vehicle  in the order of 10 20 years  balanced against the lifetime of  flash memory with its limited number of write  and to some extent read  cycles     2 2 1 Responsibilities    The responsibility of the Persistence Client library is     Shared data management   Persistent data may be accessed by different applications   Local data management   Persistent data is accessible only by the  owned  application   Specific data management   Concept can be extended for custom solution for early  secure  factory settings a s o storages    databases   Local and shared file management   e Data can be stored in a file  The file can be accessed by different applications or only the  owned   application    2 2 2 Dependencies    In order to provide more flexibility the storage mechanism for persistence data has been moved into a separate  component called Persistence Common Object     Per
24. ged from different databases into one database  o The incubated application accesses the local application data environment whereby the key are  preceded by a prefix corresponding to the merged logical database identifier   e Group shared data  o Shared by a group of applications  o Every member of the group has read access  o There is only ONE master who has write access  e Public shared data  o Shared by any application within the system  o Every application within the system has read access  o There is only ONE master who has write access    The so called logical database ID will be used to request access to the different data types     e Local data   o Use value OxFF  e Shared data   o Use value range 0x01  0x7F for different groups  e Public shared data   o Value 0x00    For local and public data there a also defines in the file persistence_client_library h available    e define PCL_LDBID_LOCAL OxFF     lt  value to access application local managed data     e define PCL_LDBID_PUBLIC 0x00     lt  value to access public shared data  data is under  control by the resource configuration in system       Mentor Graphics  Version 2 5 6    3 1 2 File System Representation    The data will be stored in different databases and files distributed over the file system     The following image shows how the file folder hierarchy should look like  From the file system entry point there  are first in the hierarchy folders containing the different type of data  local  local merged  public
25. h memory device as the  database will be run in RAM     Proposed sequence     e Open a database in memory  e Create a plain database table matching the table that is available in the file database  e Attach the file based database to the in memory database  e g   ATTACH  persistence db  AS pers    e Import data from file based database into in memory database  e g   INSERT into DataTable SELECT    from pers DataT able    e Add a trigger to the database schema for delete insert update  e Work on the in memory database  e g   UPDATE DataTable SET VALUE          e Write back the deleted insert updated data according the set triggers when the system is going down  e Close database  Pro     e Only deleted insert updated items will be written back  Cons     e Anin memory database is a private database  only one connection is possible  not possible to share  data    e  s the attached database is bigger than the memory or bigger than the reserved memory spot  some  additional management needs to be done  attaching only parts of the file database         e Nota transparent solution for legacy or OSS applications as the proposed sequence above must be  used    e ACID compliant only for the lifecycle in case of power loss    Mentor Graphics  Version 2 5 31    11 7 2 Ramdisk tmpfs Approach    For this approach the SQLite database file will be copied into ramdisk or tmpfs  As the database will be run in the  RAM there are no flash memory issues     Proposed sequence     e Copy database in
26. ibrary needs a file system partition to store the data  The partition needed to be mounted to   Data mnt c and  Data mnt wt     It is requested to have one persistence partition which will be mounted to the two folders stated above  one  partition will be mounted to two different mointpoint      It is also recommended to create a separate partition for backup data which must be mounted to  Data mnt   backup    Example   sudo mount  t fsType  dev sdx  Data mnt wt    sudo mount  t fsType  dev sdx  Data mnt c    7 2 Components needed by Persistence Subsystem    Some other GENIVI components are required to be installed on the system     e GENIVI Lifecycle components are available on the system  o  http   projects genivi org node state manager   o  http   projects genivi org node startup controller   o Make sure Node State Manager is running    Start  node state manager   e Persistence Administration Service is available in the system and running  o The GENIVI Persistence Administration Service is available here       http   git projects genivi org  p persistence persistence administrator git  e Persistence Common Object is available in the system  o The GENIVI Persistence Common Object is available here       http   git projects genivi org  p persistence persistence common object git  o use the key value store backend     run configure step with     with_database key value store   e Persistence partitions has been created and mounted and test data has been setup  o If data partit
27. implemented in the client library as it allows detailed configuration of a  resource     The RCT will be created by the Persistence Administration Service  PAS  during system update process using  JASON XML files  For more details about this please refer to the PAS documentation     The PCL user normally doesn t care about the RCT  but should keep in mind that this configuration database  exists and a resources behavior can be configured in the way described below     System integrators are normally responsible for creating the resource configuration   The configuration details are     e Storage policy  o Is the resource a cached or a write through resource  e Storage type  o Is the resource a local  shared or custom  e Resource type  o Is the resource key value or a file  e Permission  o Is this resource accessible read only or a read write  e Max storage size  o Responsible application  e Name of the responsible application  master application    o Only this application is allowed to change the value of the resource   e Custom name  o The custom name of this resource is a custom resource  e Then custom id  o An ID  This could also be used as an index into and array if a custom array or has map will be  used to store the resource    When an application tries to read write a resource the RCT is always invoked as it is described in the following  sequence     e Application wants to write data  o Query the resource table  o RCT contains information about the requested resource 
28. ion and data is not available  see 7 1  o Use the Persistence Administrator Service to setup the test data     make sure node state manager and pers_admin_svc are running    Now install the test data   e  persadmin_tool install  path_to_test_data PAS_data tar gz     The test data is provided by the PCL     test data PAS_data tar gz   e Make sure dit daemon is running  e Make sure D Bus system bus is available    7 3 Persistence Plugins    Make sure persistence plugin configuration file is setup correctly and installed into the intended folder  For more  details see next chapter 8 Plugin Interface    Mentor Graphics  Version 2 5 23    8  Plugin Interface    In order to keep the used storage back end flexible Persistence Client Library provides a plugin interface  With  this interface it is possible to easily integrate storage different     The plugin  shared object  will be loaded according the information in the configuration file  either it will be  loaded when the function pellnitLibrary will be called or when a plugin function will be called the first time  The  loading behavior is configured in the configuration file     The configuration file providing the information about the available plugins is expected to be in the following  default location    etc pclCustomLibConfigFile cfg      The default location and filename can be changed using the environment variable   PERS_CLIENT_LIB_CUSTOM_LOAD      For each key value resource a different custom storage solution can be ap
29. lue API   To modify configurable default key value data use the function pcIKeyHandleWriteData and pclKeyWriteData     If configurable default data for files needed to be modified use the pclFileWriteData function  first open the file  using the pclFileOpen function      In order to modify configurable default data use the define DCL USER DEFAULTDATA for the user no  parameter  Configurable default data is user and seat independent     Mentor Graphics  Version 2 5 21    6  Persistence Client Library API    6 1 API Details    The Persistence Client Library provides a C API for applications allowing loading and storing persistent data   The API is divided into two main parts  the key value API and the file API     Application    Read Write Keys Read Write Files    I    1      1 A  Read Write Ke  d 9 V Read Write Files      Subdomain         Persistence         Subdomain    Persistence Management    Eee a       Figure 8   PCL API    The Persistence Client Library offers two sorts of functions for the Key value and file interface to read and write  data  handle functions and non handle functions  For the handle functions first the open function   pclKeyHandleOpen  needs to be called  and then using the handle the corresponding read write  e g   pclKeyHandleReadData  function can be called     If requested to just read or write only once to a resource non handle functions are also available  e g   pclKeyReadData      A file will not be identified directly by a file system path whe
30. me  enabling    write Ahead Logging    in SQLite  should be considered     Write Ahead Logging     The default method by which SQLite implements atomic commit and rollback is a rollback journal  Beginning with  version 3 7 0  a new  Write Ahead Log  option  hereafter referred to as  WAL   is available     For more details please refer to the following page  https   www sqlite org wal html    Mentor Graphics  Version 2 5 32    12  Persistence Usability Rules    GENIVI proposed 3 level rules about the usability of the Persistence Client Library     12 1 Complete Usage of the PCL    Only file API functions provided by the PCL will be used to access persistent data  except pclFileCreatePath and  pclFileReleasePath functions     Backup creation and recovery is within the responsibility of the PCL     12 2 Partly Usage    Only the two API functions will be used to access persistent data   The function pclFileCreatPath will be used to get a path to a file where the persistent data will be stored     The application can access the file in every way the application wants  Either the application can use POSIX file  access functions if the data will be written directly to a file or use SQL functions to open and access a database  file     Backup creation and recovery is within the responsibility of the PCL     12 3 Free Access to Persistence Data    An application has free access to the specific structure defined in the persistence concept  It is allowed to  directly access the persiste
31. mponent testing and debugging     The document covers also some basic persistence concepts used to implement Persistence Client Library     1 2 Revision History                                                          Revision   Change Date  v1 0 Setup of Document 22 10 2013  V1 1 Update after review 06 11 2013  v1 2 Update after review  split content into two different documents  a user 25 11 2013  manual and a architecture manual   v1 3 Added section default data handling 11 12  2013  V 1 4 Added section roadmap of file API 14 01 2014  V1 5 Added section best practices 17 01 2014  V 1 6 Added section to explain notification use  added configure switch   enable    29 01 2014  pasinterface  V1 7 Added section Fehler  Verweisquelle konnte nicht gefunden werden  01 04 2014   Backup and recovery  and Fehler  Verweisquelle konnte nicht  gefunden werden   Caching Strategy   V 1 8 Added section Fehler  Verweisquelle konnte nicht gefunden werden  13 05 2014  Source Code Documentation  V1 9 Added section Fehler  Verweisquelle konnte nicht gefunden werden  26 06 2014  Backup Location and  updated section Fehler  Verweisquelle konnte nicht gefunden werden   Plugin interface  changed configuration file format   V 2 0 Added section Fehler  Verweisquelle konnte nicht gefunden werden  08 08 2014  V2 1 Updated section Fehler  Verweisquelle konnte nicht gefunden werden  11 09 2014  How to build and Fehler  Verweisquelle konnte nicht gefunden werden   Testing and Debugging  V 2 2 Added sectio
32. n Fehler  Verweisquelle konnte nicht gefunden werden  09 12 2014  System Shutdown and added section Fehler  Verweisquelle konnte nicht  gefunden werden  Configurable default data  V2 3 Added section 1 7 Application verification 21 02 2015  V 2 4 Updated section    2  System Shutdown    and    10 1 1 Plugin Types     27 03 2015  Added chapter    Fehler  Verweisquelle konnte nicht gefunden werden   Resource Configuration Table     V2 5 Complete rework and switched to new template 30 10 2015       Table 1   Revision History    Mentor Graphics  Version 2 5       1 3 Abbreviations  amp  Terminology    Abbreviation       ACID    Description        Atomicity  Consistency  Isolation  Durability  see  https   en wikipedia org wiki ACID                                                                   API Application Programming Interface   DLT Diagnostic Log and Trace   eMMC embedded Multimedia Card   GENIVI The GENIVI Alliance is a non profit consortium whose  goal is to establish a globally competitive  Linux based  operating system  middleware and platform for the  automotive in vehicle infotainment  IVI  industry    IPC Inter Process Communication   Idbid Logical Database Identifier   Linux VFS Linux Virtual File System  Abstraction layer on top of a  more concrete file system    NAND flash memory  a type of non volatile computer memory   NOR NOR Flash Memory  a type of non volatile computer  memory   NSM Node State Manager  GENIVI lifecycle Component    PAS Persistence Administra
33. n keyValueDataBuf           some file data    size   pclFileWriteData  fd  fileDataBuf  strlen fileDataBuf        Mentor Graphics  Version 2 5 20    5  Default Data Handling    Persistence has two different types of default data  the factory default data and the configurable default data     5 1 Reading Default Data    The PCL has no special interface to read and write default data   If an application wants to read the data of a resource the PCL is doing this in the following way     e first try read the data for the resource  if available return this data   e if no data is available  check if configurable default data available and return this data   e if no configurable default data is available  check if there is factory default data is available  and return  this data    e If still no data is available return an error     5 2 Writing Default Data    Factory default data can t be changed  but configurable default data can be adjusted     Setting data back to factory default data or to configurable data can t be done using the PCL API  instead the  Persistence Administration Service API needs to be used     For more details see PAS API documentation  especially the following function     long persAdminDataRestore  PersASSelectionType e type        PersASDefaultSource e defaultSource   const char  applicationlID     unsigned int user no        unsigned int seat no      5 3 Configurable default Data    Configurable default data can be modified using the PCL file and or key va
34. n using for example the pclFileOpen function  The  logical database ID  the resource ID  the user ID and the seat ID will be translated into a path and a filename  within the file system hierarchy  The same is valid for a resource stored via the key value API  The final resource  name in the database is a concatenation of the resourcelD  the user ID and the seatlD     6 2 Datatype    The PCL does not support storing of any complex data structures or any other data types than unsigned char        It was a design decision not to support data type families like e g  glib or Qt data types or other complex custom  data structures as they all can be stored using the unsigned char  data type  Serialization deserialization or  casting must be done by the using application     6 3 Persistence Data Versioning    Persistence Client Library does not support any versioning or migration of data  It is in the responsibility of the  using application to keep track of the data versioning and migration  An application should store version  information together with the data by itself     6 4 Doxygen documentation    For details of the file API  please refer to the doxygen documentation   The doxygen package must be installed on the system     Run  doxygen doc pcl_doxyfile  in the persistence client library folder and the html documentation will be  generated in the doc folder     Mentor Graphics  Version 2 5 22    7  Setup Target Environment    7 1 File System Partition    Persistence Client L
35. nce Common Object  lippers_common so       http   git projects genivi org  p persistence persistence common object git    Add     with_database key value store  to the configure step   o dbus   o check    unit test framework for C    needed when configured with    enable tests  to run unit tests    e Tools  o  autotools  o libtool    9 1 1 Persistence Common Object    The Persistence Common Object  libpers_common so  is the default plugin to read write persistent data  managed by the key value API     Persistence Common Object uses Itzam C as default database  which is currently not supported anymore  It is  recommended to use the key value store backend instead     Use     with_database key value store  for the configure step     9 2 Building the Library    The Persistence Client Lib component uses automake to build the library   Execute the following steps in order to build the component     e  autoreconf vi  e configure  with the following options  o    enable tests    to enable the build of the tests  o   enable pasinterface    enable the PAS interface  disabled by default   o   enable appcheck    to enable application check  e make  e optional   o sudo make install    Mentor Graphics  Version 2 5 26    10  Testing and Logging    The test framework    check    has been used to write unit tests which will be run automatically when the test binary  will be started  At the end a test report will be printed to the console showing first a summary about number of  tests that ha
36. nce file folder structure in the way the application wants  The complete management  of backup and recovery is in responsibility of the application     Mentor Graphics  Version 2 5 33    13  Appendix    Appendix E EE Nee 34    Appendix 1  Related Documents             Document Description Version Link   Persistence Client Component 2 3 1 https   collab genivi org wiki download attachments 12472  Library Component Specification 69 GENIVI_Component_Specification_PersClientLibrary   Specification 2 3 1 docx   Persistence Architecture 1 8 http   docs projects genivi org persistence client   Architecture Documentation library 1 0 GENIVI_Persistence_ArchitectureDocumentati  Documentation on pdf   Persistence Common   User Manual 2 2 http   docs projects genivi org persistence client    Object Library User library 1 0 GENIVI_Persistence_Common_Object_UserM  Manual anual pdf                      Appendix 1   Related Documents    Mentor Graphics  Version 2 5 34    
37. on service for storing data  Secondly the  automotive domain introduces some unique requirements     e Strong robustness and reliability requirements from automotive OEMs for storing of critical data    e Unreliable electrical environment  with possible power drop out  engine cranking  blown fuses etc     e Lifetime requirements of automotive vehicle  in the order of 10 20 years  balanced against the lifetime of  flash memory with its limited number of write  and to some extent read  cycles    The overall idea is to define a standardized common interface to persistent storage  under which system builders  will still have significant flexibility in choosing the actual storage implementation that makes sense for each  system  The persistence client library also provides an abstraction that avoids clients having to handle specific  paths in the VFS and similar implementation details     Mentor Graphics  Version 2 5 3    2 1 1 Persistence Components in System Context    The image below shows the persistence components in context with other components     System Infrastructure                       B   fectoryDefaultDats json  E   instaliRules json re   Ez   Persistence Configuration    Ez   resourosConfiguration json IM Pesistence components   El   Application EI Liteoyde Components   E    Node Resource Manager M Use  Management and Personalization  EJ   NodeHesithMonitor  I software management     NodeStartupController   Ej   NodeStsteManager Ke           PersistenceAdministrati
38. onAcoessL ibrary    PersistenoeAdminServioe A    PersistenceClientLibrary   en used to create RTC  is i sourc a   resource config table   a databases      library          ClientLibAPI   key value   file System Infrastructu   PersistenceAdministratio              H    function call        daemon    System Infrastructure    PersistenceAdmin Service      library    System Infrastructure    PersistenceClientLibrary                                                 used to create app folder  structure  including update            daemon    System Infrastructure    PersistenceHealthMonitor       Figure 1   System Context    2 1 2 Persistence Components Overview    The image below shows all persistence components and their relation       Persistence Administration Access Library       Persistence Administration Service      PersAdminService PersAdminService  ClientLibAPI   key value ClientLibAP   file e si    NSM Consumer    persPluginAPI    POSIX file UO    persC2mRCT persComP bAccess    Legend    E Executable   IT Library   PBB untic intertsces  Il Extension Interfaces       Figure 2   Persistence Components Overview    Mentor Graphics  Version 2 5 4       2 2 Persistence Client Library    GENIVI s Persistence Client Library  known as PCL  is responsible for handling persistent data  including all data  read and modified during a lifetime of an infotainment system   Persistent data  is data stored in a non volatile  storage such as a hard disk drive or FLASH memory    There are a f
39. plied using the Persistence Resource  Configuration Table  RCT   The attribute storage type needs to be set to  custom  and the name of the plugin  shared object needs to be added to the attribute custom name     The Persistence Common Object will be used as default storage plugin     8 1 Plugin API    The plugin API for custom storage back ends is describe in the header    persistence_client_custom h     The  plugin API for the default storage  Persistence Common Object  is described in the header     persComDbAccess h    of Persistence Common Object     8 2 Plugin Types    There are predefined custom plugin types available     e default  o default plugin used for general storing if no custom type is set in the RCT  o Persistence Common Object must be used for this plugin  libpers_common so     e early  o plugin for loading early data  e secure    o plugin to implement encrypting  e emergency  o plugin for emergency    e hwinfo  o plugin to query hardware information  e customi    o used to implement something different then the predefines  e Custom   o used to implement something different then the predefines    e custom3  o used to implement something different then the predefines  e default    o used for default storage mechanism implementation     As default plugin the Persistence Common Object  libperscommon  API must be implemented by this plugin     Mentor Graphics  Version 2 5 24    8 3 Loading Type    When will the plugin be loaded   e init  o plugin will be loaded 
40. rsistence client library test c 236 P GetDataHandle test GetDataHandle 0   Passed       persistence client library test c 652 P DataHandle test DataHandle 0  Passed       persistence client library test c 727 P DataHandleOpen test DataHandleOpen 0   Passed    persistence client library test c 578 P DataFile test DataFile 0  Passed             persistence client library test c 604 P DataFileRecovery test DataFileRecovery   0  Passed    persistence client library test c 794 P Cursor test Cursor 0  Passed          persistence client library test c 864 P ReadDefault test ReadDefault 0  Passed                      persistence client library test c 886 P ReadConfDefault test ReadConfDefault 0  Passed    Mentor Graphics  Version 2 5 27    The output above may vary as the test cases will be adopted or extended     10 2 Quickstart    Normally the default file and folder structure including the default data as well as the RCT and the database will  be setup by the Persistence Administration Service     If a user wants to extend the provided test application or create an own test application it can be done without  using the PAS to extend the file and folder structure     An example could be a navigation application likes to use the PCL it can be done in the following way     Example Code   int ret   0     unsigned char buffer READ SIZE     0            unsigned int shutdownReg   PCL SHUTDOWN TYPE FAST   PCL SHUTDOWN TYPE NORMAL              initialize PCL    pclInitlLibrary  navigation
41. sistence Administration Service also uses this component to access persistent data     2 2 3 Persistence Client Library License    The Source Code Form is subject to the terms of the Mozilla Public License  v  2 0  If a copy of the MPL was not  distributed with this file     You can obtain one at http   mozilla org MPL 2 0      2 2 4 Persistence Client Library Project Information  The Persistence Client Library is a GENIVI open source project and will be hosted by GENIVI     Persistence Client Library project page   e http   projects genivi org persistence client library  Persistence Client Library repository     e  http   git projects genivi org  p persistence persistence client library git    Mentor Graphics  Version 2 5 5    3  Persistence Concepts    3 1 Data Separation    Persistence data of each application will be located in a different database  Persistence data is also separated  into different types of data     deployment Data Separation 7          Public Data            uid 28      Application 2    li lication  mme ee   device     device   devices   device    Se Key   Value    File   Folders Key   Value File   Folders   Key   Val Fil s                                        Figure 3   Data Separation    3 1 1 Data Types and Logical Database ID    e Local data  o Access is limited to the application itself  e Local merged data  o Data from different applications that have been merged from different processes into only one  single process  o The key value data is mer
42. some  reasons  The application using the PCL calls the function pelInitLibrary with the  PCL_SHUTDOWN_TYPE_NONE for the shutdownMode parameter     Now the PCL did not register itself as a shutdown client to the NSM and did not get any shutdown notification     The application has the full control when to write back modified persistent data to the non volatile memory  device  To write back the data the application uses the function pelLifecycleSet passing PCL_SHUTDOWN as  shutdown parameter  The PCL now write back the modified data  and blocks any further write to persistence     If a cancel shutdown  or restart  will be done  persistence can be unblocked using pclLifecycleSet passing  PCL_SHUTDOWN_CANEL  Reading Writing data from to persistence is now possible again     Attention     In order to prevent the misuse of this shutdown scenario the call of pelLifecycleSet with  PCL_SHUTDOWN_CANEL is limited to 3 times per lifecycle     4 2 1 Example Code       register PCL not to get any shutdown notifications          unsigned int shutdownReg   PCL SHUTDOWN_TYPE NONE              provide a system unique application name to the PCL    pclInitLibrary     mediaplayer     shutdownReg          register app to the NSM to receive shutdown events       wait for shutdown events distributed by the NSM       shutdown event has been received  finally write data to PCL       some key value data          ret   pclKeyWriteData PCL LDBID LOCAL   currentTitleNumber   3  2   keyValueDataBuf  strle
43. tion Service   RCT Resource Configuration Table   PCL Persistence Client Library   SSD Solid state drive   PCL Persistence Client Library   SSD Solid state drive   PCL Persistence Client Library   PoC Proof of Concept   PCO Persistence Common Object  http   git projects genivi org  p persistence persistence   common object git   Lbid Logical Database Identifier          Table 2   Abbreviations  amp  Terminology    Mentor Graphics  Version 2 5       2  Persistence    2 1 Persistence Subsystem    The Persistence subsystem is responsible for handling persistent data  Persistent data is data that needs to be  stored on a head unit between restarts  it includes all data read and modified during the lifetime of an  infotainment system  Persistent data is stored in a non volatile storage such as a hard disk drive or FLASH  memory     GENIVI defines the structure for the persistence management to meet standardization of GENIVI compliant  platforms and some unique requirements introduced by the automotive domain     The Persistence Management consists of the following components     Persistence Client Library  Persistence Administration Service  Persistence Common Object  Persistence Health Monitor    There are a few reasons why GENIVI is developing this area  as opposed to simply saying that  many Linux  storage solutions exist  and leaving it at that  First of all the overall goal is standardization of GENIVI compliant  platforms so that applications running on GENIVI all use a comm
44. to a ramdisk or tmpfs  e Work on the database  e Copy the database back when the system is going to shutdown    Pro   e Complete transparent for the application  Cons     e Need enough memory to copy the complete database into ramdisk tmpfs  also keep in mind there is the  page cache where database pages will be kept    e  f there is not enough memory available  then the concept will not work    e  f only one entry has been deleted inserted updated during the lifecycle  the complete database needed  to be copied back   e Could case shutdown delay    e Transaction log needs also to be in ramdisk tmpfs  ACID compliant only for the lifecycle in case of power  loss    11 7 3 SQLite OS Backend  VFS      The OS Interface   also called the  VFS    is what makes SQLite portable across operating systems     Whenever any of the other modules in SQLite needs to communicate with the operating system  they invoke  methods in the VFS     The VFS then invokes the operating specific code needed to satisfy the request  Hence  porting SQLite to a new  operating system is simply a matter of writing a new OS interface layer or  VFS       This could be used to implement a VFS that is doing the data caching  see  http   sqlite org vfs html    Pro   e Access to the underlying file system is completely under the control of the VFS backend implementation  Cons     e Probably the a complex solution to implement    11 7 4 Miscellaneous    As data should be written sequentially to increase memory lifeti
45. ve been executed and how many tests have been passed or failed     After the summary a test report will be generated showing the status of each test   When a bug will be fixed a test will be written to verify the problem has been solved   DTL  Diagnostic  Log and Trace  will be used by the Persistence Client Library to send status and error     For details about DLT  please refer to the GENIVI DLT project page  http   projects genivi org diagnostic log   trace       10 1 Running the Tests    There are unit tests available for the persistency client library component available     The unit tests are used to verify that the component is working correctly and exclude any regressions  Please  refer always to the source code to see the available tests     Run tests   e run persistency unit test    persistence_client_library_test   Expected results   The expected result is to have 0 failures and O errors  see example output below       persistence client library test       Running suite s   Persistency client library       100   Checks  13  Failures  0  Errors  0       persistence client library test c 141 P GetData test GetData 0  Passed       persistence client library test c 357 P SetData test SetData 0  Passed       persistence client library test c 400 P SetDataNoPRCT test SetDataNoPRCT 0   Passed       persistence client library test c 434 P GetDataSize test GetDataSize 0  Passed       persistence client library test c 478 P DeleteData test DeleteData 0  Passed             pe
46. when the pellnitLibrary function will be called  e od    o on demand loading  the plugin will be loaded when a function of the plugin will be called the first  time     8 4 Initialization Type    Specify the init function which will be called     e sync  o use the synchronous init type  e async    o use the asynchronous init type    8 5 Configuration File Format    The format of the plugin configuration file is the following      lt predefined type gt  lt blank gt  lt path to plugin gt  lt blank gt  lt loading type gt  lt blank gt  lt init type gt     Example     hwinfo  usr local lib libhwinfoperscustom so init async          secure  lib libsecureperscustom so od async  custom3  usr local lib libcustom3perscustom so od sync    emergency  usr local lib libemergencyperscustom so init sync    8 5 1 Adjusting Configuration File     The configuration file will be generated using autotools with the correct library path     Nevertheless this configuration file located in config pclCustomLibConfigFile cfg severs as an example only and  needs to be adjusted according to the projects environment and needs including the availability of the plugins in  the system     Mentor Graphics  Version 2 5 25    9  How To Build    This chapter provides all the information needed to build the component and run the test cases     9 1 Dependencies    The client library has the following dependencies    e Components   o  automotive dit      http   projects genivi org diagnostic log trace    o Persiste
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Document  ことにより、 次のように点灯順序が切り替わります。 四一雫今今  Modelo T - Club Cierzo  Aronde - DEPANOTO - Pièces et accessoires pour automobiles  取扱説明書 [F-08C]  AMAX panel 2000 / AMAX panel 2000 EN    futro s550-2    Epson XP-310 Start Here Guide    Copyright © All rights reserved. 
   Failed to retrieve file