qemu-arm-eabi updated, fakeroot bug fixed, post posted

As some of you already know Lauro Venâncio maintains a version of qemu with a set of patches that provides arm-eabi compatibility (which is needed if you want to build/use PyMaemo in Scratchbox). He does so because many of these patches where not yet accepted upstream and the world can not wait.

The version of qemu-arm-eabi in the sourceforge repository included the full source of qemu from its cvs with the patches already applied. Since the qemu source was a bit old (the current version uses svn) I spent some time updating Lauro’s qemu-arm-eabi. Now the sourceforge repository includes only the patches and a script to checkout qemu source from its own svn and apply the patches with quilt. There are also scripts to build and install the qemu-arm-eabi in scratchbox.

But nobody expects that a new bug would crawl in. When running a program through fakeroot and that program tries to call popen libfakeroot will not be found. I find out that the problem was in the fakeroot-tcp script that was using ‘,’ as separator in the environment variable SBOX_PRELOAD. This works with the qemu versions provided by scratchbox, but not with our patched version. I take a look at the scratchbox patches and other places for the source of the problem and found nothing. Since my time to deal with this was limited I just changed ‘,‘ to ‘:‘ in fakeroot-tcp. This worked fine when you do “fakeroot ./progthatusespopen” but Jesus couldn’t do a “dpkg-buildpackage -rfakeroot“. Caio (from Canola fame) solved this by removing the separator and the second item of the SBOX_PRELOAD variable.

The fix described is not the best but works for now. If you have any idea on how to solve this in a proper way your help is appreciated.

Instructions on how to install in the qemu-arm-eabi wiki.

Maemo SDK Appliance, release 0.6 “Be kind.”

New vm appliance everybody, the last one was redone from scratch because of some problems with Open VM Tools, and I managed to miss other things too, like the hildonmm development packages. ><

This one, even still made by a humble human, should be (almost (i hope)) bug free. As usual updates to the packages included, check the changelog:

  • The latest PyMaemo.
  • Eclipse with CDT 4.0.2, PyDev 1.3.14 and ESbox 1.3.6 plugins.
  • Using Open VM Tools ver. 2008.02.13-77928.
  • Using kernel for virtualization.
  • Scripts to automate image creation.
  • EFL (ecore, evas, etc. and python-evas) installed from extras repository (instead from CVS source).
  • Nokia Binaries installers fixed.
  • Vala not included in this version.

Download in the website.

ESBox Rápido e Fácil

Não é um curso, nem um livro milagroso, apenas um scriptzinho bash. E pra falar a verdade, o “rápido” no título depende muito da sua conexão.

O ESBox é um plugin pro Eclipse que ajuda um bocado a programar pra plataforma Maemo. Ele incluin suporte a C, C++ (><) e Python. Como ele depende de versões específicas dos plugins CDT e PyDev, e do próprio Eclipse, pode se tornar chato de instalar, pra mim mais chato ainda, porque tenho de fazer isso de tempos em tempos pro Maemo SDK VMware Appliance. Se algo fica de fora tenho de andar na prancha. Não mais! Esse script aqui [install_esbox.sh] instala tudo, do Eclipse pra cima até chegar no ESBox. Só não instala o Scratchbox e o Maemo, esses ficam por sua conta.

Resta apenas configurar o interpretador Python a ser utilizado pelo PyDev. Siga estas instruções.  Não consegui encontrar o arquivo onde o Eclipse (e o PyDev) guarda  as configurações. Chave GConf também não foi achada.

<dearlazyweb>Se alguém souber onde fica guardada a informação de qual interpretador usar, me avise.</dearlazyweb>

Ah, quem já conhecia o Projeto ESBox vale uma outra olhada no site deles que tá novinho em folha.

Resizing Maemo SDK VMware Appliance Virtual HD

I’ve received some suggestions to increase the Maemo SDK VMware Appliance virtual hd size in the next release, which is now about 6.5G, and also questions about how to extend its size right now, with the users own hands. In this post I explain the later in the form of a how to.

The tools needed are qemu-img and a livecd iso of RIP (Recover Is Possible) Linux distribution. It could be any small recorver distro you like, but this just do fine for me. You can do this operation from a Windows box if (for some reason) you want to, since the only tools needed in the host system are the said qemu-img, the RIP Linux iso and a VMWare Player.

Now to the How To.

1. Convert the virtual disk from VMDK to qemu raw format.

The virtual hd file if of the vmdk format and we need to convert it to the resizable qemu raw format.

$ qemu-img convert -f vmdk maemo-sdk.vmdk -O raw maemo-sdk.raw

2. Resize it.

I will use 10G, and from this point on the numbers used will reflect it. If you want a different size, check the values you supply for the tools used in this tutorial.

$ dd if=/dev/zero of=maemo-sdk.raw seek=10240 obs=1M count=0 conv=notrunc

