OS Builder/Run on XO hardware: Difference between revisions

From OLPC
Jump to navigation Jump to search
Line 19: Line 19:
* boot to Sugar or Gnome, log in, and connect to your wireless network,
* 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,
* optional; insert a USB ethernet adapter and connect to your wired network,
* start a Terminal and become [[root]]:
* disable automatic power management from the Sugar control panel, or in Gnome:
su
sudo touch /etc/powerd/flags/inhibit-suspend
* disable automatic power management:
* configure the system to keep documentation after package installation<ref>this is needed so that the example files in olpc-os-builder are kept, which are classified as documentation for the olpc-os-builder package, and are deleted by default on OLPC OS</ref>:
touch /etc/powerd/flags/inhibit-suspend
sudo sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
* configure the system to keep documentation after package installation<ref>the change to macros.imgcreate is needed so that the example files in olpc-os-builder are kept, which are classified as documentation for the olpc-os-builder package, and are deleted by default on OLPC OS</ref>:
sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
* install some packages:
* install some packages:
sudo yum install -y ntpdate gparted olpc-os-builder binutils git gcc make libtomcrypt-devel zlib-devel
yum install -y ntpdate gparted olpc-os-builder binutils git gcc make libtomcrypt-devel zlib-devel
* ensure the system date and time are correct:
* ensure the system date and time are correct:
sudo ntpdate pool.ntp.org
ntpdate pool.ntp.org
* 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:
* optional; insert external SD card, and use gparted (Applications -> System Tools -> GParted Partition Editor) to delete the manufacturer's partition and add a ''linux-swap'' partition, then add it to the filesystem table:
eval $(blkid -o export /dev/mmcblk1p1) # get the UUID
eval $(blkid -o export /dev/mmcblk1p1) # get the UUID
echo UUID=$UUID swap swap defaults 0 0 >> /etc/fstab # add to table
echo UUID=$UUID swap swap defaults 0 0 >> /etc/fstab # add to table
swapon -a -v # enable swap
swapon -a -v # enable swap
* prepare the USB hard drive using gparted, Applications -> System Tools -> GParted Partition Editor, partitioning it with a large ext4 partition, then add it to the filesystem table:
* prepare the USB hard drive using gparted (Applications -> System Tools -> GParted Partition Editor), partitioning it with a single ext4 partition, then add it to the filesystem table:
eval $(blkid -o export /dev/sda1) # get the UUID
eval $(blkid -o export /dev/sda1) # get the UUID
umount $DEVNAME
umount $DEVNAME
Line 37: Line 39:
echo UUID=$UUID /oob ext4 auto,rw 0 0 >> /etc/fstab # add to table
echo UUID=$UUID /oob ext4 auto,rw 0 0 >> /etc/fstab # add to table
mount -a # mount the filesystem
mount -a # mount the filesystem
* download v7.0 of olpc-os-builder to the USB hard drive:
* download v7.0<ref>the v7.0 branch of olpc-os-builder is what was used to create 13.2.1</ref> of olpc-os-builder to the USB hard drive:
cd /oob # change directory
cd /oob # change directory
git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder # download
git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder # download
cd olpc-os-builder # change directory
cd olpc-os-builder # change directory
* build the binaries:
make
* customise your build to make it build faster, by editing examples/olpc-os-13.2.1-xo4.ini
* customise your build to make it build faster, by editing examples/olpc-os-13.2.1-xo4.ini
** remove the ''[usb_update]'' module,
** remove the ''[usb_update]'' module,
Line 48: Line 52:
Your setup is ready, you can now make the first build:
Your setup is ready, you can now make the first build:
sudo ./osbuilder.py examples/olpc-os-13.2.1-xo4.ini
./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.
The first build will take much longer than subsequent builds, because it will download RPMs and activities to disk. Subsequent builds will still download some package lists, but not as much as the first build.


= Experiences =
= Experiences =

Revision as of 05:54, 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<ref>use an XO-1.5 to make XO-1 or XO-1.5 builds, and use an XO-1.75 or XO-4 to make XO-1.75 or XO-4 builds.</ref>,
  • optional<ref>we have tested without swap on XO-1.5, XO-1.75 and XO-4, each of which have at least 1GB of RAM.</ref>; 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<ref>the builder must be able to download files from repositories, and filtering may prevent file downloads, in particular one user reported RPMs starting with the name tracker were blocked.</ref>.

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,
  • start a Terminal and become root:
 su
  • disable automatic power management:
 touch /etc/powerd/flags/inhibit-suspend
  • configure the system to keep documentation after package installation<ref>the change to macros.imgcreate is needed so that the example files in olpc-os-builder are kept, which are classified as documentation for the olpc-os-builder package, and are deleted by default on OLPC OS</ref>:
 sed -i '/excludedocs/d' /etc/rpm/macros.imgcreate
  • install some packages:
 yum install -y ntpdate gparted olpc-os-builder binutils git gcc make libtomcrypt-devel zlib-devel
  • ensure the system date and time are correct:
 ntpdate pool.ntp.org
  • optional; insert external SD card, and use gparted (Applications -> System Tools -> GParted Partition Editor) to delete the manufacturer's partition and add a linux-swap partition, then add it to the filesystem table:
 eval $(blkid -o export /dev/mmcblk1p1)               # get the UUID
 echo UUID=$UUID swap swap defaults 0 0 >> /etc/fstab # add to table
 swapon -a -v                                         # enable swap
  • prepare the USB hard drive using gparted (Applications -> System Tools -> GParted Partition Editor), partitioning it with a single ext4 partition, then add it to the filesystem table:
 eval $(blkid -o export /dev/sda1)                    # get the UUID
 umount $DEVNAME
 mkdir /oob
 echo UUID=$UUID /oob ext4 auto,rw 0 0 >> /etc/fstab  # add to table
 mount -a                                             # mount the filesystem
  • download v7.0<ref>the v7.0 branch of olpc-os-builder is what was used to create 13.2.1</ref> of olpc-os-builder to the USB hard drive:
 cd /oob                                                         # change directory
 git clone -b v7.0 git://dev.laptop.org/projects/olpc-os-builder # download
 cd olpc-os-builder                                              # change directory
  • build the binaries:
 make
  • 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:

 ./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. Subsequent builds will still download some package lists, but not as much as the first build.

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.

Notes

<references/>