Puritan/Configuration

From OLPC
< Puritan
Revision as of 17:42, 17 December 2008 by Mstone (talk | contribs) (→‎Caching)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Puritan's compilations are highly and easily configurable by means of small modifications to files and directories.

Choosing stages and products

Current compilations' main.py file contain a section like

 tasks = dict(
    build = [
        'bootstrap',
        ['make_chroot', 'install_pkgs', 'install_hacks'],
         'final_install',
         'produce_tree',
         'produce_jffs2',
         'produce_tar',
         'publish',
     ],
     download = ['make_chroot', 'download_pkgs'],
     run = ['run'],
 )

By adding and removing entries to this datastructure, builders may customize which compilation stages will be performed in response to a request to 'build' or to 'download' or to 'run' the compiler. (New subcommands can be added in the obvious fashion.)

Choosing package repos

Current compilations' bootstrap.py contains lines like

 smart(['channel', '-y', '--add', '8.2-fedora', 'type=rpm-md', 'baseurl=http://mock.laptop.org/repos/koji.dist-olpc3-testing/'])

which direct the smart package manager to pull packages from one of the several yum-format RPM repository located at mock.laptop.org/repos.

(The smart package manager is package- and repository-format agnostic and can process many common formats including apt-dpkg and yum-rpm.)

Choosing packages

Current compilations' package manifests are configured by means of the contents of the config/packages directory. In order to add or remove packages from the manifest, simply touch or remove the appropriately named files in this directory.

Caching

Puritan uses technologies which can be easily configured to use caches of data. Three ways to improve puritan's caching behavior include:

  • Using mock buildroot caching to conserve bandwidth when preparing buildroots.
  • Configuring smart to use an http caching proxy in the compilation's bootstrap.py file.
  • Configuring smart to pull packages from a (manually generated) local package repository (rather than from the internet), also via bootstrap.py.

NB: The most recent puritan compilation automatically caches packages it downloads in a directory named 'smart/packages' in the compilation.