Meego Wiki
Views

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

From MeeGo wiki
< SDK | Docs | 1.1(Difference between revisions)
Jump to: navigation, search
(Download and unpack a MeeGo image)
 
(35 intermediate revisions not shown)
Line 1: Line 1:
-
[[category:MeeGo 1.1]]
+
[[category:Meego-1.1]]
This document describes how to create a MeeGo chroot environment from a stock image.
This document describes how to create a MeeGo chroot environment from a stock image.
-
If you want a really quick method for developing on MeeGo where you don't need to build the chroot, use a MeeGo SDK download. The MeeGo SDK includes images tailored for QEMU and the needs of application development.
+
If you want a really quick method for developing on MeeGo where you don't need to build the chroot, use a MeeGo SDK download. The MeeGo SDK includes images tailored for QEMU and the needs of application development. See [[SDK/Docs/1.1/Getting started with the MeeGo SDK for Linux]] for details.
-
However, it can be useful to develop or test on a specific image, such as a recent weekly build. In this case, you may want to build your own chroot environment. However, additional disk space and manual steps may be needed to use these images; and features such as QEMU may not always be usable.
+
However, it can be useful to develop or test on a specific image, such as a recent weekly build. In this case, you may want to build your own chroot environment by following the steps below. However, additional disk space and manual steps may be needed to use these images; and features such as QEMU may not always be usable.
To help you decide what you need, here are the differences between stock MeeGo OS images and MeeGo SDK images:
To help you decide what you need, here are the differences between stock MeeGo OS images and MeeGo SDK images:
Line 20: Line 20:
* Full OS with applications
* Full OS with applications
* Don't have -devel packages by default (can be manually installed, see below)
* Don't have -devel packages by default (can be manually installed, see below)
-
* Some of the handset images have a Moorestown kernel and don't work in QEMU (yet); the Pinetrail MTF images are close to working
+
* Some of the handset images have a Moorestown kernel and don't work in QEMU; the Pinetrail MTF images work sometimes, but inconsistently
</td>
</td>
</tr>
</tr>
</table>
</table>
-
If you think an SDK download would be best, see [[Hello World - MeeGo x86 development on Linux]] for details.
 
-
 
-
Otherwise, follow the steps below to build your own chroot environment.
 
-
 
-
'''Note that the approach covered here uses an x86 CPU to build software for an x86 version of MeeGo (e.g. a netbook image).'''
 
-
 
-
== MeeGo SDK images vs. stock MeeGo images ==
 
== Pre-requisites ==
== Pre-requisites ==
-
All that's required for this is a reasonably modern Linux distribution (e.g. Fedora 11, Ubuntu 9.10).
+
All that's required for this is a reasonably modern Linux distribution (e.g. Fedora 13, Ubuntu 9.10).
== Download and unpack a MeeGo image ==
== Download and unpack a MeeGo image ==
Line 41: Line 34:
Get an image or tarball (with a UX) for either netbook or handset from one of these locations:
Get an image or tarball (with a UX) for either netbook or handset from one of these locations:
-
# Release Images
+
# '''Release images'''
-
#: The release images (well tested) can be found here:  http://meego.com/downloads/
+
#* The release images (well tested) can be found here:  http://meego.com/downloads/
-
# Recently-built Images''' <br>
+
# '''Recently-built images'''
-
#: These images have been smoke tested, but may have issues. They can be found here:  http://repo.meego.com/MeeGo/builds/trunk/.
+
#* These images have been smoke tested, but may have issues. They can be found here:  http://repo.meego.com/MeeGo/builds/trunk/.
-
#: Follow the links to the folder with the image type you want. The image file is either uncompressed (.img) or compressed (.sda.bin.bz2).
+
#* Follow the links to the directory with the image type you want: for example, you might drill down from there through ''1.1.80.4.20101102.1 &gt; handset &gt;images &gt; meego-handset-ia32-mtf''. The image file will be either uncompressed (*.img) or compressed (*-sda.bin.bz2).
-
#: Examples:
+
-
## http://repo.meego.com/MeeGo/builds/trunk/1.0.90.3.20100921.1/netbook/images/meego-netbook-ia32/meego-netbook-ia32-1.0.90.3.20100921.1.img<br/>
+
-
## http://repo.meego.com/MeeGo/builds/trunk/1.0.90.3.20100921.1/handset/images/meego-handset-ia32-aava-mtf-devel/meego-handset-ia32-aava-mtf-devel-1.0.90.3.20100921.1-sda.bin.bz2
+
=== Download tips ===
=== Download tips ===
-
* '''Network:''' If your network connection is imperfect you should use a download tool that can continue if the connection is broken, such as "wget":
+
* '''Network:''' If your network connection is imperfect you should use a download tool that can continue if the connection is broken, such as <code>wget</code>:
  $ wget --continue <link to image file>
  $ wget --continue <link to image file>
