Getting OpenMoko working on host with Xephyr

From Openmoko

Revision as of 21:31, 8 May 2007 by Miohtama (Talk | contribs)

Jump to: navigation, search

The goal of this page is to show you how to run an OpenMoko development image on your host x86 development machine in a chrooted environment.

Contents

Build an image

First, you should use Building OpenMoko using the MokoMakefile to build an openmoko-devel-image for your host architecture (x86 in our case). Make sure you put the moko makefile in /home/moko/Makefile .

Prior to that, edit your build/conf/local.conf to make it look like this:

MACHINE = "qemux86"
DISTRO = "openmoko"
BUILD_ARCH = "i686"
INHERIT += " devshell"
SRCDATE_eds-dbus = "now"

Once you have built the image, you can start working toward running the image.

Setup the image filesystem

The filesystem of the image can be found at /home/moko/build/tmp/rootfs . It is that image that we want to run in a chrooted environment.

We will copy that that rootfs directory somewhere so that subsquent builds (using the MokoMakefile for instance) don't overwrite it.

Make sure you have root privileges:

su -

Copy the rootf into a directory called MokoBox. From now on, we will call the chrooted environment a MokoBox.

cp -r /home/moko/build/tmp/rootfs /home/moko/mokobox

make sure /dev and /proc of the host machine are visible from within mokobox

mount --bind /dev /homo/moko/mokobox/dev
mount -t proc none /home/moko/mokobox/proc

start the mokobox

chroot /homo/moko/mokobox /bin/sh

In chroot'ed environment

set environment variables

DISPLAY=:1
LANG=C
HOME=/home/root
export DISPLAY LANG HOME

Create pango.modules file

pango-querymodules > /etc/pango/pango.modules

Create gdk-pixbuf.loaders file

gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders

Remove touch screen calibrator. Since touch screen hardware is not present, the touch screen calibration prevents X start-up on PC.

rm /etc/X11/Xsession.d/30xTs_Calibrate

Starting the nested X server

Supplying fonts

You might need to install fonts supplied by OpenMoko to your host system. The easiest way to do is in Gnome is to go Preferences -> Font - > Details -> Go to font folder and then drag and drop TTF font files from build/tmp/rootfs/usr/share/fonts/ in Nautilus.

Launching Xephyr

In another terminal (not related to mokobox), start Xephyr

Xephyr :1 -ac -2button -host-cursor -screen 480x640

Now, back in chroo'ted environment, start X client:

eval $(dbus-launch)
/etc/X11/Xsession

You should see OpenMoko booting in the Xephyr window.

Xephyr.png

Personal tools

The goal of this page is to show you how to run an OpenMoko development image on your host x86 development machine in a chrooted environment.

Build an image

First, you should use Building OpenMoko using the MokoMakefile to build an openmoko-devel-image for your host architecture (x86 in our case). Make sure you put the moko makefile in /home/moko/Makefile .

Prior to that, edit your build/conf/local.conf to make it look like this:

MACHINE = "qemux86"
DISTRO = "openmoko"
BUILD_ARCH = "i686"
INHERIT += " devshell"
SRCDATE_eds-dbus = "now"

Once you have built the image, you can start working toward running the image.

Setup the image filesystem

The filesystem of the image can be found at /home/moko/build/tmp/rootfs . It is that image that we want to run in a chrooted environment.

We will copy that that rootfs directory somewhere so that subsquent builds (using the MokoMakefile for instance) don't overwrite it.

Make sure you have root privileges:

su -

Copy the rootf into a directory called MokoBox. From now on, we will call the chrooted environment a MokoBox.

cp -r /home/moko/build/tmp/rootfs /home/moko/mokobox

make sure /dev and /proc of the host machine are visible from within mokobox

mount --bind /dev /homo/moko/mokobox/dev
mount -t proc none /home/moko/mokobox/proc

start the mokobox

chroot /homo/moko/mokobox /bin/sh

In chroot'ed environment

set environment variables

DISPLAY=:1
LANG=C
HOME=/home/root
export DISPLAY LANG HOME

Create pango.modules file

pango-querymodules > /etc/pango/pango.modules

Create gdk-pixbuf.loaders file

gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders

Remove touch screen calibrator. Since touch screen hardware is not present, the touch screen calibration prevents X start-up on PC.

rm /etc/X11/Xsession.d/30xTs_Calibrate

Starting the nested X server

Supplying fonts

You might need to install fonts supplied by OpenMoko to your host system. The easiest way to do is in Gnome is to go Preferences -> Font - > Details -> Go to font folder and then drag and drop TTF font files from build/tmp/rootfs/usr/share/fonts/ in Nautilus.

Launching Xephyr

In another terminal (not related to mokobox), start Xephyr

Xephyr :1 -ac -2button -host-cursor -screen 480x640

Now, back in chroo'ted environment, start X client:

eval $(dbus-launch)
/etc/X11/Xsession

You should see OpenMoko booting in the Xephyr window.

Xephyr.png