The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Platform SDK

From Mer Wiki
Revision as of 08:55, 13 February 2012 by Timoph (Talk | contribs)

Jump to: navigation, search

Contents

Mer platform SDK

To avoid any confusion, there are two types of SDKs: Application SDKs and Platform SDKs. Application SDK's are the ones that deal with Qt applications and libraries, HTML5, etc, while Platform SDK's are for developing the platform, compiling native code and other things revolving around the platform developer/hacker needs.

The platform SDK aims to offer a installable disk image that can be run on virtual machines (typically) or actual hardware, which contains tools like Scratchbox2, MIC (image creator), spectacle, osc, qemu, etc preinstalled, to make it easier for a developer to work with Mer.

Please note that the platform SDK is a work on progress. The work for making the sdk was kicked off January 13 2012. If you are willing to contribute to the effort, please do so.

Using the platform SDK

Please note that this is a DRAFT and not all bits and pieces are in place yet. Also things might and most likely will change.

Installation / setup

The platform SDK is provided as a rootfs tarball that contains essential tools for Mer platform development along with a helper script to enter the rootfs.

Please note that the platform SDK requires that you're using a Linux distribution (one in a virtual machine works as well).

To setup the SDK:

  • Create directory for the SDK rootfs and download the latest stable SDK rootfs tarball
mkdir $HOME/mer-sdk && cd $HOME/mer-sdk
curl -O url_to_be_defined
  • extract the tarball as root or with sudo
sudo tar xzvf mer-platform-sdk-latest-stable.tar.gz

Entering chroot

The platform SDK rootfs contains a helper script to enter the chroot named 'enter-chroot.sh'. The helper script is located the the root directory (/) of the rootfs.

to enter the rootfs with the helper script do

sudo $HOME/mer-sdk/enter-chroot.sh $HOME/mer-sdk

SDK contents

The platform SDK's rootfs has some useful packages preinstalled that are listed below. If you're missing something you can use zypper to install the needed extra packages or if not available in the repositories compile them yourself.

TODO

Compiling with the SDK

The SDK uses scratchbox2 for cross compilation and has the targets supported by Mer preconfigured. The target names are the names of the target architectures listed below. To cross compile one does something like this:

sb2 -t armv7hl gcc hello.c -o hello

You can also compile your sources without scratchbox2 by calling gcc directly inside the SDK chroot. Please note that binary from this compilation might not work with your target device.

gcc hello.c -o hello

scratchbox2 targets

TBD

Building an image

Mer images are build using mic image creator. Mic takes a kickstart file that defines the image to be created as input. To create a Mer image with the platform SDK simply call mic as you would do on any other system. For example

mic cr loop your-kickstart-file.ks -o image --pkgmgr=yum

Packaging

The SDK includes tools needed to create rpm packages for Mer.

TODO

Hosting repositories

To make installing created packages easier you can host your own rpm repository with the SDK and install packages to your target device from there.

TODO

Development Documentation

Below you will find information about the development of the platform SDK itself.

Requirements

The following requirements were agreed on the initial platform sdk brainstorming meeting (things may change)

  • Platform SDK needs to be able to function without an OBS account or access to an OBS.
  • Offline compilation must be possible
  • Clearly document the difference between platform SDK and application SDK.
  • Document the SDK tools for easier porting to new Linux distributions (if all SDK tools, and nothing else, comes from a single OBS project, that might be enough documentation).
  • seperation of user /home and 'sdk'
  • need short path from: code, build, deploy, boo
  • minimal http server to SDK for built rpm repo serving

Goals for the first version (Proposal)

The target is to provide a Linux distribution agnostic SDK in form of rootfs image to enable people working on Mer to compile, package and hack on Mer offline and without OBS access.

The initial version should contain the following

  • Mer rootfs
    • working zypper, etc
  • script to setup mounts
    • Mounts host root and users home from host
  • Cross compilers
    • scratchbox2
    • x86
    • arm
    • mips
  • packaging tools
    • spectacle, etc.
  • image creation tools
    • mic
  • Documentation
    • howtos, etc.

Work so far

QA

TBD

SDK team meeting minutes

Usefull links and further reading

Personal tools