Puritan/Instructions: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=== Preparation ===
To use Puritan, you need to install dependencies:
To use Puritan, you need to install dependencies:


Line 15: Line 16:
git clone git://dev.laptop.org/users/mstone/puritan ui
git clone git://dev.laptop.org/users/mstone/puritan ui
python2.5 ui/puritan/main.py # read help
python2.5 ui/puritan/main.py # read help
sudo python2.5 ui/puritan/main.py -v build ./compilation HEAD ./results
sudo python2.5 ui/puritan/main.py -v build ./compilation HEAD ./results -- -i


The '-i' option enables an interactive error-handling mode. If an error occurs:
# Note: if you encounter permission errors when running this command, you may need to:

# sudo setenforce 0 # disable selinux:
* type <tt>kwargs</tt> to learn what command failed''
# Finally, a word of warning: while _my_ uis and compilations will treat your computer nicely, other people's might not. Caveat emptor.
* type <tt>import os; os.system('/bin/bash')</tt> to get a bash shell inside the buildroot for further debugging
* type <tt>del kwargs['e']</tt> then <tt>Ctrl-D</tt> to resume the compilation
* type <tt>Ctrl-D</tt> to exit the compilation and clean up.

Note: if you encounter permission errors when running this command, you may need to:

sudo setenforce 0 # disable selinux

Note: a word of warning: while _my_ uis and compilations will treat your computer nicely, other people's might not. Caveat emptor.


Some puritan compilations now feature a 'download' operation which can be used to download all packages that the compilation will install for later (offline) use:
Some puritan compilations now feature a 'download' operation which can be used to download all packages that the compilation will install for later (offline) use:
Line 25: Line 35:
sudo python2.5 ui/puritan/main.py -v download ./compilation HEAD ./results
sudo python2.5 ui/puritan/main.py -v download ./compilation HEAD ./results


This command will generate a program in the results directory which can be used to download the packages.
and 'interactive' error-handling:

sudo python2.5 ui/puritan/main.py -v build ./compilation HEAD ./results -- -i
# when an error occurs:
# type 'kwargs' to learn what command failed
# import os; os.system('/bin/bash') to get a bash shell inside the buildroot for further debugging
# del kwargs['e'] + Ctrl-D to resume the compilation
# Ctrl-D to exit the compilation and clean up.

Revision as of 01:14, 16 December 2008

Preparation

To use Puritan, you need to install dependencies:

 # NB: mock >= 0.9.7 is needed.
 # debian:
 sudo apt-get install mock git-core
 # fedora:
 sudo yum install mock git-core
 # both
 sudo usermod -a -G mock $USER
 newgrp mock

and to check out and run a 'ui' and a 'compilation'.

 (git clone git://dev.laptop.org/users/mstone/puritan compilation; cd compilation; git branch --track 767 origin/767; git checkout 767)
 git clone git://dev.laptop.org/users/mstone/puritan ui
 python2.5 ui/puritan/main.py   # read help
 sudo python2.5 ui/puritan/main.py -v build ./compilation HEAD ./results -- -i

The '-i' option enables an interactive error-handling mode. If an error occurs:

  • type kwargs to learn what command failed
  • type import os; os.system('/bin/bash') to get a bash shell inside the buildroot for further debugging
  • type del kwargs['e'] then Ctrl-D to resume the compilation
  • type Ctrl-D to exit the compilation and clean up.

Note: if you encounter permission errors when running this command, you may need to:

 sudo setenforce 0  # disable selinux

Note: a word of warning: while _my_ uis and compilations will treat your computer nicely, other people's might not. Caveat emptor.

Some puritan compilations now feature a 'download' operation which can be used to download all packages that the compilation will install for later (offline) use:

 sudo python2.5 ui/puritan/main.py -v download ./compilation HEAD ./results 

This command will generate a program in the results directory which can be used to download the packages.