Ubuntu on OLPC XO
MOVING THE IMAGE TO A USB FLASH DRIVE or SD
You will now need a USB flash drive or SD card at least as big as your virtual disk image. It will be wiped COMPLETELY!! Be sure that after you insert the drive that it is not mounted!
$ sudo dd if=<the path to your disk image> of=<device name e.g. /dev/sdb> bs=1M
$ sudo sync
this will do a nice raw write to your flash. Whatever space is left over you can add a handy extra partition with fdisk too!
IMPORTANT:
Again after the above is done, make sure the drive is unmounted and remove it. Plug it again to check that all is well. If the drive does not have the right label, OLPCRoot, you can use tune2fs, just be sure to unmount it before doing so!
find out where the drive is mounted:
$mount
$sudo umount /media/<name of mounted sd/usb flash>
assuming your flash is /dev/sdb and the mounted partition was from /dev/sdb1
$ sudo tune2fs /dev/sdb1 -L OLPCRoot
GET NECESSARY FILES FROM THE XO
Plug it into the XO, you will now have access to the filesystem of that drive. If you are in XFCE on the XO you will find a root filemanager handy (but be careful!)
$ su
# thunar
if not you can do the following from the terminal in Sugar or TTY:
$su
(assuming you labeled your flash drive OLPCRoot, I’m spreading the commands out for clarity, feel free to optimize, but be careful!)
# cp -ra /boot /media/OLPCRoot/
# cp -ra /lib/modules /media/OLPCRoot/lib/
# cp -ra /lib/firmware /media/OLPCRoot/lib/
# cp -ra /security /media/OLPCRoot/
make sure your develop.sig is in that security folder!
you should rename the /media/OLPCRoot/etc/modprobe.d to modprobe.old or similar
# cd /media/OLPCRoot/etc
# mv modprobe.d modprobe.old
Copy your olpc’s modprobe.d to the flash drive (this will load and blacklist the proper modules)
# cp -ra /etc/modprobe.d /media/OLPCRoot/modprobe.d
rename the existing fstab to something like fstab.old
# mv fstab fstab.old
use the fstab from the olpc
# cp -ar /etc/fstab /media/OLPCRoot/etc/fstab
then make a new /etc/X11/xorg.conf from here (cscott’s debian archive)
notice that it is not using the AMD xorg driver…
then lets rename (cause it will be handy for internal installs) and create a new olpc.fth in /media/OLPCRoot/boot/
# cd /media/OLPCRoot/boot
# mv olpc.fth olpc.fth.nand
use one of these olpc.fth files depending on how you want boot:
FOR USB BOOT:
FOR SD BOOT:
olpc.fth for sd boot
Make sure that whatever you use is named olpc.fth. You should now be able to boot. Use the Rightmost game button to view the boot messages for debugging…
NETWORKING
if you have a WPA network try the following. Check to see if you have a wireless card:
$ iwconfig
assuming your wireless is eth1:
$ sudo wpa_passphrase <ESSID> <s3kr1t password> >> /etc/wpa_supplicant.conf
$ sudo wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf -B
$ sudo dhclient eth1
if all goes well you can edit your /etc/network/interfaces and add the following under the eth1 entry (you can edit the existing eth0)
pre-up wpa_supplicant -ieth1 -Dwext -c /etc/wpasupplicant.conf -Bw
post-down killall wpa_supplicant
then restart networking (it should JustWork on next boot)
$ sudo /etc/init.d/networking restart
References:
howto debian on olpc (wiki.debian.org)
How can I boot OLPC by SD card (lists.laptop.org)
Bochs Bios Bug (bugs.launchad.net/ubuntu)
Thanks to everyone for their help and advice!
Pages: 1 2
January 9th, 2008 at 2:46 pm
Excellent. I will post something about this at my http://www.whyxo.com site. Spread the word of Ubuntu!
January 9th, 2008 at 4:24 pm
Excellent! Thank you!
But you should not run apt-cache with sudo – it doesn’t need it.
January 9th, 2008 at 7:52 pm
Thanks for catching that nealmcb! I’ll make the change.
January 11th, 2008 at 8:34 pm
When creating the image, wouldn’t it make more sense to call it OLPCRoot instead of OLPCBoot? That’d save people the trouble of having to run tune2fs after they copy the image to their flash drive.
Or was that just a typo?
Anyway, thanks for the instructions!
January 11th, 2008 at 10:32 pm
It was indeed a typo, thanks for the catch!
January 14th, 2008 at 10:51 am
[...] Ubuntu running on on my XO! Using the excellent directions at http://www.freelikegnu.org/?p=21#more-21 as a guideline, I installed a very minimal Ubuntu on a USB thumbdrive and booted it on my XO. Then [...]
January 14th, 2008 at 2:53 pm
Hi!
Great guide! Just one question:
“”"Partition the the image manualy with just one large partition as ext2 filesystem, mountpoint as ” / ” and…”"”
Would it be possible to use JFFS2 (or any other flashbased filesystem) instead of ext2?
January 14th, 2008 at 8:51 pm
[...] days, I get Ubuntu to boot based on the hard work of fellow community members. I also post an indepth tutorial on my own [...]
January 15th, 2008 at 8:58 am
OLPC Help: How to Install Ubuntu on the XO Laptop!…
Back on New Year’s Eve, I was talking with Bryan Berry of OLE Nepal about different operating systems on the XO for governments who wanted options outside of Sugar. In the middle of a rant against XP on the XO, I wondered if we could have a FOSS OS …
April 10th, 2008 at 11:25 pm
I would think this simpler debootstrap-based method would work with Ubuntu – anyone tried it? http://wiki.laptop.org/go/Installing_Debian_as_an_upgrade
May 30th, 2008 at 11:12 am
Hi, I tried your great guide and I managed to get a working image. However, somehow I fail at moving the image to the USB.
When I type
sudo dd if=/home/peter/Desktop/tetten of=/dev/sdb1 bs=1M
then the USB starts writing for about half an hour. After half an hour, it seems done. Then I type sudo sync, as instructed, and then remove the USB disk.
However, when plugging it in, ubuntu fails to mount it. Looking in Windows I get the error that the disk is not even formatted. And the OLPC doesn’t want to mount it either.
Any idea what I could have done wrong? Or what I should try? As far as I can see, I followed the guide litterally…
Thanks!
May 30th, 2008 at 2:14 pm
Never mind, solved already.
In case someone has the same problem later: I had to use /dev/sdb instead of /dev/sdb1.
By the way, ubuntu loads well, but is it normal that I don’t have a GUI? XFCE fails to start, it says no screens found… :-/