Meego Wiki
Views

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

From MeeGo wiki
< SDK | Docs | 1.1
Revision as of 11:40, 18 October 2010 by Elliot (Talk | contribs)
Jump to: navigation, search


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 Hello World - MeeGo x86 development on Linux.


Contents

MeeGo SDK images vs. stock MeeGo images

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) for either netbook or handset from one of these locations:

  1. Release Images

The release images (well tested) can be found here: http://meego.com/downloads/

  1. 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 folder with the image type you want. The image file is 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
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

  • 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.

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 /path/to/meego-chroot <image file>.usbimg

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

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

    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