The dd command will fill with zeros from the current end point of the virtual hd file to the size supplied in the seek parameter, in this case 10240 blocks of size indicated by obs=1M.
If the output appears as nothing have happened, do just like me and ignore it.

3. Convert it back to VMDK
Delete the original

qemu-img convert -f raw maemo-sdk.raw -O vmdk maemo-sdk.vmdk

4. Resize the partition inside the guest system.
With the virtual hardware changed, you go up to the filesystem level, but you have to do it from another system than the installed on the guest, thus we will work from the RIP live cd, running it on VMware.

4.1. Download the non-X version, for we will use only the shell for this job. Put it in the same directory of the vmware image.

Here: http://www.tux.org/pub/people/kent-robotti/looplinux/rip/RIPLinuX-4.3.iso

4.2. Now, edit the vmx file, which is the one that describes the virtual machine to VMware Player. Search for this line

ide1:0.present = "FALSE"

Comment it and add the following

#ide1:0.present = "FALSE"
ide1:0.present = "TRUE"
ide1:0.autodetect = "FALSE"
ide1:0.startConnected = "TRUE"
ide1:0.fileName = "RIPLinux-4.3-non-X.iso"
ide1:0.deviceType = "cdrom-image"

4.3. Boot the RIP live cd image.
With this you can boot from the live cd image. You can, but the vmplayer will not do it, unless you restart the virtual machine and press ESC when it begins to initialize, then select the option to boot from the cd-rom.

4.4. Delete all partitions in the virtual hds.
No, i’m not crazy, and you will not lose anything. At least if follow these instructions. 🙂
Log in to the RIP system as root, and get the hammer, i mean, call fdisk in the command prompt.

# fdisk /dev/hda

Notice that even this being an step by step guide, some familiarity with fdisk is desirable to understand what is happening. And as said before the numbers used as parameters are valid for this specific case: resize the Maemo SDK Appliance, version 0.4, to 10G.

Now, you should see the fdisk’s prompt, issue a print command to see the current state.

