OLPC Laptop in Ubuntu 7.10
This tutorial covers information on how to emulate XO on a typical Linux environment. I will be using Ubuntu Gutsy (7.10) and qemu for emulation.
First we need to get qemu.
sudo apt-get install qemuThen we need to prepare the module for using accelerated layer qemu (kqemu)
sudo apt-get install kqemu-source
sudo module-assistant prepareWe make the udev rules so it automatically loads the module. Create the file /etc/udev/rules.d/60-kqemu.rules and write:
sudo module assistant auto-install kqemu
KERNEL=="kqemu", NAME="%k", GROUP="kqemu", MODE="0660"appending a new line.
Add a new group and a new user:
sudo addgroup --system kqemu
sudo adduser $USER kqemu
sudo /etc/init.d/udev reload.Load the kqemu module itself:
sudo update-modulesNow, get the XO image from the olpc site:
sudo modprobe kqemu
wget http://olpc.download.redhat.com/olpc/streams/development/and unpack it:
LATEST-STABLE-BUILD/devel_ext3/
olpc-redhat-stream-development-devel_ext3.img.bz2
bunzip2 olpc-redhat-stream-development-devel_ext3.img.bz2Now make your ram partition bigger
sudo umount /dev/shmAnd run it:
sudo mount -t tmpfs -o size=528m none /dev/shm
qemu -m 512 -hda olpc-redhat-stream-development-devel_ext3.img
1 comment:
For Ubuntu 7.04 and up (tested on Hardy 8.04), I have created a script that handles everything automaticaly (even downloading the image). Here it is
#!/bin/bash
## olpc vm script for ubuntu (>= 7.04) by Yannis Tsopokis
## go here for more info:
## http://tsopokis.gr (soon there will be an olpc section there)
## http://wiki.laptop.org/go/Emulating_the_XO/Quick_Start/Linux
## http://xs-dev.laptop.org/~cscott/olpc/streams/ship.2/build659/devel_ext3/olpc-redhat-stream-ship.2-build-659-20080229_1949-devel_ext3.img.bz2
link=http://xs-dev.laptop.org/~cscott/olpc/streams/ship.2/build659/devel_ext3/olpc-redhat-stream-ship.2-build-659-20080229_1949-devel_ext3.img.bz2
[ -f olpc-redhat-stream-ship.2-build-659-20080229_1949-devel_ext3.img ] || wget $link && bunzip2 olpc-redhat-stream-ship.2-build-659-20080229_1949-devel_ext3.img.bz2
dpkg --get-selections qemu 2>/dev/null | grep install || sudo apt-get install qemu
dpkg --get-selections kqemu-common 2>/dev/null | grep install || sudo apt-get install kqemu-common
dpkg --get-selections module-assistant 2>/dev/null | grep install || sudo apt-get install module-assistant
sudo module-assistant auto-install kqemu
sudo su -c "echo 'options kqemu major=0' > /etc/modprobe.d/kqemu"
sudo su -c 'echo KERNEL==\"kqemu\", NAME=\"%k\", MODE=\"0666\" > /etc/udev/rules.d/60-kqemu.rules'
sudo /sbin/modprobe kqemu major=0
qemu -kernel-kqemu -m 256 -soundhw es1370 -serial `tty` -net user -net nic,model=rtl8139 -hda olpc-redhat-stream-ship.2-build-659-20080229_1949-devel_ext3.img
create a file named qemu-olpc.sh and put the above inside it. then run "source qemu-olpc.sh" and it will do everything for you. it is tested with 32-bit systems and even handles kqemu kernel modules.
Post a Comment