* '''Checksum:''' Verify the checksum of the downloaded image. The correct checksum is included in the MANIFEST file in the same location as the image file.  o generate the checksum from the downloaded file, run the following after downloading (on Linux, at least):
* '''Checksum:''' Verify the checksum of the downloaded image. The correct checksum is included in the MANIFEST file in the same location as the image file.  o generate the checksum from the downloaded file, run the following after downloading (on Linux, at least):
Line 59: Line 49:
The process for unpacking is slightly different, depending on the type of image.
The process for unpacking is slightly different, depending on the type of image.
-
=== Unpacking a netbook image ===
+
=== Installing MeeGo Image Creator (MIC) ===
 +
Please use the instructions at http://wiki.meego.com/Image_Creation#Installation
 +
 
 +
=== Unpacking a .img netbook image ===
<ol>
<ol>
-
<li>
 
-
Install MeeGo Image Creator (MIC): use the instructions at http://wiki.meego.com/Image_Creation#Installation
 
-
</li>
 
<li>
<li>
Unpack the image using MIC:<br/>
Unpack the image using MIC:<br/>
-
<pre>sudo mic-chroot --unpack-only -s /path/to/meego-chroot <image file>.usbimg</pre>
+
<pre>sudo mic-chroot --unpack-only -s ~/meego-chroot <image file>.usbimg</pre>
</li>
</li>
</ol>
</ol>
-
Replace <code>/path/to/meego-chroot</code> with your desired path.
+
Replace <code>~/meego-chroot</code> with your another path if this one is not suitable for your environment.
-
=== Unpacking a handset image ===
+
=== Unpacking a .bin handset image ===
<ol>
<ol>
Line 81: Line 71:
<pre>apt-get install kpartx</pre>
<pre>apt-get install kpartx</pre>
</li>
</li>
-
<li>Unpack the tarball:<br/>
+
<li>Unpack the image:<br/>
-
<pre>tar jxvf meego-0.90-preview-shcdk-20100512-001.tar.bz2</pre>
+
<pre>bunzip2 meego-handset-ia32-aava-mtf-1.1-sda.bin.bz2</pre>
-
This leaves you with a directory which contains the raw disk image you're interested in.
+
This leaves you with a raw disk image you're interested in. (meego-handset-ia32-aava-mtf-1.1-sda.bin.bz2 is a release image from http://meego.com/downloads/.)<br/>
 +
Note you need an Aava image for Atom rather than an N900 image for ARM.
</li>
</li>
<li>
<li>
Create a device map from the raw image:<br/>
Create a device map from the raw image:<br/>
<pre>
<pre>
-
cd meego-0.90-preview-shcdk-20100512-001
+
sudo kpartx -a -v ./meego-handset-ia32-aava-mtf-1.1-sda.bin
-
sudo kpartx -a -v ./meego-0.90-preview-shcdk-20100512-001-sda.bin
+
</pre>
</pre>
-
Note that this maps the first partition (p1) of the disk image onto the loop device /dev/loop0.
+
Please watch the output of this command. For exmaple, the output may be "add map loop0p1 (252:2): 0 3320312 linear /dev/loop0 1". This means that the first partition (p1) of the disk image is mapped onto the loop device <code>/dev/loop0</code>. You can then use <code>/dev/mapper/loop0p1</code> to access the partition.
</li>
</li>
<li>
<li>
Line 106: Line 96:
Remove the device map:<br/>
Remove the device map:<br/>
<pre>
<pre>
-
sudo kpartx -d -v ./meego-0.90-preview-shcdk-20100512-001-sda.bin
+
sudo kpartx -d -v ./meego-handset-ia32-aava-mtf-1.1-sda.bin
</pre>
</pre>
</li>
</li>
Line 121: Line 111:
To use the script with the unpacked chroot:
To use the script with the unpacked chroot:
-
  sudo mic-chroot /path/to/meego-chroot
+
  sudo mic-chroot ~/meego-chroot
 +
 
 +
Once you are inside the chroot, all of the standard MeeGo command line tools are available. This makes it possible to install new software using <code>zypper</code>, run applications etc.
 +
 
 +
=== Install developer packages ===
 +
 
 +
The MeeGo OS images do not have many necessary devel packages installed.  From inside the MeeGo chroot terminal, run the following to install the same set of -devel packages as the SDK image (tailor for your needs):
 +
 
 +
$ zypper install man qt-creator qt-devel make libmeegotouch-devel gcc gcc-c++ gdb wget
 +
 
 +
