Package Manager API

1.0 References

[1] Software Architecture Document, Version 1.1 Revision 1.4, LiMo Foundation, 11 September 2007

2.0 Overview

2.1 PM Plug-in

The package manager (PM) is a standalone, command line LiMo application/process. It is for:

  1. install/update application
  2. uninstall application
  3. move application between internal memory and external storage

PM_Arch.png

Figure 1: Package Manager Architecture

PM interacts with plug-ins to accomplish tasks. Figure 1 shows a high level architecture of PM.

  1. Each PM plug-in instance is a separate linux shared object.
  2. This object implements one or more functions such as PM_PreInstall, PM_PostInstall, etc.
  3. This object file path is listed in plugin.conf.
  4. PM loads all plug-ins listed in plugin.conf upon startup, and unloads them on exit.
  5. When PM is going to use a plug-in function, for instance, PM_PreInstall, PM tries to invoke PM_PreInstall in all plug-ins if found.
  6. PM invokes the plug-ins one by one. If one plug-in reports an error(i.e. returns a non-zero value), the installation will fail.
  7. If an error occurs, PM_RuntimeInfo::rollback is set to non-zero, and all successful plug-in functions will be called again. A Plug-in should always check this if value when called.

2.2 PM Workflow

Figure 2 shows how to invoke plug-ins.

PM_PluginInvoke.png

Figure 2: PM Plug-in Invocation Workflow

Figure 3 shows the workflow of PM.

PM_Workflow.png

Figure 3: PM Workflow

2.3 Plug-in Invocation Order and Plugin.conf

When PM starts, it loads all plug-ins and calls PM_PluginInit on all plug-ins if present. Before PM exits, it call PM_PluginExit on all plug-ins. Each plug-in can publish a startup event and an end event through these two interfaces, and in PM_PluginInit, it can create a thread to check PM_RuntimeInfo::progress and publish progress event accordingly.
Plugin.conf lists the locations of plug-ins for each function. PM invokes the plug-ins in the same order as they listed in this file. If one of the plug-in fails, compensatory function is called on the plug-ins that has been invoked for rollback. The compensatory order is first invoked, last compensated.

See plugin.conf, virusscan.c, mainmenu.c, scripting.c for code samples.

3.0 Industry Standard

None

4.0 External API Documents

None

5.0 Plug-in Extension Point Interface

None

6.0 Other Interfaces

None

7.0 Other Notes

None
Generated on Mon Mar 31 01:01:00 2008 by  doxygen 1.5.4