Contents |
This guide is a way to build packages for the MeeGo 'day one' release, before more proper developer tools are introduced.
To begin developing for the MeeGo 'day one' release, you will need to follow these steps:
mic-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 mic-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.
The developer images contain the exact same packages as is installed when you try to build a package in the MeeGo OBS without any dependencies, along with some helper packages (vim, nano) to make chroot usage easier. The list of these packages can be seen in the kickstart file mentioned above.
This is because it will in the end save you time when you want to upload your application into a builder system because it will make sure that you specify your package build dependencies correctly.
You can in the development image chroot run 'yum install <package names>' and that way install your package build dependencies to the chroot in order to compile your package.
Prerequisites:
sudo mic-chroot <image-name>
With this command, you are now transported into the root filesystem of the image. It is possible to exchange files with your normal file system through the /parentroot directory. You can also conduct yum install, yum remove and any other network related operations.
You only need to do this once, but you may want to clean up the directory and remake it once in a while.
mkdir -p ~/rpmbuild cd ~/rpmbuild mkdir -p SOURCES SPECS BUILD RPMS SRPMS
You must change directory to the location of your sources.
cd /parentroot/path/to/your/sources
If you have a source rpm (.src.rpm), you will need to extract it:
rpm2cpio <MyPkg>.src.rpm | cpio -idmv --no-absolute-filenames
This will result in a .spec file and maybe some attached files (patches, source tarball, etc). The .spec file is in this guide called package.spec.
When you have a .spec file you need to place it in ~/rpmbuild/SPECS and the remaining files in ~/rpmbuild/SOURCES.
You can see your build dependencies in the package.spec file, which is the lines starting with BuildRequires. Those packages can then be installed using 'yum install':
yum install <package names>
To build your package, you must then run the following command, where package.spec is the name of your spec file:
rpmbuild -ba ~/rpmbuild/SPECS/package.spec
Provided the build completed without errors, you can now see the resulting rpms in ~/rpmbuild/RPMS/. You can transfer these back to your filesystem through the /parentroot directory and you can then transfer these to your MeeGo device, virtual machine, etc and install them there.
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.
Specifically, there are important details about how to modify a .ks file here: Image_Creation#Modifying_your_.ks
KickStart .ks files are the main configuration file that the Image Creator uses to create images, and the brunt of what is talked about in this section has to do with modifying your .ks file.
To create a standard MeeGo image, please follow the instructions in Image Creation For Beginners.
Here is a scenario where you want to add additional MeeGo packages to the standard MeeGo image.
First obtain a standard MeeGo .ks file from here
Check the MeeGo repos and make sure that the packages you're looking doesn't already exist in MeeGo
Now within the .ks file, add the MeeGo package names that you want included in this new image. For more on how add packages in a .ks file, please read this important section here: Image_Creation#Modifying_your_.ks
Run this modified .ks file through the Image Creator MIC.
sudo mic-image-creator -c my-new-ks.ks -f livecd
For more options and details on image creation and MIC, go here: Image_Creation
Your new image will now be a standard MeeGo image including the new packages you've added.
Again, this wiki is of great value to you when manipulating and navigating through .ks files: Image_Creation#Modifying_your_.ks It is the key to mastering the art of creating custom-made MeeGo images.
If you have your own packages on your developer machine that you want to test out by creating a new MeeGo image with them.
First obtain a standard MeeGo .ks file. This is possible through the repository.
To add a new repo to your .ks file, go here for easy and detailed steps: Image_Creation#Modifying_your_.ks
Once you add the new repo(s) that the Image Creator will pull from, you now have to list the packages you want to pull down from these repos. For instructions on adding packages to your .ks file, go here: Image_Creation#Modifying_your_.ks
If you have local rpms on your local machine that you would like to include, you need to first create a local repo on your machine. Move your rpms into a directory. Then create a local repo with that directory like so:
$ mv *.rpms /home/user/my-local-repo $ createrepo -d /home/user/my-local-repo
This turns /home/user/my-local-repo into a local repository that you can point your .ks file to. For steps on how to add a new repo, go here: Image_Creation#Modifying_your_.ks
And again, make sure you have listed in your .ks all the packages you would like to include in your new MeeGo Image.
Now, simply run this new .ks file through MIC, the Image Creator.
sudo mic-image-creator -c my-new-ks.ks -f livecd
For more options and details on image creation and MIC, go here: Image_Creation
Your new image will now be a standard MeeGo image including the new packages and repos you've added.
Again, this wiki is of great value to you when manipulating and navigating through .ks files: Image_Creation#Modifying_your_.ks It is the key to mastering the art of creating custom-made MeeGo images.
Most likely cause: You have Scratchbox1 installed and you need to follow instructions given in Prerequisites for ARM.
Most likely cause: You have not run qemu-binfmt-misc.sh as root.
Most likely cause: VDSO
Do this as root:
echo 0 > /proc/sys/vm/vdso_enabled echo 4096 > /proc/sys/vm/mmap_min_addr