Puritan/Instructions: Difference between revisions

From OLPC
Jump to navigation Jump to search
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== Preparation ===
To use Puritan, you need to install dependencies and to check out and run a 'ui' and a 'compilation'.
To use Puritan, you need to install dependencies:


# NB: mock >= 0.9.7 is needed.
# NB: mock >= 0.9.7 is needed.
Line 6: Line 7:
# ''fedora'':
# ''fedora'':
sudo yum install mock git-core
sudo yum install mock git-core
# both
sudo usermod -a -G mock $USER
(git clone git://dev.laptop.org/users/mstone/puritan compilation; cd compilation; git checkout -b 767-$USER origin/767)
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
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 ./compilation HEAD ./results build
sudo python2.5 ui/puritan/main.py -v build ./compilation HEAD ./results -- -i


Some puritan compilations now feature both 'download' operations:


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


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


'''with the most recent compilation and ui''', you will be dropped directly into bash inside the buildroot.
sudo python2.5 -v ./compilation HEAD ./results build -- -i


* to resume the compilation, type
git clone git://dev.laptop.org/users/mstone/puritan ui

/usr/bin/python2.5 ui/puritan/main.py ./compilation HEAD ./results build
exit 0

* to quit the compilation, type

exit 1

'''with earlier compilations''' which still support interactive error-handling: [[Puritan/Instructions|instructions]]
<noinclude>
* to learn what command failed:

kwargs

* to get a bash shell inside the buildroot for further debugging

import os
os.system('/bin/bash')

* to resume the compilation after fixing an error:

del kwargs['e']
Ctrl-D

* to exit the compilation and clean up.

Ctrl-D
</noinclude>

=== Other Notes ===

; Fedora
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.

; Ubuntu

mock_0.9.7-2 on ubuntu requires [http://launchpadlibrarian.net/20025336/mock.patch] in order to run.
Additionally, if you run puritan as root, you should either

usermod -a -G mock -u $SUDO_UID
unset SUDO_UID # or

; All
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.

Latest revision as of 00:56, 14 January 2009

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


Interactive Debugging

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

with the most recent compilation and ui, you will be dropped directly into bash inside the buildroot.

  • to resume the compilation, type
 exit 0
  • to quit the compilation, type
 exit 1

with earlier compilations which still support interactive error-handling: instructions

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


Other Notes

Fedora

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.

Ubuntu

mock_0.9.7-2 on ubuntu requires [1] in order to run. Additionally, if you run puritan as root, you should either

usermod -a -G mock -u $SUDO_UID
unset SUDO_UID  # or
All

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.