Meego Wiki
Views

Developing in a MeeGo Environment

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Use a Meego developer image)
(Building code in a Meego environment)
Line 112: Line 112:
For information about how to submit your code to be included in Meego, go here: TO-DO-LINK
For information about how to submit your code to be included in Meego, go here: TO-DO-LINK
 +
== Kernel Building and Development ==
== Scenarios of Making your own Meego Image ==
== Scenarios of Making your own Meego Image ==

Revision as of 23:57, 6 March 2010

Contents

Building code in a Meego environment

There are a few ways to develop your code in a Meego environment, and ensure your code is being compiled and built using the current Meego environment, toolchain, and libraries.

Using moblin-chroot

moblin-chroot is a tool that allows you to 'chroot' into an existing Meego image in order to develop within it, without contaminating your developer machine's environment. Chroot simply means to 'change the root' to a new location (so instead of your root being / on your dev machine, it will be the new root directory within the image).

This restricts access to your real root and your real file system, and instead, uses the image filesystem as its root and filesystem. No contamination, and no effect on your development machine.

With moblin-chroot, you will effectively be able to modify and manipulate the image's filesystem as if you were running a shell within an installed image, without having to install the image. When finished, you can also create a new Meego image based on your changes.

Here are the steps:

Step 1 - Download and install moblin-chroot

For details on downloading and installing moblin-chroot, go here: Image_Creation#Running_moblin-chroot

Step 2 - Download a Meego developer image

You can go here to download the latest Meego images: TO-DO-LINK

Alternatively, you can also follow this wiki to create your own Meego standard images: Image_Creation_For_Beginners

Step 3 - moblin-chroot into the image

sudo moblin-chroot <image-name>.iso

With this command, you are now transported into the root filesystem of the image. Developers can easily exchange files to and from this chroot environment using the host /parentroot. Developers can also conduct yum install, yum remove and any other network related operations.

Step 4 - Build a Meego pkg

If you would like to write a Meego package from scratch, or modify an existing Meego package and submit the change to the Meego trunk, please first read the packaging guidelines here: Packaging/Guidelines

Download the source code of the Meego package(s) you would like to modify. You can download the latest source rpms from here: TO-DO-LINK

You can also clone the source of the package (if available) from the git tree here: TO-DO-LINK

Un-pack the source rpm. There are a few ways to do this, here is one:

rpm2cpio <MyPkg>.src.rpm | cpio -idmv --no-absolute-filenames 

You can now modify the package contents, and compile code as you would normally.

You can also compile and rebuild the package like so:

rpmbuild -ba <pkg-name>.spec

Remember to check the Meego packaging guidelines if you would like to submit your code back to Meego: Packaging/Guidelines

For information about how to submit your code to be included in Meego, go here: TO-DO-LINK

Step 5 (optional) - Create new image

You can use moblin-chroot to make changes within an image's filesystem, and create a new image with these new modifications.

Simply use the "-c" flag when calling moblin-chroot like so:

sudo moblin-chroot  -c livecd <image-name>.iso

Make your modifications within the image, then type "exit". This will prompt the creation of a new image based on the changes you made within the image's filesystem. Alternatively, you can also pass "-c liveusb" to create a liveusb version.

You can also following this part of the wiki that explains how to create custom-made images: Developing_in_a_Meego_Environment#Scenarios_of_Making_your_own_Meego_Image

Using build command

The build tool sets up a build environment in a given location and then builds the package in that environment. The build environment consists of a base system and any additional packages you specify in the RPM spec file.

Requirements

  1. Install the build package for your distribution from here.
  2. Mirror the development tree locally.
  3. Download Moblin's build configuration file (attached: meego.txt)

Building Packages

As root, copy the configuration file into /usr/lib/build/configs/moblin.conf. Super user privileges are required due to usage of chroot. In the directory containing the package files and the spec file, run the following command as root to start the build:

# export BUILD_DIST=meego
# build --repo /path/to/repo/mirror --target i586

The options --repo should point to the top tree of the repository (The directory that has repodata sub-directory).

Resources

Beginner's Guide to Using Novell SUSE Linux's Build Utility

Use a Meego developer image

This method entails downloading a Meego developer image, installing it on a machine, and using that as your main developer machine when developing for your Meego-related projects.

Go here to download and install the latest Meego developer images: TO-DO-LINK

Ensure your repositories are pointing the latest sources: TO-DO-LINK

Update your system to be sure the packages are up-to-date.

sudo yum update

Develop away.

Remember to check the Meego packaging guidelines if you would like to submit your code back to Meego: Packaging/Guidelines

For information about how to submit your code to be included in Meego, go here: TO-DO-LINK

Kernel Building and Development

Scenarios of Making your own Meego Image

Before reading these sections, we suggest to first read Image Creation For Beginners and Image Creation

This will give you the basics of what you need to generate a basic Meego image.

Recreating a standard Meego Image

To create a standard Meego image, please follow the instructions in Image Creation For Beginners.

Adding more Meego packages to a Meego Image

Let's say you want to add additional Meego packages to the standard Meego image.

Adding your own code & packages to a Meego Image

Personal tools