Thursday, January 13, 2011

plymouth

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.

Update:
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/libplybootsplash.so.2.0.0. 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.

No comments: