Meego Wiki
Views

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

From MeeGo wiki
< SDK | Docs | 1.0(Difference between revisions)
Jump to: navigation, search
(Run the Simulator)
(Unpacking a netbook image: wikify link)
 
(45 intermediate revisions not shown)
Line 2: Line 2:
[[Category:meego-1.0]]
[[Category:meego-1.0]]
[[Category:tutorial]]
[[Category:tutorial]]
-
[[Category:advanced]]
 
[[Category:netbook]]
[[Category:netbook]]
[[Category:application-developer]]
[[Category:application-developer]]
[[Category:linux]]
[[Category:linux]]
-
'''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 create a MeeGo chroot environment from a stock image.
-
 
+
-
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).
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]].
+
If you want a really quick method for developing on MeeGo where you don't need to build the chroot, see [[SDK/Docs/1.0/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.
+
-
 
+
-
= 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):
+
-
# Download a standard MeeGo image and unpack it
+
== Pre-requisites ==
-
# Install xephyr-utils (a set of scripts for creating a Xephyr-enabled chroot)
+
-
# chroot into the unpacked image
+
-
# From the chroot:
+
-
## Install Xephyr with 3D acceleration
+
-
## Install scripts for starting MeeGo inside Xephyr
+
-
## Start the Simulator
+
-
= How to do it (the longer version) =
+
All that's required for this is a reasonably modern Linux distribution (e.g. Fedora 11, Ubuntu 9.10).
== Download and unpack a MeeGo image ==
== Download and unpack a MeeGo image ==
Line 55: Line 26:
<ol>
<ol>
<li>
<li>
-
Install MeeGo Image Creator (MIC): use the instructions at http://wiki.meego.com/Image_Creation#Installation
+
Install MeeGo Image Creator (MIC): use the instructions at [[Image Creation#Installation]]
</li>
</li>
<li>
<li>
Unpack the image using MIC:<br/>
Unpack the image using MIC:<br/>
-
<pre>sudo mic-chroot --unpack-only -s ~/meego-chroot <image file>.usbimg</pre>
+
<pre>sudo mic-chroot --unpack-only -s /path/to/meego-chroot <image file>.usbimg</pre>
</li>
</li>
</ol>
</ol>
 +
 +
Replace <code>/path/to/meego-chroot</code> with your desired path.
=== Unpacking a handset image ===
=== Unpacking a handset image ===
 +
 +
These instructions cover creating a chroot from a handset image, by mounting the image temporarily and copying its contents into a local directory.
<ol>
<ol>
<li>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)<br/>
<li>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)<br/>
-
<pre>yum install kpartx</pre></li>
+
<pre>yum install kpartx</pre>
 +
or on non-RPM distros:
 +
<pre>apt-get install kpartx</pre>
 +
</li>
<li>Unpack the tarball:<br/>
<li>Unpack the tarball:<br/>
<pre>tar jxvf meego-0.90-preview-shcdk-20100512-001.tar.bz2</pre>
<pre>tar jxvf meego-0.90-preview-shcdk-20100512-001.tar.bz2</pre>
Line 86: Line 64:
sudo mount /dev/mapper/loop0p1 ~/tmp-mnt -o loop,ro
sudo mount /dev/mapper/loop0p1 ~/tmp-mnt -o loop,ro
mkdir ~/meego-chroot
mkdir ~/meego-chroot
-
sudo cp -a ~/tmp-mnt ~/meego-chroot
+
sudo rsync -av ~/tmp-mnt ~/meego-chroot
sudo umount ~/tmp-mnt
sudo umount ~/tmp-mnt
</pre>
</pre>
Line 103: Line 81:
</ol>
</ol>
-
== Set up and enter the chroot ==
+
== Using the chroot ==
-
* [[Getting started with the MeeGo SDK for Linux#Install the meego-chroot script |Install the meego-chroot script]]
+
Chroot into the image using <code>mic-chroot</code>.
-
* [[Getting started with the MeeGo SDK for Linux#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 ==
+
To use the script with the unpacked chroot:
-
 
+
sudo mic-chroot /path/to/meego-chroot
-
From RPM???
+
-
 
+
-
== Install MeeGo SDK utils ==
+
-
 
+
-
From RPM???
+
-
 
+
-
== Run the Simulator etc. ==
+
-
 
+
-
With everything installed, you should now be able to [[Getting_started_with_the_MeeGo_SDK_for_Linux#Run_the_Simulator|run the Simulator]].
+
-
 
+
-
You could also now [[Hello World - MeeGo x86 development on Linux#Build the project with Qt Creator |continue with the "Hello World" tutorial]], as the Simulator you've built should fairly similar to packaged one (it may be missing a few libraries, but you can always [[Getting_started_with_the_MeeGo_SDK_for_Linux#Installing_other_software|install those yourself]]).
+
-
 
+
-
= 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:
+
-
 
+
-
<pre>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</pre>
+
-
 
+
-
=== Building Xephyr ===
+
-
 
+
-
<ol>
+
-
<li>[[#chroot into the MeeGo environment]]</li>
+
-
<li>
+
-
Build Xephyr inside the chroot
+
-
<pre>
+
-
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
+
-
</pre>
+
-
</li>
+
-
</ol>
+
-
 
+
-
=== 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.
+
-
 
+
-
<ol>
+
-
<li>
+
-
Copy the source code to the MeeGo chroot environment:
+
-
<pre>
+
-
cd xephyr-utils
+
-
sudo cp -a target/src ~/meego-chroot/
+
-
</pre>
+
-
</li>
+
-
<li>
+
-
[[#chroot into the MeeGo environment]]
+
-
</li>
+
-
<li>Enter the ''src'' directory and build the binary:
+
-
<pre>
+
-
cd src
+
-
make install
+
-
</pre>
+
-
</li>
+
-
</ol>
+
-
 
+
-
=== 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:
+
-
 
+
-
<ol>
+
-
<li>
+
-
<pre>cd xephyr-utils/target</pre>
+
-
</li>
+
-
<li>
+
-
<ul>
+
-
<li>'''For netbook:'''
+
-
<pre>make netbook</pre>
+
-
</li>
+
-
<li>'''For handset:'''
+
-
<pre>make shcdk</pre>
+
-
</li>
+
-
</ul>
+
-
</li>
+
-
<li>For both netbook and handset:
+
-
<pre>make install</pre>
+
-
</li>
+
-
</ol>
+

Latest revision as of 09:58, 14 April 2011


This document describes how to create a MeeGo chroot environment from a stock image.

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 chroot, see SDK/Docs/1.0/Hello World - MeeGo x86 development on Linux.

Contents

Pre-requisites

All that's required for this is a reasonably modern Linux distribution (e.g. Fedora 11, Ubuntu 9.10).

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 Image Creation#Installation
  2. Unpack the image using MIC:
    sudo mic-chroot --unpack-only -s /path/to/meego-chroot <image file>.usbimg

Replace /path/to/meego-chroot with your desired path.

Unpacking a handset image

These instructions cover creating a chroot from a handset image, by mounting the image temporarily and copying its contents into a local directory.

  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

    or on non-RPM distros:

    apt-get 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 rsync -av ~/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
    

Using the chroot

Chroot into the image using mic-chroot.

To use the script with the unpacked chroot:

sudo mic-chroot /path/to/meego-chroot
Personal tools