Month: July 2009

Adding support to WSVGA LCD on kdrive

This is the way I got a 800×600 LCD working on kdrive:

Edit xorg-server-1.4.2/hw/kdrive/src/kmode.c and add:

    {   800,    480,    60,     33030,
        0x68,  0x67,    16,     KdSyncNegative,
        15,    15,    64,     KdSyncNegative,
    },

Start your kdrive this way:

Xfbdev -screen 800x480x60 -ac -mouse tslib,,device=/dev/input/event1 -mouse mouse,,protocol=ps/2 -keybd keyboard &

Erro de compilação do webkit

Tive problemas “cross-compilando” o webkit para ARM:

WebCore/css/CSSParser.cpp:4947: error: expected initializer before '*' token

WebCore/css/CSSParser.cpp:4948: error: 'hashTableEntry' was not declared in this scope

Este erro acontece quando você começa a compilar o webkit e ele detecta a falta do binário “gperf”. Ai você instala o gperf e continua a compilação, então o erro aparece e não adianta dar “make clean” e tentar novamente, o erro continuará aparecendo.

Solução: apague o diretório de instalação e comece tudo novamente.

Fonte: http://groups.google.com/group/chromium-dev/browse_thread/thread/f08878972a5836d2?pli=1

Descobrindo a versão GLIBC

Para saber com qual versão da GLIBC uma determinada biblioteca de vínculo dinâmico foi “linkada” use:

$ objdump -p /lib/libm.so.6
...
Version definitions:
1 0x01 0x0905f4e6 libm.so.6
2 0x00 0x0d696910 GLIBC_2.0
3 0x00 0x0d696911 GLIBC_2.1
	GLIBC_2.0 
4 0x00 0x0d696912 GLIBC_2.2
	GLIBC_2.1 
5 0x00 0x0d696914 GLIBC_2.4
	GLIBC_2.2

Version References:
  required from ld-linux.so.2:
    0x0963cf85 0x00 07 GLIBC_PRIVATE
  required from libc.so.6:
    0x09691f73 0x00 08 GLIBC_2.1.3
    0x0d696910 0x00 06 GLIBC_2.0

Error setting U-Boot ethernet MAC

If you are getting error when trying to setup MAC address (variable ethaddr) on U-Boot:
=> setenv ethaddr 00:04:9F:00:AF:DF
Can’t overwrite “ethaddr”

Then you can follow this procedure:

1) Found the flash area where environment are saved (“RO” areas):

=> flinfo
...
  C1F80000        C1FA0000        C1FC0000        C1FE0000   RO   C1FE8000   RO 
  C1FF0000   RO   C1FF8000   RO 

Un-protect these areas:

=> protect off C1FE0000 C1FFFFFF
Un-Protected 4 sectors

Erase these areas:

=> erase C1FE0000 C1FFFFFF

.... done
Erased 4 sectors
=> 

Protect these areas again:

=> protect on C1FE0000 C1FFFFFF
Protected 4 sectors
=> 

Reset the board

Set ethaddr:

=> setenv ethaddr 00:04:9F:00:AF:DF

Getting git revision by specific date

Few time ago (years) I explained how to get a specific subversion revision by date (portuguese article):

https://acassis.wordpress.com/2007/09/08/baixando-fonte-de-repositrio-subversion-por-data

Today I faced the same situation but using git. Bad news: git doesn’t have –revision tag. Fortunately I found a way to do same thing.
You can use this:

$ git rev-list yourbranch -n 1 --first-parent --before=YYYY-MM-DD

I.e.:

$ git rev-list master -n 1 --first-parent --before=2009-05-20
c06326c73bf90e48a8e1cf8893ad31c575423f50

Now just use the returned hash to checkout that revision:

$ git checkout c06326c73bf90e48a8e1cf8893ad31c575423f50

Also you can execute both command using a single line:

git checkout "`git rev-list rev -n 1 --first-parent --before=YYYY-MM-DD`"

Source:
http://kerneltrap.org/index.php?q=mailarchive/git/2008/2/11/817714/thread

Creating patches using CVS

Today I needed to create a patch to LTIB build system, oh gosh, LTIB uses CVS to version control.

LTIB people suggest me to use “cvs diff -u” to create patches, but it is not too easy as it appears. If you haven’t write access to repository, “cvs diff -u” will only works to existent files on CVS server which you change in your local copy.

Then if you create a new directory and a new file you need other approach. You need to install cvsutils to get the command “cvsdo”. The cvsdo will pretend to write the CVS entries and the normal cvs will think these files really exist on external repository.

Then this is the tip:
* First modify the file which already existent on repository;
When you got finished, execute:
$ cvs diff -u > ~/mymod.patch

* Create the directories and files you want;
Then execute:
$ cvsdo add newdirectoryadded/
$ cvsdo add newdirectoryadded/newfileonthisnewdir.c
$ cvsdo diff newdirectoryadded >> ~/mymod.patch

I hope there is some other easy way to create patch using CVS, but on my searches I just found it.

This is because I love git, I don’t need recreating wheel to get it working.