(fdisk's prompt): p

And the following commands should remove the current partitions.

(fdisk's prompt): d

Answer 1 to remove the root partition, repeat the command and answer 2 to remove the swap.
Check again to see that they’re gone:

(fdisk's prompt): p

And write the changes and quit with

(fdisk's prompt): w

4.5. Recreate the partitions with the new sizes.
Call fdisk again, and issue a “new” command:

# fdisk /dev/hda
(fdisk's prompt): n

Answer the questions that will appear with these values:
p, to create a primary partition
1, for the number of the partition
1, for it to start in the first cylinder
21529, for the last cylinder of this partition (cylinders are so old school 🙂

Now for the swap partition.

(fdisk's prompt): n

Then answer:
e, for extended partition
2, for the number of the partition
And accept the default values for the two following questions, which are about the first and last cylinders. This will give the remaining disk space (about 300M) to the swap.

Inside the extended partition we create the logical partition, where the swap will live.

(prompt do fdisk): n

l, to create the logical partition
And accept the default values for this logical partition fill the extended one.

Finally, we change the type of the last partition from Linux (its default) to Linux SWAP.

(prompt do fdisk): t

Answer 5, and then 82. The number of the partition and the code for swap, respectively.

Write the changes and get out.

(prompt do fdisk): w

And for the very last step of this part, you setup the swap as true swap.

# mkswap -v1 /dev/hda5

4.6. Check the root partition…

# e2fsck -f /dev/hda1

4.7. … and resize it.

# resize2fs /dev/hda1 9934M

4.8. Now, reboot with

# shutdown -r now

5. Try it on vmware player.
After the shutdown command it will boot normally, ignoring the live cdrom (even it still being setup on the vmx file, from item 4.2 of this how to; you should restore the vmx file to its early state).
Now open a terminal on the guest system and issue the df command:

$ df -h

The new size should be 9.6 G as in this line

/dev/sda1 9.6G 4.7G 4.6G 51% /

Notice that for some mysterious (to me) reason the virtual harddisk now show up as /dev/sda instead of /dev/hda, but it works anyway.

This is it, any problems drop me a comment.

Como todos disseram hoje: Nokia Compra Trolltech

Nem ia falar sobre isso, mas comecei a comentar no blog do Danilo, então vou colocar algo aqui. Como estou preguiçoso, já falei um tanto sobre o que penso da Qt faz um tempo e, mais importante, como quem muito fala pouco coda, vou apenas citar um trecho de um comentário no Slashdot:

GPL for apps, LGPL for libraries. It’s scary to a commercial enterprise, but it really works – at least better than anything else (except, maybe, having a monopoly on desktop operating systems…).

Maemo SDK Appliance, release 0.4 “Not So Fat”

Finally the new version of the appliance, and it is “Not So Fat” as we expected, since it is loaded of good stuff. See the Release Notes:

This release is loaded with a lot of goodies: Maemo 4.0 (Chinook) final and Maemo 3.2 (Bora) with Nokia Binaries Installer, PyMaemo packages, Vala compiler and its Hildon bindings for Chinook, Maemomm libraries, EVAS (Bora and Chinook, but i386 only), qemu-arm-eabi used as default cpu transparency method, Eclipse with ESbox plugin, and Firefox has now a lot of bookmarks for reference material. There are code samples for all the libraries and development packages cited above.

Checkout the ChangeLog entry:

* Scratchbox installed from official Debian Repository.
* Maemo 4.0 (Chinook) release.
* Maemo 3.2 (Bora) (the last release was using 3.1)
* Use the qemu-arm-eabi as default cputransp method
* Nokia Binaries Installer for Chinook and Bora
* Added a lot of bookmarks in Firefox for reference material.
* Maemomm (C++ bindings) added, with
code samples.
* EVAS libraries added to Bora and Chinook i386 targets, along with code samples.
* Eclipse with CDT 4.0.1 and ESbox 1.2.0 plugins.

Watch a screencast on Google Video (YouTube doesn’t like Ogg/Theora, and I’m feeling very lazy to bother converting) with a sample session of using Eclipse with the ESbox plugin to create a Maemo project. For a higher resolution version, download the ogg.)

Download torrent from PirateBay (prefer this way; yarrr!):

Or direct download in two parts:

You will need 7zip to unpack the files.

Update: direct download link fixed. Thanks tabrez. 🙂

Qemu ARM EABI no Scratchbox

Se você está usando o PyMaemo deve ter reparado na mensagem de erro "sem_post: Function not implemented" quando chama o Python2.5 no target ARMEL do Chinook. Isso tem a ver, entre outras coisas, com funcionalidades não implementadas na versão do Qemu usada no Scratchbox. O Lauro Venâncio reuniu os patches necessários pra modernizar esse bicho, criou um projeto no SourceForge e pretende mantê-los sincronizados com o head do CVS do Qemu até os caras se dignarem a implementar as melhorias.

Se você quer usar o Qemu ARM EABI em seu Scratchbox, siga as instruções abaixo. Lembre de fechar quaisquer seções abertas do Scratchbox.

Compilar o Qemu ARM EABI

Na máquina host, instale o gcc-3.4 e baixe o qemu com os patches já aplicados.

$ sudo apt-get install gcc-3.4
$ svn co https://qemu-arm-eabi.svn.sourceforge.net/svnroot/qemu-arm-eabi/trunk qemu-arm-eabi
$ cd qemu-arm-eabi
$ ./configure --target-list=arm-linux-user --static
$ make

Update: o luck sentiu falta da zlib no processo de compilação:

$ sudo apt-get install zlib1g-dev

Update 2: o lauro resolveu organizar o repo dele, criando branches, tag e trunk. As instruções acima foram atualizadas.

Instalar no Qemu ARM EABI no Scratchbox

Como se pode ver, o binário gerado foi linkado estaticamente, então nada de dependências cabulosas, basta copiar para o lugar certo:

$ sudo cp arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2

Edite o cputransp-methods:

$ sudo vim /scratchbox/devkits/cputransp/etc/cputransp-methods

e adicione a linha:


Depois edite o arquivo config do seu target (ou dos targets) ARMEL:

vim /scratchbox/users/USERNAME/targets/SDK_ARMEL.config

e altere a variável do método de transparência do CPU para:


Veja também:

Notificator Tabajara 3000

Não tem coisa mais chata do que esperar algum processo demorado terminar, naturalmente vou fazer outra coisa (normalmente não tão emocionante quanto meus vizinihos), mas aí ou acabo esquecendo de verificar se o negócio terminou, ou fico neurótico olhando o tempo todo. Pra acabar com essa besteira fiz um notificador em Python [source]:

import dbus
import sys
if len(sys.argv) > 1: id = '"%s" is done.' % sys.argv[1]
else: id = 'Whatever it is, it\'s done.'
my_bus = dbus.SessionBus()
proxy = my_bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
notifier = dbus.Interface(proxy, 'org.freedesktop.Notifications')
notifier.Notify('Notificator', 0, '/usr/share/icons/Tango/scalable/emotes/face-monkey.svg', 'Work done!', id, '', {}, 5000)

A idéia é chamá-lo junto com o processo demorado:

$ find ~ -name "*" ; notificator.py

Então, quando você menos esperar, esse macaco vai pular na sua cara:

Work Done!

Como se pode ver pelo código, você também pode acrescentar informação sobre qual processo terminou:

$ find ~ -name "*" ; notificator.py “find command”

Agora, meu jabá: veja mais no artigo sobre DBus no site do CInLUG.