Difference between revisions of "Dextrose/Building"

From Sugar Labs
Jump to: navigation, search
m (edit for readability)
m (edit for readability)
Line 5: Line 5:
 
== Build host requirements ==
 
== Build host requirements ==
  
The Dextrose build system runs on '''Fedora 11 i386''' through '''Fedora 13 x86_64'''. The host system runs _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.
+
The Dextrose build system runs on '''Fedora 11 i386''' through '''Fedora 13 x86_64'''. The host system runs '''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.
  
 
The initial build requires about '''700MB''' of rpm packages and Sugar activity bundles. The packages and bundles are cached for futures builds.
 
The initial build requires about '''700MB''' of rpm packages and Sugar activity bundles. The packages and bundles are cached for futures builds.
Line 46: Line 46:
 
== Customizing your build ==
 
== Customizing your build ==
  
The topic of  is too vast to discuss in detail here. Start by reading
+
olpc-os-builder is documented at
 
[http://git.sugarlabs.org/projects/dextrose/repos/mainline/trees/master/doc/README README]
 
[http://git.sugarlabs.org/projects/dextrose/repos/mainline/trees/master/doc/README README]
in the olpc-os-builder tree. Then, as needed, read the various <tt>README</tt> files contained in the
+
in the olpc-os-builder tree. The modules are documented in <tt>README</tt> files in the
 
[http://git.sugarlabs.org/projects/dextrose/repos/mainline/trees/master/modules modules] directory.
 
[http://git.sugarlabs.org/projects/dextrose/repos/mainline/trees/master/modules modules] directory.
  
Being a Build Master involves knowledge of many workflows, including:
+
=== Upstream Code ===
  
* Building Sugar in [http://wiki.sugarlabs.org/go/Development_Team/Jhbuild sugar-jhbuild].
+
Dextrose is based on upstream olpc code located at dev.laptop.org.
 
 
* Dealing with yum and [http://www.rpm.org/wiki/Docs rpm].
 
 
 
* Understanding the [http://fedoraproject.org/wiki/Packaging/Guidelines Fedora packaging] workflow and conventions.
 
 
 
* Creating yum package repositories with <tt>[http://createrepo.baseurl.org/]</tt>.
 
 
 
* Uploading activities to [http://activities.sugarlabs.org].
 
 
 
* General understanding of the Linux system plumbing infrastructure: [http://www.kernel.org/ kernel],
 
[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html udev], [http://www.freedesktop.org/wiki/Software/dbus dbus], [http://www.freedesktop.org/wiki/Software/DeviceKit DeviceKit], [http://www.freedesktop.org/wiki/NetworkManager NetworkManager],
 
[http://www.x.org/wiki/ 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.
 
 
 
== Upstream ==
 
 
 
Upstream code comes from dev.laptop.org:
 
  
 
  git remote add olpc git://dev.laptop.org/projects/olpc-os-builder
 
  git remote add olpc git://dev.laptop.org/projects/olpc-os-builder
Line 79: Line 59:
 
  git log olpc/master
 
  git log olpc/master
  
== Building custom RPMs ==
+
=== Customizing the core RPMs ===
  
 
* Go to the <tt>rpms/PACKAGENAME</tt> in the dextrose tree
 
* Go to the <tt>rpms/PACKAGENAME</tt> in the dextrose tree
Line 87: Line 67:
 
* Increase the release number after each change.
 
* Increase the release number after each change.
  
* <tt>make i586</tt>
+
=== building the Custom RPM ===
 +
 
 +
  make i586
 +
 
 +
=== Uploading the Custom RPM ===
  
 
* Upload rpm to a yum repository and add it to the ini file used by the OLPC OS builder.
 
* Upload rpm to a yum repository and add it to the ini file used by the OLPC OS builder.
Line 93: Line 77:
 
* To automate this step, we have a rule <tt>make uploadrpm</tt> which points at the Dextrose repository. Edit <tt>rpms/common/Makefile.common</tt> or <tt>rpms/common/uploadrpm</tt> to retarget this rule to your repository.
 
* To automate this step, we have a rule <tt>make uploadrpm</tt> which points at the Dextrose repository. Edit <tt>rpms/common/Makefile.common</tt> or <tt>rpms/common/uploadrpm</tt> to retarget this rule to your repository.
  
== Building custom OLPC kernels ==
+
=== Building custom kernels ===
  
 
  $ git clone http://dev.laptop.org/git/olpc-2.6/
 
  $ git clone http://dev.laptop.org/git/olpc-2.6/
 
  $ cd olpc-2.6
 
  $ cd olpc-2.6
 
  $ setarch i386 make ARCH=i386 xo_1-kernel-rpm
 
  $ setarch i386 make ARCH=i386 xo_1-kernel-rpm
 +
 +
== Resources ==
 +
 +
* [http://wiki.sugarlabs.org/go/Development_Team/Jhbuild Sugar-jhbuild] - The Sugar Labs build system.
 +
 +
* [http://www.rpm.org/wiki/Docs Rpm] - The Redhat package manager.
 +
 +
* [http://fedoraproject.org/wiki/Packaging/Guidelines Fedora packaging] - Fedora packaging workflow and conventions.
 +
 +
* [http://createrepo.baseurl.org/] - The yum package repositories builder.
 +
 +
* [http://activities.sugarlabs.org] - The Sugar Labs activities library.
 +
 +
* General understanding of the Linux system plumbing infrastructure: [http://www.kernel.org/ kernel],
 +
[http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html udev], [http://www.freedesktop.org/wiki/Software/dbus dbus], [http://www.freedesktop.org/wiki/Software/DeviceKit DeviceKit], [http://www.freedesktop.org/wiki/NetworkManager NetworkManager],
 +
[http://www.x.org/wiki/ 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.

Revision as of 06:52, 25 August 2010

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 runs on Fedora 11 i386 through Fedora 13 x86_64. The host system runs 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.

The initial build requires about 700MB of rpm packages and Sugar activity bundles. The packages and bundles are cached for futures builds.

Initial setup

  • Checkout Dextrose build system
 git clone git://git.sugarlabs.org/dextrose/mainline.git dextrose
  • Install dependencies
 yum upgrade
 yum install libtomcrypt-devel bitfrost make gcc mtd-utils python-imgcreate zip unzip
  • Compile build helper programs
 make
  • Generate initial sequence number for the builds
 echo 42 >buildnr-dx

Creating a build

  • Run the Build
 time sudo ./osbuilder.py examples/dextrose2-xo1.ini

The initial build may take several hours depending on available bandwith. Subsequent builds will take about 15-20 minutes

Upon completion the new image is available at build/output.

Because several build tools, olpc-os-builder, imgcreate and yum, are nested, error output could be misleading or obscure. Before digging into code, you please 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

 make i586

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

  • Rpm - The Redhat package manager.
  • [1] - The yum package repositories builder.
  • [2] - 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.