Dextrose build system
Dextrose uses olpc-os-builder, a tool create by OLPC to build official and customized system images. The Dextrose git repository contains, olpc-os-builder, local customizations specific to Dextrose, and fixes and enhancements waiting to be pushed upstream.
Build host requirements
The Dextrose build system is known to work on Fedora 14 x86_64 and Fedora 16 x86_64. The OS on the host system shouldn't matter because the build runs in a chroot environment. olpc-os-builder does not yet run on Ubuntu due to a missing dependency (bitfrost).
The initial build requires about 700MB of rpm packages and Sugar activity bundles. The packages and bundles are cached for futures builds.
Initial setup
- If sudo isn't configured to work with your account, add yourself to the wheel group. Alternatively, you can become root with
su -
.
- Install build dependencies (you need to be root to do this)
yum upgrade yum install libtomcrypt-devel bitfrost crcimg make gcc mtd-utils python-imgcreate zip unzip zlib-devel lzma
- Install the olpc-bootanim-tools package:
rpm -i http://download.sugarlabs.org/dextrose/testing/dx3/rpms/x86_64/os/olpc-bootanim-tools-2.14-1.bernie1.fc16.x86_64.rpm
If you have a 32bit machine:
rpm -i http://download.sugarlabs.org/dextrose/testing/dx3/rpms/i386/os/olpc-bootanim-tools-2.14-1.bernie1.fc16.i686.rpm
Alternatively, you could rebuild the olpc-bootanim package from source:
yum install rpm-build netpbm-progs wget http://download.sugarlabs.org/dextrose/testing/dx3/rpms/source/olpc-bootanim-2.14-1.bernie1.fc16.src.rpm rpmbuild --rebuild olpc-bootanim-2.14-1.bernie1.fc16.src.rpm rpm -U ~/rpmbuild/RPMS/*/olpc-bootanim-tools-*.rpm
- Checkout the Dextrose build system
git clone git://git.sugarlabs.org/dextrose/mainline.git dextrose -b dextrose-3-20110919
- Compile build helper programs
cd dextrose make
- Generate initial sequence number for the builds (42 is just an example)
echo 42 >buildnr-dx
Creating a build
- Become root and run the build system:
sudo -i time ./osbuilder.py config/dextrose3-xo1-nognome.ini
The initial build may take several hours, depending on available bandwith. Subsequent builds will take about 15-20 minutes on average machines.
Upon completion the new image will be available in build/output.
Because several build tools (olpc-os-builder, imgcreate and yum) run chrooted and nested into each other, error output could be misleading or obscure. Before digging into code, you can ask on IRC in case someone has already seen the same problem.
Publishing the images
Please do not publish signed builds unless they implement the OLPC anti-theft system.
Customizing your build
olpc-os-builder is documented at README in the olpc-os-builder tree. The modules are documented in README files in the modules directory.
Upstream Code
Dextrose is based on upstream olpc code located at dev.laptop.org.
git remote add olpc git://dev.laptop.org/projects/olpc-os-builder git fetch olpc git log olpc/master
Customizing the core RPMs
- Go to the rpms/PACKAGENAME in the dextrose tree
- Edit the spec file. Typically this involves adding a new patch, which is done by adding a PatchNN: tag and a corresponding %patchNN rule in %setup. Some of the intricacies of RPM spec files are unveiled in the Fedora Packaging Guidelines.
- Increase the release number after each change.
building the Custom RPM
If you have a Fedora 11 i386 system, just type:
make i586
Otherwise, you need to build in a mock chroot:
make srpm sudo mock -r fedora-11-i386 --resultdir=. --rebuild mypackage.src.rpm
Uploading the Custom RPM
- Upload rpm to a yum repository and add it to the ini file used by the OLPC OS builder.
- To automate this step, we have a rule make uploadrpm which points at the Dextrose repository. Edit rpms/common/Makefile.common or rpms/common/uploadrpm to retarget this rule to your repository.
Building custom kernels
$ git clone http://dev.laptop.org/git/olpc-2.6/ $ cd olpc-2.6 $ setarch i386 make ARCH=i386 xo_1-kernel-rpm
Resources
- Dextrose VM hosted by treehouse
- Sugar-jhbuild - The Sugar build system
- RPM - The Red Hat package manager
- Fedora packaging - Fedora packaging workflow and conventions
- createrepo - the yum package repositories builder
- ASLO - The Sugar Labs Activities Library
- General understanding of the Linux system plumbing infrastructure: kernel,
udev, dbus, DeviceKit, NetworkManager, Xorg...
- Flashing laptops and debugging any problems
- Interaction with the Sugar and OLPC community to solve issues and minimize our divergence from the official builds.