Sunday, January 30, 2011

Mozilla Dash

I am on FF 4 beta 10 and I installed this addon. It was highly hyped at many sites. However, it was a bit of disappointment.

  • It is not intuitive enough
    • Even after being a heavy internet user, I had to struggle to get back my tabs
  • It does not show the url
    • This might be a good thing that you can search and find links. But, how do I make sure that the search result is correct and I am on the expected link? This is a problem especially when I am on sites that do financial transactions. 
  • The UI was not up to the mark. I could see that the fonts of menu items were cut at bottom half
Well, so, whats good about it? Its still experimental. We can hope that it will get improved :)

Monday, January 24, 2011


For a long time, I used to look at .PHONY targets in makefiles and wonder how useful those targets were. Today, I found the usefulness while playing with prelink (more on prelink later).

I created the following files and folders while doing this:

[root@sarin prelink]#ls -l
total 20
drwxr-xr-x 2 root root 4096 2011-01-24 11:14 bin
drwxr-xr-x 2 root root 4096 2011-01-24 11:14 lib
-rw-r--r-- 1 root root   57 2011-01-24 10:41 libutil.c
-rw-r--r-- 1 root root  273 2011-01-24 11:14 Makefile
-rw-r--r-- 1 root root  343 2011-01-24 10:56 prelink.c
[root@sarin prelink]#cat Makefile
all: bin

lib: libutil.c
        gcc -shared -Wl,-soname, -o lib/ libutil.c

bin: lib prelink.c
         gcc -L/root/c/prelink/lib prelink.c -Wl,-rpath,lib -lpthread -lutil -o bin/prog

        rm -f lib/ bin/prog

Now, I did a make clean and did a make. Nothing happened. I got the message that "make: Nothing to be done for `all'.". If you notice, in the make file, target all had a dependency on 'bin'. Target 'bin' was dependent on target 'lib'. So, I was expecting that lib will be built first and then bin. But, It did not even try to build bin (I verified this by putting an echo in bin). After a long struggle, I found the reason.

As you can see, 'bin' and 'lib' were the names of two folders inside the current directory. So, make assumed that targets 'bin' and 'lib' where those folders. As these sub-folders were already present in the current folder,  it assumed that there is nothing to be done for target all.

This is the issue that .PHONY target fixes. It clearly tells make to avoid looking at files and folders for these names. I added the following line to the top of the makefile.

.PHONY: all bin lib
Thats it,  I was able to compile the program using my makefile!

Friday, January 21, 2011

Kernel oops

I had to look into a kernel oops recently. This was produced on a ARM machine. It was relatively easy to understand this message. These messages have become much more simple to analyse these days. I am making this quick post to remember one register: LR

LR: This register holds the address to which PC will be set to once you hit return. This simply means, this is the caller of the function where the trouble occurred.

The point where failure happened can be seen by looking at PC. Also, SP points at the current stack location. When I scrolled down, I could see some good back tracing information too.

Thursday, January 13, 2011


I have been looking for the source of rhgb and I was not able to find this source. Today, I somehow wanted to find this out and spent some time with yum. Eventually I found that this comes with plymouth (for Fedora-12). I am yet to find out how these two are related. I could see this:

1. There is a /usr/share/plymouth folder
2. The themes are present in this folder
3. There is a default.plymouth file which tells which is the default theme
4. plymouth uses png files to create animation
5. There is a text theme that can be (seems to be) altered easily by changing the ply-text-display.c (Needs to verify this)

Well, more on this after I play with this a bit more. :)

Update-1: Plymouth starts from initrd itself. So, modifying the stuff on the root file system will not help much. It has to go to initrd. I was able to change default.plymouth link in initrd and change from charge theme to text theme without much issue.
Update-2: While working with initrd, I found that fedora is now using darcut instead of old initrd. Will write about it later when I get some time to study it.

I tried modifying and recompiling the plymouth (version 0.8.0) and tried it on Fedora 12. The file that was modified was ply-text-progress-bar.c. The file can be found in src/libplybootsplash folder inside the plymouth package. I changed two functions get_os_string and ply_text_progress_bar_draw. The first function is very custom made function to read /etc/system-release file and get the OS name and version (Fedora 12). So, though modifying /etc/system-release might work in general, it is simpler to modify the function itself. The second function decides the colors of the progress bar and also the background and foreground color of the OS string. I modified the colors there so that the effect can be seen easily.

The code was compiled and I found that the o/p is present in src/libplybootsplash/.libs/ This was copied to /usr/lib of initrd and I recreated initrd using this command
find . | cpio -H newc -o > ../ply-test.img. Later I gziped it and moved it to /boot (gzip -9 ply-test.img && mv ply-test.img.gz /boot/ply-test.img). I also modified grub config to create a new entry with this initrd. Once I rebooted, I could see the changes in the plymouth screen.

I am currently thinking if I should use this or I should use some graphical theme. May be changing a few functions, I can change the logic of drawing this progress bar and draw some other pattern. But, for changing a graphical theme, I may only have to change the images and that might have a better effect too. Anyway, plymouth seems to be in control and I will now move to something else. I want to revisit the qemu as I found that it is taking about 10 times more resources compared to vmware. I will see if using the qemu from android project gives me any advantage or not.

Friday, January 7, 2011

Compiling qemu on windows

I started doing this today by following this page. However, I was always getting this error that config-all-devices.mak not found. I googled and found some patches. However, something told me that this is not a patch issue. So, I decided to look again and then saw this funny message "-uThe system cannot find the file specified."

This was actually getting caused due to incorrect sort being used. I had the windows programs in my path and a 'which sort' clearly told me what was going wrong.

bash-3.2$ which sort
A change in path declaration fixed this issue

PATH=/home/lassauge/MyDocuments/Qemu/libusb-win32-device-bin-$PATH CFLAGS="-O4 -march=i686" \


PATH=../libusb-win32-device-bin-$PATH CFLAGS="-O4 -march=i686" \ 

Anyway, I have not completed the build. Currently I am getting some usb library related errors. Will update this post once I completely compile this.


Completed this build. Though the above fix removed the error, it did not create the proper config-all-devices.mak. So, I had to manually create this by running the appropriate command

 cat i386-softmmu/config-devices.mak | grep =y | sort -u > config-all-devices.mak

Again, I got the error that isa vga device was not created. So, again, I manually entered the as a dependency for target "all" in the Makefile.hw.
Also, it did not pickup the usb library include folders correctly. To fix this, I added the following to config-host.mak
CFLAGS=-O2 -g -O4 -march=i686 -I../libusb-win32-device-bin-

Another issue was the fmod libraries needed absolute path. I changed that also in the configure script. However, usb libraries worked fine with relative path from qemu folder. I think, fmod would have got linked from a sub-folder inside qemu where as the usb lib would have got used from the qemu folder itself. Anyway, I am running the qemu compiled my me :)

Thursday, January 6, 2011

CES 2011

Smart phones -- read Androids :) --, tablets are ruling CES 2011.

Not that easy to watch it, hundreds of updates are coming per minute.