OS Builder/Run on XO hardware: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
(remove 11.3.1 obsolete instructions)
Line 13: Line 13:
= Recipe =
= Recipe =


* install a recent OLPC OS (we used 11.3.1-17 or 13.2.0-13),
* install 13.2.0-13,
* boot to Sugar or Gnome, log in, connect to network,
* boot to Sugar or Gnome, log in, connect to network,
* disable automatic power management from the Sugar control panel, or in Gnome:
* disable automatic power management from the Sugar control panel, or in Gnome:
Line 45: Line 45:
* ensure the system date is correct, set it if necessary:
* ensure the system date is correct, set it if necessary:
date --utc --set="{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}} {{CURRENTHOUR}}:{{CURRENTMINUTE}}:{{CURRENTSECOND}}"
date --utc --set="{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}} {{CURRENTHOUR}}:{{CURRENTMINUTE}}:{{CURRENTSECOND}}"
* install the ''olpc-os-builder'' and ''binutils'' packages:
* on 11.3.x, follow the [[OS_Builder/Development|OS Builder development installation instructions]] -- remember to disable firstboot, and note that you will want to have your OS Builder directory on the external USB disk
* on 11.3.x, move /var/tmp to the USB HDD; because some large files are created:
D=/run/media/olpc/DISK/var/tmp
mkdir -p $D
cp -pr /var/tmp/* $D
mount -o bind $D /var/tmp
* on 11.3.x, we want to work on branch v4.0, so
git checkout -b v4.0 origin/v4.0
* on 13.2.x, install the olpc-os-builder package:
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
yum install olpc-os-builder binutils
yum install olpc-os-builder binutils
* 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.
* during test builds, generating only one image is faster -- edit examples/olpc-os-13.2.1-xo4.ini to comment out the "usb_update" module.


Your setup is ready, you can now make the first build:
Your setup is ready, you can now make the first build:
Line 62: Line 54:
sudo ./osbuilder.py examples/olpc-os-13.2.1-xo4.ini
sudo ./osbuilder.py examples/olpc-os-13.2.1-xo4.ini


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


= Experiences =
= Experiences =

Revision as of 00:55, 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

  • an XO-1.5, XO-1.75 or XO-4,
  • a 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,

Recipe

  • install 13.2.0-13,
  • boot to Sugar or Gnome, log in, connect to network,
  • disable automatic power management from the Sugar control panel, or in Gnome:
 sudo touch /etc/powerd/flags/inhibit-suspend
  • insert external SD card, and prepare for swap -- in a terminal, as root
 # see what block device id is the external SD, usually mmcblk1p1
 mount | grep mmcblk
 
 # unmount any existing partitions
 umount /dev/mmcblk1p1
 
 # 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
 UUID="ff1bfee8-4051-4d53-ba5e-e21559fc3c24"

 # 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, partitioning it with a large partition of type "83", then use mkfs to create an ext3 or ext4 partition,
  • ensure the system date is correct, set it if necessary:
 date --utc --set="2024-07-25 10:23:24"
  • install the olpc-os-builder and binutils packages:
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
yum install olpc-os-builder binutils
  • during test builds, generating only one image is faster -- edit examples/olpc-os-13.2.1-xo4.ini to comment out the "usb_update" module.

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

2013-07-29, XO-4, 2GB RAM, 4GB SWAP, 500GB USB HDD, 13.2.0

Build took 31 minutes.

# time ./osbuilder.py examples/olpc-os-13.2.0-xo4.ini
...
real    30m55.275s
user    12m42.790s
sys     2m8.370s

Configuration file: http://dev.laptop.org/~quozl/z/1V3fiW.txt

Hardware performance measurements:

  • internal eMMC, sequential read, 49 MiB/s, (operating system),
  • internal eMMC, filesystem write, 13.7 MiB/s,
  • USB HDD, sequential read, 27 MiB/s, (osbuilder filesystem),
  • USB HDD, filesystem write, 27 MiB/s,
  • external SD, sequential read, 15 MiB/s, (swap),

Performance tweaks:

  • versioned_fs=0
  • make_tree_tarball=0
  • no sugar
  • a warm file cache (timing of a subsequent run, not an initial run)

2013-07-30, XO-1.75, 1GB RAM, no SWAP, 500GB USB HDD, 13.2.0

Build took 43 minutes.

# time ./osbuilder.py examples/olpc-os-13.2.0-xo1.75.ini
...
real    43m13.025s
user    23m44.010s
sys     4m17.620s

Configuration file: http://dev.laptop.org/~quozl/z/1V3xjq.txt

Hardware performance measurements:

  • internal eMMC, sequential read, 27.8 MiB/s, (operating system),
  • internal eMMC, filesystem write, 7.38 MiB/s,
  • USB HDD, sequential read, 27.5 MiB/s, (osbuilder filesystem),
  • USB HDD, filesystem write, 27 MiB/s,

Performance tweaks:

  • versioned_fs=0
  • make_tree_tarball=0
  • no sugar
  • a warm file cache (timing of a subsequent run, not an initial run)

2013-07-30, XO-1.5, 1GB RAM, no SWAP, 500GB USB HDD, 13.2.0

Build took 39 minutes.

# time ./osbuilder.py examples/olpc-os-13.2.0-xo4.ini
...
real    38m50.632s
user    21m16.550s
sys     2m58.560s

Configuration file: http://dev.laptop.org/~quozl/z/1V3vxy.txt

Hardware performance measurements:

  • internal microSD, sequential read, 18.2 MiB/s, (operating system),
  • internal microSD, filesystem write, 6.23 MiB/s,
  • USB HDD, sequential read, 32 MiB/s, (osbuilder filesystem),
  • USB HDD, filesystem write, 29.4 MiB/s,

Performance tweaks:

  • versioned_fs=0
  • make_tree_tarball=0
  • no sugar
  • a warm file cache (timing of a subsequent run, not an initial run)