Ubuntu Lucid on OLPC XO: Difference between revisions
Line 16: | Line 16: | ||
* Install Ubuntu Lucid as you normally would. If you need guidance on how to operate your virtualisation software or install Ubuntu in it, please look elsewhere - the Internet has plenty of guides on that. |
* Install Ubuntu Lucid as you normally would. If you need guidance on how to operate your virtualisation software or install Ubuntu in it, please look elsewhere - the Internet has plenty of guides on that. |
||
'''Attention:''' Make sure to use the manual partition editor during the installation, and format the root partition as Ext3. Do not use the default setting of Ext4, as it is not yet supported by the OpenFirmware bootloader in the XO.<br /> |
'''Attention:''' Make sure to use the manual partition editor during the installation, and format the root partition as '''Ext3'''. Do not use the default setting of Ext4, as it is not yet supported by the OpenFirmware bootloader in the XO.<br /> |
||
Also, '''do not create a swap partition.''' Flash drives die prematurely from the wear & tear of swapping. |
Also, '''do not create a swap partition.''' Flash drives die prematurely from the wear & tear of swapping. |
||
Revision as of 19:29, 11 April 2010
This guide is under construction.
Introduction
This guide describes how to install Ubuntu Lucid (10.04) BETA 2 on the OLPC XO. At the time of writing, Lucid is still in the development phase, but will soon be released in a stable version. The method of installing Ubuntu described herein is aimed at power users who know what they're doing and know what they want - but plain old folks are welcome to give it a try, of course. This guide solves the problem that earlier methods had with Upstart, so we won't have to take a step backwards to sysvinit.
Requirements
- A USB flashdrive or an SD card big enough to fit the Ubuntu system, 4 GB should work.
- A computer other than the XO, to create the Ubuntu system on. We will be using a virtualisation software on this computer to create the Ubuntu image which will be written to the flashdrive/SD card. I will be using an Ubuntu system (surprise!) with VirtualBox. Qemu should work too.
- A developer key, to unlock the XO bootloader.
Creating the Ubuntu Image
- Create a disk image in VirtualBox or Qemu, slightly smaller than your destination flashdrive/SD card.
- Install Ubuntu Lucid as you normally would. If you need guidance on how to operate your virtualisation software or install Ubuntu in it, please look elsewhere - the Internet has plenty of guides on that.
Attention: Make sure to use the manual partition editor during the installation, and format the root partition as Ext3. Do not use the default setting of Ext4, as it is not yet supported by the OpenFirmware bootloader in the XO.
Also, do not create a swap partition. Flash drives die prematurely from the wear & tear of swapping.
When the installation is complete, you will boot into your new system for the first time in the virtual machine. This is a good time to install the latest packages and updates:
$ sudo apt-get upgrade
After installing Ubuntu and running "sudo apt-get upgrade" to install the latest packages, you might want to install the "Netbook Remix" packages. They give Ubuntu a new desktop interface optimized for netbooks, which works nicely on the XO's small display. To do so, run "sudo apt-get install ubuntu-netbook".
Adapting Ubuntu to the XO
There is a package called olpc-xo1-hw, that does some XO-specific configuration. I'm not sure that it's needed, but if you want to be on the safe side for now:
$ sudo apt-get install olpc-xo1-hw
You might want to install the "Netbook Remix". This gives your desktop a new look, replacing your standard Gnome desktop with a slightly iPhone-inspired interface. The main menu and the desktop are replaced with a desktop-sized application launcher. It has nice, big icons - and all windows are maximized to make good use of the small screen, and take away the hassle of window manipulation.
$ sudo apt-get install ubuntu-netbook
The most important fix, however, is to replace the Linux kernel. For some reason, the stock Ubuntu kernel doesn't work on the XO. (It seems to boot, judging by miscellaneous flashing LEDs on the computer, but the display is stuck on the OpenFirmware screen. Video driver issues?) Download the latest XO-1 kernel from here: http://dev.laptop.org/~kernels/olpc-2.6.31-xo1/
$ sudo apt-get install rpm2cpio $ cd / $ sudo sh -c "rpm2cpio /home/user/Downloads/kernel-2.6.31_xo1-xxxxxxx.rpm | cpio -idmv" $ depmod 2.6.31_xo1-xxxxxxx
Now, we need to include our new modules in the Ubuntu initrd:
$ mkdir /tmp/initrd $ cd /tmp/initrd $ zcat /boot/initrd.img-2.6.xxxxxxx | cpio -idmv $ cp -r /lib/modules/2.6.31_xo1-xxxxxx lib/modules/ $ sudo sh -c "find . | cpio -H newc -o | gzip > /boot/initrd.img-xo"
If firmware security is enabled on your XO (it most likely is), you will need a developer key in order to boot anything but the stock Fedora/Sugar OS. Once you have your key, create a folder called "/security", and save your develop.sig file there.
The last step is to create the Forth script that tells OpenFirmware how to boot our system. Create the file /boot/olpc.fth, and depending on whether you are using a USB drive or an SD card, choose one of the following scripts:
\ OpenFirmware boot script for USB " u:\boot\initrd.img-xo" to ramdisk boot u:\boot\vmlinuz-2.6.31_xo1-xxxxxx ro root=LABEL=OLPCRoot rootdelay=30
\ OpenFirmware boot script for SD card " sd:\boot\initrd.img-xo" to ramdisk boot sd:\boot\vmlinuz-2.6.31_xo1-xxxxxx ro root=mmcblk0p1 rootdelay=30
It is now time to shut down the virtual machine and try our creation on the XO.
Writing image to the drive
Now convert your virtual disk image to a raw format that can be written to your flashdrive/SD card. If you are using VirtualBox, the command to do this is:
$ VBoxManage internalcommands converttoraw <vbox-image>.vdi ubuntu-image.raw
If you are using Qemu or something else, you're on your own to figure out how to do this.
Write the image to your flashdrive/SD card:
$ dd if=ubuntu-image.raw of=/dev/sdX bs=1M
...where sdX is your drive (do not include partition number - use e.g. sda instead of sda1) This will apply the partition table created with the Ubuntu installer - and needless to say, all data on the drive will vanish. Now, the root partition on the drive has to be renamed in order for the bootloader to find it:
$ sudo tune2fs /dev/sdb1 -L OLPCRoot
Good luck!
Plug your drive into the XO and boot it up - if your lucky, it might work! :]