DebXO

From OLPC
Revision as of 17:04, 27 October 2008 by Skierpage (talk | contribs) (add updating section)
Jump to: navigation, search

From Andres Solomon's "debxo.2 release" post to devel at laptop.org

DebXO is a set of OS images of the Debian Linux distribution that you can run on your XO.

New features in DebXO 0.2

  • The JFFS2 images now have partition support. While this shaves a number of seconds off of the boot time, we can take better advantage of it in the future (doing things like using UBIFS). JFFS2 is well past its prime; moving away from it will help performance a lot.
  • EXT3 images are available. This allows for booting off of USB and/or SD. Note that the image size I chose is 2GB, so you'll need a USB flash drive or SD card of at least that size.
  • The kernel is now almost completely modular, and includes every module under the sun. For those of you with random USB hardware that wanted to use it with DebXO.. if it's in 2.6.25, it should work with DebXO.
  • New desktops! DebXO 0.1 only had a Gnome desktop; this release includes options for KDE, LXDE, Sugar, Awesome and Gnome desktops. I personally run (and work on) the Gnome desktop. Holger Levsen is to thank for the Sugar and Awesome desktops. James Cameron did the work for the KDE and LXDE desktops. A huge thanks to both of them!

As far as bootup times, nand is still pretty absymal (due to jffs2); however, SD booting takes 75 seconds from OFW to fully usable X.

Installation

Prerequisites

You need to be running an appropriately up-to-date version of Open Firmware (see How to check the OS and firmware versions). The q2d* series do not support update-nand, and versions q2e18 and q2e19 are known to be buggy with partitions. Firmware and instructions for upgrading are at Firmware

You need a developer key to run this release

Installation onto the XO's build-in NAND flash memory

The release can be found at http://lunge.mit.edu/~dilinger/debxo-0.2/images/

To install onto the XO's flash, download the debxo-$DESKTOP.jffs2.dat and debxo-$DESKTOP.jffs2.img files to a USB or SD stick (where $DESKTOP is one of the various desktops - gnome, kde, lxde, sugar, or awesome). Boot into Open Firmware (make sure your XO is unlocked!), and run

 update-nand disk:\debxo-$DESKTOP.jffs2.img

or

 update-nand sd:\debxo-$DESKTOP.jffs2.img

(depending upon whether you downloaded to an SD or USB disk). If your SD or USB device is using a windows filesystem, you can figure out the name of the image by running

 dir disk:\

If update-nand spits out any errors, make sure you're running an appropriately up-to-date version of OFW.

Installation onto SD/USB

To install onto an SD or USB device, download the debxo-$DESKTOP.ext3.img.gz file, and run

 zcat debxo-$DESKTOP.ext3.img.gz > /dev/mmcblk0

or

 zcat debxo-$DESKTOP.ext3.img.gz > /dev/sdX

(depending upon whether you're writing to an SD or USB disk). Note that this will overwrite any data that is on the SD or USB disk.


Usage

By default, a user 'olpc' is created (with no password, and sudo access). Some desktops automatically start a display manager and log you in; some do not. The root password is disabled by default. This is a stock Debian Lenny system with only a few modifications, so it can obviously be tailored.


Hacking

xodist is the name of the collection of scripts that are used to produce DebXO. The git repository can be downloaded via:

 git clone git://lunge.mit.edu/git/xodist

There's also a web interface to that:

 http://lunge.mit.edu/cgi-bin/gitweb.cgi?p=xodist;a=summary

There's a TODO file in the repository, but really... just scratch whatever itch you happen to have. Patches are much appreciated. Additional desktops (XFCE, for example?), better handling of the default user/password, boot/runtime optimizations, suggestions for missing packages, etc.

Updating

The apt package manager command should Just Work for the majority of the distribution, but there are three custom packages:

  • ofw-config (which manages /boot/olpc.fth)
  • linux-2.6.25.15 (which manages the kernel)
  • initramfs-tools (which manages the initramfs/initrd)

ofw-config and linux-2.6.25.15 should never be automatically upgraded (since ofw-config isn't in debian and debian's kernel package is called linux-image-2.6.25-X), but initramfs-tools might be. The customizations to initramfs-tools basically ensure certain modules get added to the initrd and loaded; redboot, jffs2, lxfb, and so on. Those patches should make it into the next debian release (after "lenny").

In short, be very careful with the initramfs-tools package; don't upgrade it. The next DebXO release may have its custom packages simply backported, rather than completely outside of debian.

If you want to put these three package on hold, so that they won't be upgraded, enter the following commands in a terminal:

 for pkg in ofw-config linux-2.6.25.15 initramfs-tools ; do 
   echo $pkg hold | dpkg --set-selections
 done

To remove the hold:

 for pkg in ofw-config linux-2.6.25.15 initramfs-tools ; do 
   echo $pkg install | dpkg --set-selections
 done

Upgrading the kernel

As far as upgrading the kernel, it depends on how it's built. Note that /boot/olpc.fth uses /vmlinuz and /vmlinuz.old symlinks, so make sure that they're pointed to the correct image after you've upgraded. If you're building a custom kernel and everything's modular, you need to make sure the initramfs-tools hasn't been upgraded. If you're building the modules needed to boot (cafe_nand, redboot, jffs2) statically into the kernel, the initramfs-tools package can mostly be ignored.

Credits

Thanks to James Cameron and Holger Levsen for various patches/tweaks/fixes, and to the various people who tested and provided feedback.

See also