OS Builder/Run on XO hardware: Difference between revisions

From OLPC
Jump to navigation Jump to search
Line 21: Line 21:
* disable automatic power management from the Sugar control panel, or in Gnome:
* disable automatic power management from the Sugar control panel, or in Gnome:
sudo touch /etc/powerd/flags/inhibit-suspend
sudo touch /etc/powerd/flags/inhibit-suspend
* configure package installation to keep documentation; needed so that the example files in olpc-os-builder are kept:
* optional; insert external SD card, and prepare for swap -- in a terminal, as root
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
# see what block device id is the external SD, usually mmcblk1p1
* install some packages:
mount | grep mmcblk
sudo yum install -y ntpdate gparted olpc-os-builder binutils git
* optional; insert external SD card, and prepare it for swap using gparted, Applications -> System Tools -> GParted Partition Editor, then add it to the filesystem table:
# unmount any existing partitions
umount /dev/mmcblk1p1
blkid /dev/mmcblk1p1
UUID="ff1bfee8-4051-4d53-ba5e-e21559fc3c24" TYPE="swap"
# delete manufacturer's partition
# create a new partition, of at least 2GB, type 82
parted /dev/mmcblk1
(parted) rm 1
(parted) mkpart primary linux-swap 1M -1s
(parted) quit
# prepare the new partition to be swap
mkswap /dev/mmcblk1p1
# the above will report a UUID identifier, such as
Setting up swapspace version 1, size = ... KiB
no label, UUID="ff1bfee8-4051-4d53-ba5e-e21559fc3c24"
# add this UUID to fstab to use swap automatically on every boot
# add this UUID to fstab to use swap automatically on every boot
Line 47: Line 34:
# enable all swap partitions in fstab
# enable all swap partitions in fstab
swapon -a -v
swapon -a -v
* prepare the USB hard drive, partitioning it with a large partition of type "83", then use mkfs to create an ext3 or ext4 partition,
* prepare the USB hard drive using gparted, Applications -> System Tools -> GParted Partition Editor, partitioning it with a large ext4 partition,
* ensure the system date is correct, set it if necessary:
* ensure the system date is correct, set it if necessary:
sudo ntpdate pool.ntp.org
sudo ntpdate pool.ntp.org
* install some packages:
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
sudo yum install -y olpc-os-builder binutils git
* download v7.0 of olpc-os-builder:
* download v7.0 of olpc-os-builder:
git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder
git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder

Revision as of 04:02, 30 July 2013

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 machines are not available for the platform (such as ARM), this recipe is recommended.

The procedure has been tested with XO-1.5, XO-1.75 and XO-4 hardware and 13.2.0-13.

Ingredients

Each of these must be dedicated to the task for as long as you need to make builds:

  • an XO-1.5, XO-1.75 or XO-4,
  • optional; an SD card for swap; minimum size 512 MB, good quality, fast access, e.g. class 10,
  • a USB hard disk drive for storing RPMs and build files; minimum size 120 GB, fast, large capacity,
  • an unfiltered internet connection.

Recipe

  • install 13.2.0-13,
  • boot to Sugar or Gnome, log in, and connect to your wireless network,
  • optional; insert a USB ethernet adapter and connect to your wired network,
  • disable automatic power management from the Sugar control panel, or in Gnome:
 sudo touch /etc/powerd/flags/inhibit-suspend
  • configure package installation to keep documentation; needed so that the example files in olpc-os-builder are kept:
 sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
  • install some packages:
 sudo yum install -y ntpdate gparted olpc-os-builder binutils git
  • optional; insert external SD card, and prepare it for swap using gparted, Applications -> System Tools -> GParted Partition Editor, then add it to the filesystem table:
 blkid /dev/mmcblk1p1
 UUID="ff1bfee8-4051-4d53-ba5e-e21559fc3c24" TYPE="swap"

 # add this UUID to fstab to use swap automatically on every boot
 echo UUID=ff1bfee8-4051-4d53-ba5e-e21559fc3c24 swap swap defaults 0 0 >> /etc/fstab
 
 # enable all swap partitions in fstab
 swapon -a -v 
  • prepare the USB hard drive using gparted, Applications -> System Tools -> GParted Partition Editor, partitioning it with a large ext4 partition,
  • ensure the system date is correct, set it if necessary:
 sudo ntpdate pool.ntp.org
  • download v7.0 of olpc-os-builder:
 git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder
 cd olpc-os-builder
  • customise your build to make it build faster, by editing examples/olpc-os-13.2.1-xo4.ini
    • remove the [usb_update] module,
    • in the [base] module, set versioned_fs=0 and make_tree_tarball=0,
    • reduce the [global] langs= to the languages you need,

Your setup is ready, you can now make the first build:

 sudo ./osbuilder.py examples/olpc-os-13.2.1-xo4.ini

The first build will take much longer than subsequent builds, because it will download RPMs and activities to disk.

Experiences

On XO-1.5, XO-1.75 and XO-4 with a typical USB hard drive, the build takes between half an hour and an hour on subsequent runs. See experiences for further detail.