Trying to create a Meego Image

In the 21st century people are surrounded by computers. Mobiles, set top boxes, netbooks, nettops, laptops, even in the car. Back in February 2010 Intel and Nokia decided to merge their Linux efforts, Moblin and Maemo, into a new distribution called Meego. When you go to the Meego site you will see that straight away that they going to design this distribution for all of these devices, making it a very interesting development. On 31st March an announcement was made that some Meego images were available, so I was keen to have a look at it. Unfortunately I managed to build an image but have not got it to run, but I thought I would document what was involved anyway. The documentation and code are actively being worked on so I hope to have a working image soon.

At the moment the Meego images on offer are fairly basic, they just boot to a command line. In May a full release is due, so this is very early days. What I would really like to do eventually is get an image that will work under VirtualBox but an image for this was not available. The pre built image for netbooks running Intel Atom processors would not run under VirtualBox so I consulted the Meego Wiki and tried to build an image. Between the weekend and today I noticed that documentation appeared that made this a bit easier on Ubuntu. The main documentation page that I followed was at:
http://wiki.meego.com/Image_Creation

The main program you need to build an image is a command line utility called “MIC”. There are two ways to get MIC: pre-packaged or build from source.

Pre-packaged MIC

This was available pre-packaged for Ubuntu, but at the time of writing the repository containing the files is missing in action. The line to add to your software sources was (note the extra / at the end):
deb http://repo.meego.com/tools/repo/xUbuntu_9.10/ /

If this is found again I will update this post with the new location. If you can get to the pre-packaged files for Ubuntu you can just install the “mic2” package and everything you need will be installed.

Build MIC from source

This method is not really recommended, particularly as I am not sure how to uninstall everything cleanly this way. Install the dependencies to build MIC. I worked these out from the requirements stated in the Wiki page and a comment on http://moblin.org/documentation/moblin-image-creator-2/requirements.
sudo apt-get install git-core yum rpm kpartx parted syslinux isomd5sum kvm zlib1g-dev python-dev dmsetup build-essential

One requirement is PyKickstart. This is not available for Ubuntu pre-packaged unless you can get to the repository. It is possible to install it manually though. First make a directory where you can work with the source code. I this example I will place it under a “src” in my home directory (~):
mkdir ~/src/pykickstart

Change to this directory:
cd ~/src/pykickstart

Now get the source code:
git clone git://git.fedorahosted.org/git/pykickstart.git

It's Python code so we do not need to compile it, instead get Python to install it:
cd pykickstart
python ./setup.py install

So now we can build the MIC image creator itself. I went for the stable version. Make a directory to work with the source code and move into it:
mkdir ~/src/mic
cd mic

Get the source code:
git clone git://gitorious.org/meego-developer-tools/image-creator.git

Now you need to determine the tag for the lastest version number, go to: http://meego.gitorious.org/meego-developer-tools/image-creator/trees/master and have a look on the right hand side. At the time of writing the latest tag was 0.17, remember this as it goes in the next command:
git checkout 0.17

Build it and install it:
make
sudo make install

Building the Meego image

Now we have MIC we can build the image. The innards of your Meego image are determined by a “kickstart” file. These describe what packages should be included, the language used, keymaps etc and also post installation scripts to be run. Full details on this format are available at: http://fedoraproject.org/wiki/Anaconda/Kickstart. Make yourself a working directory to build the image in. Note that this will also eventually contain a cache of all the packages used too.

mkdir ~/src/meego-image
cd ~/src/meego-image

I wanted the netbook image so I found the right file (at the time of writing) from http://repo.meego.com/MeeGo/devel/trunk/images/ and downloaded it:
wget http://repo.meego.com/MeeGo/devel/trunk/images/meego-preview-netbook-core.ks

As I am in the UK I made a couple of modifications to the file, setting the language to British English by replacing the “lang” entry with “lang en_GB.UTF-8”, setting the right keyboard in my case “uk” (see http://fedoraproject.org/wiki/Anaconda/Kickstart#Chapter_2._Kickstart_Options for options) and lastly setting the time zone to “Europe/London”.

Let's build! Set off the image creator with the following command, note that this process can take some time as all of the packages have to be downloaded. Various options are described on the wiki page, I chose the Qemu format as this can easily be converted to VirtualBox later. Note you need “sudo” at the start as it creates a loop device where the files will be sent.
sudo mic-image-creator --config=meego-preview-netbook-core.ks --format=raw –cache=mycache

So it built but I got a few errors, notably this output at the end which does not look good:
rpmdb: close: Bad file descriptor
rpmdb: /var/tmp/imgcreate-KJr2me/install_root/var/lib/rpm/Name: Bad file descriptor
error: db4 error(9) from db->close: Bad file descriptor
rpmdb: close: Bad file descriptor
rpmdb: /var/tmp/imgcreate-KJr2me/install_root/var/lib/rpm/Packages: Bad file descriptor
error: db4 error(9) from db->close: Bad file descriptor

After building you will have a cache directory and another directory that contains the actual image file and an XML description file.

To try the image out I started it with Qemu (substitute your own values):
qemu -m 512 -boot c -hda [DIRECTORY NAME]/[IMAGE NAME].raw

However this was not successful, I got a “boot:” prompt but it got stuck here, endlessly cycling at this point. I notice in the source code repository for MIC there is a commit today that says “Fix bootstrap errors on meego repo” with some changes that might help, so maybe the development version could be worth a try, alas I won't have the chance for a few days to try this out. If anyone knows a fix for how to get past this issue though please add it to the comments!

Comments

Hey Liam, any news about this?

Sorry, haven't had a chance to try this out again, am going to wait for a new release of the MIC tools I think.

Thanks for your sharing, I'm aiming to create a meego rom for my n900.
I'm come from http://www.meegozu.com

Hi.. it is a very good article.. keep it up.. :) Can u please help me how can i create meego images out of the source rpms. i have downloaded source rpms and trying to build the source.. but i end up with errors. i posted in Meego forum also for help.. but i didn't get any reply.. :( can you please share your knowledge with us to build the meego sources.. Thanks in advance..

Add new comment

Comments are always very welcome, but please note the following:
  • Sadly due to the high number of spam comments recently all comments are now manually moderated. You comment will therefore not appear on the site instantly.
  • Comments on this web site are monitored for spam using Mollom. By posting a comment, you accept that your message and other personal details about you will be analysed and stored for anti-spam and quality monitoring purposes, in accordance with Mollom's privacy policy.
  • Please use your own name not a company or website name to submit comments. Your comment will be removed if you don't do this.
  • All links in comments will be marked with a no follow attribute. That means posting a link to your site here won't help your search engine rankings.
  • By submitting a comment you agree that your comment can be reproduced under the same licensing terms as the rest of the content on the site.
  • Comments can be removed at any time without explanation, but won't be removed just because you disagreed with something I said.