Subscribe to News

Funambol - Creating a moblin dev env

Author : XayOn

From TechnologicalWiki

Jump to: navigation, search
FunambolPush TecnhologiesDevice SynchronizationDevice ManagementConfiguringCreating a moblin dev envProblemsGlossaryMore info

Contents

Setting up a moblin dev environment

Depending on your needs you may want to have a moblin standard image for dev or a moblin developement image. Moblin developement image is (obviously) aimed at developers, including dev tools and headers.

For a standard image you won't need to build it. You can get one built and mount it with moblin-chroot or virtualize.

Mounting a chroot with moblin

Moblin dudes have a great tool for that called moblin-chroot, it makes things easier but sadly you've got to be luck to get it working.

Also, it's resource expensive, each time you launch it against an image it'll unpack it, losetup it against a loop device, mount it and bindmount required directories

Be careful, it's resource expensive, also on't forget to check the md5 of the image.

Creating an image with moblin-image-creator

Moblin image creator seems to be a great tool, but has some problems. It can take up to 1h to create each image with a powerful dsl connection, if process fail, it's hard to debug why. I've had problems with some broken rpm on their repository for days, and believe me, it's not nice.

Also moblin image creator wont save logs or be verbose (somehow actually those options are not working (git commit 10f0c3129b46723c6b47228305ff1ce62db15c83)

To use moblin image creator, get it from their git and build it.

  git clone git://git.moblin.org/moblin-image-creator-2 
  make -C moblin-image-creator-2 && make install -C moblin-image-creator-2

Now, read the manpage, basically it'll work like this

   sudo moblin-image-creator --config=moblin-image-creator-2/examples/netbook-core.ks --format=raw --cache=/tmp/moblin

Where format can be raw, vmdk and loop and netbook-core.ks is the config file (change it if you want the dev version)

It'll build the image, but of course it's not guaranteed that i'll work i'd rather say that It'll probably fail, If there is a broken rpm pacakge in their repo It will not build the image and will be hard to debug (as rpm errors/warnings are frequent, just some of them are critical), as said before. ATM (5-oct-2009) repos are ok.

Note: Creating a image of core with loop as output will have a similar end that using moblin-chroot.

Emulating image

Qemu

If you've got a kvm-capable processor you can use qemu to emulate it with just something like

   qemu -hda *.raw -boot c

VMWARE

You'll need to create it in vmdk format. Take in account that vmplayer will need the creation of a config file, or using a vmware server. I managed to get a config file, more or less with some tweaks it works.

Debian package for vmware (vmware-package) is broken on karmic.
Installing VMWare in karmic is not a nice process, also, the rpm itself is just an installer, so it's no use to debianize it.

I've simplified the process in this:

   apt-get update && apt-get dist-upgrade && reboot 
   apt-get install yum libexpat1 libsexymm2 libview2 linux-headers-`uname -r`
   ln -s /usr/lib/libexpat.so.1 /usr/lib/libexpat.so.0
   rpm --force-debian VMWAREfoobar.rpm && /var/cache/vmware/VMware-Player-*

That will dist-upgrade your sistem (so you'll be able to get the sources of your kernel, optional) That's possibly not necesary in debian, but in ubuntu they drop kernel sources too early. Then, you install the deps and the kernel headers, link expat to make it think you've got expath0, force the installation of the VMPlayer rpm (change foobar for the name of your rpm ) and launch the installer (That's it, a rpm for the installer... no comments) Next time you start vmplayer (do it as root) It'll build vbox modules.

Here is the vmx file, I've got to fight to get it. I've explained some obvious thinks trough comments:

  #!/usr/bin/vmplayer .encoding = "UTF-8" config.version = "8" virtualHW.version = "4"
  guestOS = "other26xlinux" # Type
  displayName = "Moblin" # Name
  numvcpus = "1" # Number of cpus
  memsize = "320" # Mem size in MB
  MemAllowAutoScaleDown = "FALSE"
  MemTrimRate = "-1"
  uuid.action = "create" # Auto create uuid
  hints.hideAll = "TRUE" 
  tools.syncTime = "TRUE"
  usb.present = "TRUE"
  usb.generic.autoconnect = "FALSE"
  isolation.tools.hgfs.disable = "FALSE"
  isolation.tools.dnd.disable = "FALSE"
  isolation.tools.copy.enable = "TRUE"
  isolation.tools.paste.enabled = "TRUE"
  ethernet0.present = "TRUE"
  ethernet0.virtualDev = "vlance"
  ethernet0.connectionType = "nat"
  ethernet0.addressType = "generated"
  ethernet0.generatedAddressOffset = "0"
  ide1:0.present = "TRUE" 
  ide1:0.deviceType = "cdrom-raw"
  ide1:0.startConnected = "TRUE"
  ide1:0.fileName = "auto detect"
  ide1:0.autodetect = "TRUE"
  ide0:0.present = "TRUE"
  ide0:0.fileName = "foo.vmdk"
  ide0:0.mode = "persistent"
  ide0:0.startConnected = "TRUE"
  ide0:0.writeThrough = "TRUE"

Now just launch vmplayer with the vmx file

VirtualBox

Virtualbox-ose will not make X work, however, virtualbox from sun with 3d acceleration and PAE/NX activated will work ok.
Note that actually it'll fail with 2.1 preview iso image. Building with mib2 works just fine with virtualbox 3.0.6.

To install virtualbox-sun on ubuntu jaunty or newer use:

 echo "" > /etc/apt/soures.list.d/virtualbox && apt-get update && apt-get install virtualbox

It'll ask you to auto-build the modules, ask yes and you'll get a working virtualbox installation.

Create the vm, now enable 3d as shown in the screenshot (in your new vm config):

Image: Vbox3d.png

And PAE/NX:

Image: PAE-NX.png

Main Collaborators