OS Builder/Run on XO hardware

From OLPC
Jump to navigation Jump to search

It is usually possible, if a bit slow, to run OS builder on XO hardware. On platforms where fast machines are available (such as x86), using a server-class "builder" machine is recommended.

When resources are limited, or if server-class machiens are not available for the platform (such as ARM), this recipe is recommended.

The procedure has been tested with XO-1.75 B1 prototype hardware and builds of the 11.3.x series (based on F14).

Ingredients

  • XO-1.75 B1 or newer
  • Good, fast SD card for swap
  • External USB HDD -- fast, large capacity, to store cached RPMs and build files

Recipe

  • Install a recent OS (11.3.1 development build OS17 was used)
  • Boot to Sugar or Gnome, log in, connect to network
  • Disable automatic power mgmt from the Sugar control panel
  • Insert external SD card to be used for swap
  • Prepare the SD for swap -- in a terminal, as root
 # see what block device id is the external SD
 mount 
 
 # unmount any existing partition
 umount /media/mysdcard
 
 # use fdisk to delete manufacturer's partition
 # create a new partition, of at least 2GB, type 82
 fdisk /dev/mmcblkN
 
 # prepare the new partition to be swap
 # it will report a UUID identifier
 partprobe
 mkswap /dev/mmcblkNp1
   
 # add this line to fstab to use swap automatically on every boot
 UUID=<UUID reported by mkswap> swap swap defaults 0 0
 
 # enable all swap partitions in fstab
 swapon -a -v 
  • Prepare the HDD partitioning it with fdisk with a large partition of type "83", then use mkfs to create an ext3 or ext4 partition.
  • Ensure the system date is correct, if not -- use date -s "current date" to set
  • Follow the OS Builder install instructions at http://wiki.laptop.org/go/OS_Builder/Development -- remember to disable firstboot, and note that you will want to have your OS Builder directory on the external USB disk
  • On F14, you will need to bind-mount /var/tmp to be on your external USB HDD; some large tmp files:
 mkdir /media/externaldisk/vartmp
 cp -pr /var/tmp/* /media/externaldisk/vartmp/
 mount -o bind /media/externaldisk/vartmp /var/tmp
  • For 11.3.x, we want to work on branch v4.0, so
  git checkout -b v4.0 origin/v4.0
  • During test builds, generating only one image is faster -- edit examples/olpc-os-11.3.1-xo1.75.ini to disable 8GB image generation and comment out the "usb_update" module.

Your setup is ready, you can now do:

 sudo ./osbuilder.py examples/olpc-os-11.3.1-xo1.75.ini