Changes

Jump to navigation Jump to search
Line 41: Line 41:  
== Implementation ==
 
== Implementation ==
   −
=== Premises ===
+
=== Overview ===
    
The implementation is following these premises:
 
The implementation is following these premises:
Line 47: Line 47:  
* Being targeted only to XO laptops (assuming that other platforms are more powerful, thus the standard PackageKit backend can be used);
 
* Being targeted only to XO laptops (assuming that other platforms are more powerful, thus the standard PackageKit backend can be used);
 
* Keep less work on the XO side and more work on the server side to make the installation process on a client's side as fast and reliable as possible;
 
* Keep less work on the XO side and more work on the server side to make the installation process on a client's side as fast and reliable as possible;
* Implement only priority functionality, and provide more complex features as required, e.g., the current implementation doesn't support updating already installed packages. Leave that to hard (and rare, e.g., yearly) full system updates (re-flashes or calling olpc-update) and incremental regular updates (sugar-client).
+
* Implement only priority functionality, such as, install new packages and update installed packages that are presolved;
 +
* Implementation is intended to cover only one-cycle post-deployment system upgrade, i.e., relatively lightweight ones; heavy update, e.g., from one OS release to another one should happen using different methods.
   −
=== Overview ===
+
The key implementation points are the following:
    
* Clients keep a list of packages installed by the back-end;
 
* Clients keep a list of packages installed by the back-end;
Line 55: Line 56:  
* If not, it downloads a file from a known HTTP location with the requested package's name;
 
* If not, it downloads a file from a known HTTP location with the requested package's name;
 
* Downloaded file contains the RPM url for the requested package and a list of package-name/url pairs for all dependencies (starting from some known point);
 
* Downloaded file contains the RPM url for the requested package and a list of package-name/url pairs for all dependencies (starting from some known point);
* All missing packages will be downloaded and installed by directly calling {{Code|rpm -i}};
+
* All missing packages will be downloaded and installed by directly calling {{Code|rpm -i}}.
* Installed packages list will be updated correspondingly.
+
 
 +
=== Repositories ===
 +
 
 +
Current implementation is designed to work in close cooperation with the [[Sugar Network]] installing dependencies required by Sugar Activities. To make it possible, Sugar Network supports a [http://network.sugarlabs.org/hub/?projects&packages list of metadata entries] for all required packages on major GNU/Linux distributions (to support not only XO laptops). Each activity, which requires dependencies, should mention proper metadata entry names in the [[Sugar_Network/Recipe_Specification#requires|activity.info]] file. Client side startup code will process this dependency list and ask PackageKit to install packages via packagekit-presolve-backend.
 +
 
 +
While working, packagekit-presolve-backend will use public [[Platform_Team/Sugar_Network/API|Sugar Network API]] (look for development API server for recently implemented functionality). The regular operations called from the API server are the following:
 +
 
 +
<div id="GET_packages"></div>
   −
== Repositories ==
+
'''GET''' /packages/OLPC/''OLPC-RELEASE''/''METADATA-ENTRY-NAME''
   −
* [[Sugar Network]] [[Platform_Team/Sugar_Network/API#Support_packagekit-backend-presolve|API server]].
+
This request returns a dependency tree for particular entry from the [http://network.sugarlabs.org/hub/?projects&packages metadata list]. The result will be served in JSON notation in form of:
   −
== Sources ==
+
"''ARCH''": [{"name": "''PACKAGE''", "version": "''VERSION''", "release": "''RELEASE''", "path": "''PATH''"}]
 +
 
 +
Where {{Code|PATH}} is either relative or absolute path to the targeting rpm on the same server.
 +
 
 +
<div id="GET_packages_updates"></div>
 +
 
 +
'''GET''' /packages/OLPC/''OLPC-RELEASE''/updates
 +
 
 +
Returns JSON list of package names to fetch updates for. Sugar Network server will dynamically generate response according to HTTP {{Code|If-Modified-Since}} header value.
 +
 
 +
=== Usage ===
 +
 
 +
* Install {{Code|PackageKit-presolve}} binary package from the [[Sweets Distribution]] Factory repository;
 +
* Set {{Code|DefaultBackend<nowiki>=</nowiki>presolve}} option in {{Code|/etc/PackageKit/PackageKit.conf}} file;
 +
* On XO laptops, it might be useful to disable authentication for installing packages, compose special polkit file like [http://git.sugarlabs.org/platform/reference-xo/blobs/master/etc/polkit-1/localauthority/50-local.d/deployment.pkla /etc/polkit-1/localauthority/50-local.d/pk.pkla].
 +
 
 +
== Build from sources ==
    
Clone source repository from [http://git.sugarlabs.org/desktop Gitorious] project:
 
Clone source repository from [http://git.sugarlabs.org/desktop Gitorious] project:
    
  git clone git://git.sugarlabs.org/desktop/packagekit-backend-presolve.git
 
  git clone git://git.sugarlabs.org/desktop/packagekit-backend-presolve.git
 +
 +
Download and untar PackageKit [http://www.packagekit.org/releases/ sources] (current presolve backend was testing against PackageKit-0.6.12).
 +
 +
Prepare PackageKit sources for building presolve backend. Copy [http://git.sugarlabs.org/desktop/packagekit-backend-presolve/trees/master/backends/presolve backends/presolve] sub-directory to the corresponding directory in PackageKit sources. Patch PackageKit build scenarios to enable presolve building, e.g., [http://git.sugarlabs.org/desktop/packagekit-backend-presolve/blobs/master/build/mixin.patch].
 +
 +
Go to PackageKit source root directory and build presolve backend.
 +
 +
autoreconf
 +
./configure \
 +
    --prefix /usr \
 +
    --sysconfdir /etc \
 +
    --disable-static \
 +
    --disable-networkmanager \
 +
    --enable-qt=no \
 +
    --enable-systemd=no \
 +
    --with-security-framework=dummy \
 +
    --disable-cron \
 +
    --disable-browser-plugin \
 +
    --disable-gstreamer-plugin \
 +
    --enable-introspection=no \
 +
    --disable-local \
 +
    --disable-strict \
 +
    --disable-tests
 +
make -C backends/presolve
 +
 +
Staying in PackageKit root directory, install binaries.
 +
 +
make -C backends/presolve install
    
== Getting involved ==
 
== Getting involved ==
    
{{:Harmonic Distribution/Feedback}}
 
{{:Harmonic Distribution/Feedback}}

Navigation menu