Meego Wiki
Views

SDK/Docs/1.0/Building a MeeGo chroot on Linux

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Enter the chroot)
(Get ready to use the chroot)
Line 103: Line 103:
</ol>
</ol>
-
== Get ready to use the chroot ==
+
== Set up and enter the chroot ==
-
 
+
* [[Getting started with the MeeGo SDK for Linux#Install the meego-chroot script |Install the meego-chroot script]]
-
* [[Getting_started_with_the_MeeGo_SDK_for_Linux#Enter the MeeGo environment|Enter the chroot]]
+
* [[v#Configure the host ready for the Simulator |Configure the host for Xephyr]]
 +
* [[Getting started with the MeeGo SDK for Linux#Enter the MeeGo environment | Enter the chroot]]
== Install Xephyr ==
== Install Xephyr ==

Revision as of 19:37, 25 May 2010


This is work in progress. It references various components which are not available publicly, but will be made available around the time of the MeeGo 1.0 release (some time in May 2010).

This document describes how to run a MeeGo desktop inside Xephyr.

You'll do this by creating a MeeGo Simulator, which consists of:

  • An unpacked MeeGo image as a chroot
  • A 3D-accelerated Xephyr server
  • A couple of scripts/executables to manage a MeeGo desktop inside Xephyr

Note that the approach covered here uses an x86 CPU to build software for an x86 version of MeeGo (e.g. a netbook image).

If you want a really quick method for developing on MeeGo where you don't need to build the Simulator, see Hello World - MeeGo x86 development on Linux.

Also note that people outside Intel won't be able to do this until we release MeeGo with a UX.

Contents

Pre-requisites

All that's required for this is a reasonably modern Linux distribution (e.g. Fedora 11, Ubuntu 9.10) running on Intel hardware. The hardware should meet the following specifications:

  • CPU: 32bit Intel(r) Atom(tm) or Intel(r) Core(tm) 2 CPU (support for SSSE3)
    • Note: MeeGo will not work on non-SSSE3 CPUs
  • A compatible Intel graphics chipset: GMA-500, Nvidia, and ATI chipsets are not supported

How to do it (the short version)

Basically, on the Linux machine (which should meet the above requirements):

  1. Download a standard MeeGo image and unpack it
  2. Install xephyr-utils (a set of scripts for creating a Xephyr-enabled chroot)
  3. chroot into the unpacked image
  4. From the chroot:
    1. Install Xephyr with 3D acceleration
    2. Install scripts for starting MeeGo inside Xephyr
    3. Start the Simulator

How to do it (the longer version)

Download and unpack a MeeGo image

Get an image or tarball (with a UX) from http://repo.meego.com/MeeGo/releases/; either a netbook or handset image.

The process for unpacking is slightly different, depending on the type of image.

Unpacking a netbook image

  1. Install MeeGo Image Creator (MIC): use the instructions at http://wiki.meego.com/Image_Creation#Installation
  2. Unpack the image using MIC:
    sudo mic-chroot --unpack-only -s ~/meego-chroot <image file>.usbimg

Unpacking a handset image

  1. Install kpartx (a tool for creating device maps from partition tables: because the handset images are raw disk images, this tool can be used to create a device map from the disk image, which can then be mounted on the filesystem)
    yum install kpartx
  2. Unpack the tarball:
    tar jxvf meego-0.90-preview-shcdk-20100512-001.tar.bz2

    This leaves you with a directory which contains the raw disk image you're interested in.

  3. Create a device map from the raw image:
    cd meego-0.90-preview-shcdk-20100512-001
    sudo kpartx -a -v ./meego-0.90-preview-shcdk-20100512-001-sda.bin
    

    Note that this maps the first partition (p1) of the disk image onto the loop device /dev/loop0.

  4. Mount the device map and copy the filesystem into the chroot location:
    mkdir ~/tmp-mnt   # temporary mount point
    sudo mount /dev/mapper/loop0p1 ~/tmp-mnt -o loop,ro
    mkdir ~/meego-chroot
    sudo cp -a ~/tmp-mnt ~/meego-chroot
    sudo umount ~/tmp-mnt
    
  5. Remove the device map:
    sudo kpartx -d -v ./meego-0.90-preview-shcdk-20100512-001-sda.bin
    
  6. Remove the temporary mount point:
    rmdir ~/tmp-mnt
    

Set up and enter the chroot

Install Xephyr

From RPM???

Install MeeGo SDK utils

From RPM???

Run the Simulator

With everything installed, you should now be able to run the Simulator.

Building everything yourself

This is only recommended if the provided RPMs don't work

You can build a Simulator in the chroot by building the two main components from source:

  • Xephyr binaries
  • Scripts and configuration

Manually building Xephyr binaries

The Simulator needs two binaries:

  • Xephyr
  • Wait4XephyrStart (a program which pauses until it detects that Xephyr is available)

Both can be built in the chroot (unless you'd rather build them using a cross-compiler on the host).

To do both, you first need to install some development tools into the chroot:

yum install --nogpgcheck gcc xorg-x11-util-macros libtool xorg-x11-xtrans-devel libX*-devel xorg-x11-proto-* \
mesa-libGL-deve mesa-dri-drivers-devel libdrm-devel openssl-devel libxkbfile-devel make git

Building Xephyr

  1. #chroot into the MeeGo environment
  2. Build Xephyr inside the chroot
    git clone git://gitorious.org/xserver-with-gl-accelerated-xephyr/xserver-with-gl-accelerated-xephyr.git
    cd xserver-with-gl-accelerated-xephyr/
    ./autogen.sh --enable-debug --enable-kdrive --enable-dri2 --enable-xephyr --with-dri-driver-path=/usr/lib/dri/ \
    --disable-xorg --prefix=/usr
    make
    make install
    

Building Wait4XephyrStart

This is part of the xephyr-utils distribution (which we already checked out on the host); but you need to build it inside the chroot.

  1. Copy the source code to the MeeGo chroot environment:
    cd xephyr-utils
    sudo cp -a target/src ~/meego-chroot/
    
  2. #chroot into the MeeGo environment
  3. Enter the src directory and build the binary:
    cd src
    make install
    

Important note

The version of Xephyr included in the RPM is actually slightly different from the one you built above. The RPM is built directly from the X server sources on OBS, with some patches applied. These patches are on their way upstream, so hopefully you should soon be able to build Xephyr from the upstream X sources rather than from the gitorious project.

Manually building MeeGo netbook SDK utils

The meego-netbook-sdk-utils package is generated from the MeeGo SDK utils project. This was started by Haitao Feng (Intel) and includes some scripts and documents to assist in the process of building a MeeGo chroot + Simulator. It is possible to install this into a chroot manually (if for some reason the packaged version doesn't work for your chroot).

The source code is here:

http://gitorious.org/xephyr-utils

You need to check these out into the chroot with:

git clone git://gitorious.org/xephyr-utils/xephyr-utils.git

The project includes some instructions in target/netbook/BUILD-MEEGO-NETBOOK-CHROOT-WITH-XEPHYR and target/shcdk/BUILD-MEEGO-SHCDK-CHROOT-WITH-XEPHYR.

Once you have checked out the source, and while still in the chroot, do:

  1. cd xephyr-utils/target
    • For netbook:
      make netbook
    • For handset:
      make shcdk
  2. For both netbook and handset:
    make install
Personal tools