Note: The first time you try to install something, you might get warnings such as the following:
 +
 
 +
Building repository 'adobe' cache [done]
 +
Signature verification failed for file 'repomd.xml' from repository 'core'.
 +
Warning: This might be caused by a malicious change in the file!
 +
Continuing might be risky. Continue anyway? [yes/no] (no):
 +
 
 +
Answer ''yes'' at the prompts.
 +
 
 +
See [[SDK/Docs/1.1/MeeGo SDK with Xephyr|MeeGo SDK with Xephyr]] for more information about using a chroot for development.

Latest revision as of 10:15, 10 November 2010


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

If you want a really quick method for developing on MeeGo where you don't need to build the chroot, use a MeeGo SDK download. The MeeGo SDK includes images tailored for QEMU and the needs of application development. See SDK/Docs/1.1/Getting started with the MeeGo SDK for Linux for details.

However, it can be useful to develop or test on a specific image, such as a recent weekly build. In this case, you may want to build your own chroot environment by following the steps below. However, additional disk space and manual steps may be needed to use these images; and features such as QEMU may not always be usable.

To help you decide what you need, here are the differences between stock MeeGo OS images and MeeGo SDK images:

MeeGo SDK imagesStock MeeGo images
  • Full OS without applications to reduce image size
  • Have -devel packages installed by default
  • Handset image works in QEMU (x86 netbook kernel is used)
  • Full OS with applications
  • Don't have -devel packages by default (can be manually installed, see below)
  • Some of the handset images have a Moorestown kernel and don't work in QEMU; the Pinetrail MTF images work sometimes, but inconsistently


Contents

Pre-requisites

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

Download and unpack a MeeGo image

Get an image or tarball (with a UX) for either netbook or handset from one of these locations:

  1. Release images
  2. Recently-built images
    • These images have been smoke tested, but may have issues. They can be found here: http://repo.meego.com/MeeGo/builds/trunk/.
    • Follow the links to the directory with the image type you want: for example, you might drill down from there through 1.1.80.4.20101102.1 > handset >images > meego-handset-ia32-mtf. The image file will be either uncompressed (*.img) or compressed (*-sda.bin.bz2).

Download tips

  • Network: If your network connection is imperfect you should use a download tool that can continue if the connection is broken, such as wget:
$ wget --continue <link to image file>
  • Checksum: Verify the checksum of the downloaded image. The correct checksum is included in the MANIFEST file in the same location as the image file. o generate the checksum from the downloaded file, run the following after downloading (on Linux, at least):
$ md5sum <image file>

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

Installing MeeGo Image Creator (MIC)

Please use the instructions at http://wiki.meego.com/Image_Creation#Installation

Unpacking a .img netbook image

  1. Unpack the image using MIC:
    sudo mic-chroot --unpack-only -s ~/meego-chroot <image file>.usbimg

Replace ~/meego-chroot with your another path if this one is not suitable for your environment.

Unpacking a .bin 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

    or on non-RPM distros:

    apt-get install kpartx
  2. Unpack the image:
    bunzip2 meego-handset-ia32-aava-mtf-1.1-sda.bin.bz2

    This leaves you with a raw disk image you're interested in. (meego-handset-ia32-aava-mtf-1.1-sda.bin.bz2 is a release image from http://meego.com/downloads/.)
    Note you need an Aava image for Atom rather than an N900 image for ARM.

  3. Create a device map from the raw image:
    sudo kpartx -a -v ./meego-handset-ia32-aava-mtf-1.1-sda.bin
    

    Please watch the output of this command. For exmaple, the output may be "add map loop0p1 (252:2): 0 3320312 linear /dev/loop0 1". This means that the first partition (p1) of the disk image is mapped onto the loop device /dev/loop0. You can then use /dev/mapper/loop0p1 to access the partition.

  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-handset-ia32-aava-mtf-1.1-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 ~/meego-chroot

Once you are inside the chroot, all of the standard MeeGo command line tools are available. This makes it possible to install new software using zypper, run applications etc.

Install developer packages

The MeeGo OS images do not have many necessary devel packages installed. From inside the MeeGo chroot terminal, run the following to install the same set of -devel packages as the SDK image (tailor for your needs):

$ zypper install man qt-creator qt-devel make libmeegotouch-devel gcc gcc-c++ gdb wget

Note: The first time you try to install something, you might get warnings such as the following:

Building repository 'adobe' cache [done]
Signature verification failed for file 'repomd.xml' from repository 'core'.
Warning: This might be caused by a malicious change in the file!
Continuing might be risky. Continue anyway? [yes/no] (no):

Answer yes at the prompts.

See MeeGo SDK with Xephyr for more information about using a chroot for development.

Personal tools