(→Using moblin-chroot) |
|||
| Line 1: | Line 1: | ||
== Building code in a Meego environment == | == 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. | 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 == | + | === 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). | 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). | ||
| Line 48: | Line 48: | ||
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]] | 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 == | + | === 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. | 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. | ||
| Line 74: | Line 74: | ||
[http://www.novell.com/coolsolutions/feature/11793.html Beginner's Guide to Using Novell SUSE Linux's Build Utility] | [http://www.novell.com/coolsolutions/feature/11793.html Beginner's Guide to Using Novell SUSE Linux's Build Utility] | ||
| - | == Use a Meego developer image == | + | === 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. | 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. | ||
Contents |
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.
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
rpmbuild -ba <pkg-name>.spec
Step 5 - 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. 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
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
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
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.
To create a standard Meego image, please follow the instructions in Image Creation For Beginners.
Let's say you want to add additional Meego packages to the standard Meego image.