Libertando uma Fonera

A minha velhinha Fonera 2100A já mais que merecia ser libertada, mas só recentemente a libertei das amarras proprietárias da Fon. Procurei pelas instruções no wiki do OpenWRT para a modelo 2100A, mas o “oldwiki” do OpenWRT peca precisamente naquele problema que os Wikis por vezes têm a tendência em falhar: comentários pelo meio do texto importante, algumas experiências documentadas de forma confusa, etc.

Daí que após algumas procuras mais, encontrei um excelente site com uma explicação passo a passo, embora ainda assim necessitasse de alguns ajustes. Segue então o que eu fiz diferente, de acordo com a numeração da explicação:

1: Recuperar o acesso ao sistema.

  • senha do root: estava com um problema… mudei recentemente a password e esqueci-me. Felizmente podia recuperar o firmware original pressionando no ‘reset’ durante cerca de 30s.
  • controlo do sistema: a forma de recuperar a senha do root também recuperava o sistema original, a release 0.7.1 r1, cujo interface web é vulnerável à injecção de comandos, permitindo iniciar o servidor de ssh. As instruções aqui são para 0.7.2 r3, mas envolvem o downgrade para a 0.7.1 r1, bastando começar a partir desse passo em vez de desde o início.

2: remover o DRM substituíndo o bootloader

No meu caso o 3º passo não funcionou, onde então foi necessário saltar o 4º passo, fazer o 5º e o 6º, por fim voltando ao 2º e 3º.

3: instalar o OpenWRT
Para mim os tamanhos especificados para as partições não batiam certo, ficando com espaço a menos. Receando fazer uma asneira que tornasse a Fonera num “tijolo”, procurei por mais gente com o mesmo problema e encontrei umas boas sugestões de tamanhos, que me permitiram completar a instalação com sucesso:

RedBoot> fis init
About to initialize [format] FLASH image system – continue (y/n)? y
*** Initialize FLASH Image System
… Erase from 0xa87e0000-0xa87f0000: .
… Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-root.squashfs
Using default protocol (TFTP)

Raw file loaded 0x80040800-0x801e07ff, assumed entry at 0x80040800
RedBoot> fis create -f 0xA8030000 -l 0x006F0000 rootfs
… Erase from 0xa8030000-0xa8720000: …………………………………………………………………………………………………
… Program from 0x80040800-0x801e0800 at 0xa8030000: ……………………..
… Erase from 0xa87e0000-0xa87f0000: .
… Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
Using default protocol (TFTP)

Raw file loaded 0x80040800-0x801007ff, assumed entry at 0x80040800
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
… Erase from 0xa8720000-0xa87e0000: …………
… Program from 0x80040800-0x80100800 at 0xa8720000: …………
… Erase from 0xa87e0000-0xa87f0000: .
… Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> fis load -l vmlinux.bin.l7
Image loaded from 0x80041000-0x80282085
RedBoot> exec

Lançado o exec, que ainda demorou cerca de 20 minutos, tinha uma Fonera com OpenWRT pronta para o que necessitasse.

Neste momento tenho-a preparada para 2 cenários:

  1. partilha do meu acesso à Internet (melhor que a rede Fonera por ser aberta), mas não a tempo inteiro 🙂
  2. partilha de um link de rede para algum evento.

OMNewRotate 0.5.4 is out!

Today I released omnewrotate 0.5.4, which fixes issues 5 and 6

As I am testing the latest 2009 test image, I’m glad to announce that it still works fine with current FSO, but Paroli looks really bad when it goes landscape.

I’ve also added a “-p” (for powersaving) flag, oriented towards activating, well, more conservative approaches such as reading the accelerometer data not so frequently (which directly implies less responsiveness, but it was asked for).

As usual, the download links are at the project’s Google Code site for omnewrotate (see the featured downloads section):

Enjoy!

FIT-PC2 is worthless for Free Software business

FIT-PC2 looks quite interesting for making a Free Software multi-media product which could be sold. It’s small. Looks good, has enough interfaces for your needs, and is powerful enough to play FullHD quality movies. nice huh? Except that it will only work on Linux 2.6.24. Except that it will only work on some version of Xorg. Why? Because it uses an Intel GMA500 as it’s graphics card which is, up to today, only supported through either VESA or a proprietary driver.

Now, since the proprietary driver will hold you back to nearly obsolete software, it’s not a possibility. Since VESA is quite the last resort, forget about playing FullHD movies as the hardware decoder will not be available. You’ll only be able to count on the CPU, which isn’t strong enough.

I wrote them asking whether they’ll make a better model in the future, but I can only take their answer as either a sign of sad ignorance or petty insult. Therefore, I strongly recommend against buying the Fit-PC2, or any other device containing an Intel GMA500.


From: Rui Miguel Silva Seabra
Sent: Saturday, April 18, 2009 7:44 PM
To: info@fit-pc2.com
Subject: FIT-PC2 but without GMA500

Hello,

I was very interested into launching a product with something very
similar to the FIT PC2, it almost fit the bill perfectly.

But it has an Intel GMA500 which doesn’t work with Free Software, so it
is impossible to provide good support for it.

Will you do a better model?

Thanks,
Rui

So, the least I could expect is a «No, Sorry.» but hopefully I’d get an «We’re aware of the issue, and we’re studying alternatives.», huh? Well, no… this is what they preferred to answer:


Date: Mon, 20 Apr 2009 17:54:54 +0300
From: fit-PC2 info
To: Rui Miguel Silva Seabra
X-Mailer: Microsoft Office Outlook 12.0
Subject: RE: FIT-PC2 but without GMA500

Hello,

Thank you for your interest in fit-PC2.
GMA500 works in Linux with open source VESA drivers or with proprietary Intel drivers.
We do not intend to offer a different HW architecture in the near future.

Best regards,
«Name Withheld by me»
fit-PC Support Engineer

I guess the bold parts say it all, don’t they? Here’s my answer:


From: Rui Miguel Silva Seabra
Date: Mon, 20 Apr 2009 18:26:29 +0100
To: info@fit-pc2.com
Subject: Re: FIT-PC2 but without GMA500

Hello,
Thank you for your quick answer.

I must however point out that claiming GMA500 works with GNU/Linux with
VESA is tantamount to undue sarcasm as it will render the chip virtually
useless for multimedia stations.

I must ALSO point out that claiming GMA500 works with GNU/Linux with
proprietary drivers is misleading, at best, since it will only work with
very specific versions of the kernel Linux and the Xserver it was
prepared to work with.

Since you do not intend to offer a different HW architecture in the near
future, I must indeed question whether your reply was truly void of
insult as both options are quite useless.

Best regards,
Rui

OMNewRotate 0.5.3 is out!

Today I released omnewrotate 0.5.3, which fixes issue 4.

As I was starting to investigate libframeworkd-glib, that dependency was a problem for usage in the recently released Om2008.12 (basically, it wouldn’t run at all).

As such, I added a “–without-frameworkd” to the ./configure script, which I used for building the ipk of this release (OpenPGP sig).

Another good thing about this release, is that its tar ball (OpenPGP sig) is now the result of make dist. This should be a great bonus for integration with hackable:1, which is still using a pretty old version of omnewrotate. Just don’t forget to include “–without-frameworkd” in the configure process (I plan to have this detection done automatically in the future).

Enjoy!

OMNewRotate 0.5.1 is out!

Hi,

I’ve just release a new version of OMNewRotate (source, it’s OpenPGP signature, an ipkg tested agains FSO M4.1 and it’s OpenPGP signature), the ‘Automagically Lazy Edition’ because it’s just like the ‘Lazy Edition’ but with Autotools magic. Yes, I know it doesn’t work well with suspend. I’ve just gotter suspend to work on my OpenMoko, so expect that it is fixed by 0.6.0.

From the ChangeLog:

2008-12-09 - 0.5.1 - Automagically lazy
	* same as 0.5.0 plus auto tools magic
	* desktop icon
	* places a starter script

OpenMoko NewRotate 0.5.0 ‘Lazy Edition’ is out!

Hi,

I’ve just release a new version of omnewrotate (OpenPGP signature), the ‘Lazy Edition’ because it uses so much less CPU than any version I did before. Oh, I forgot to mention it in the release commit, but at least with FSO M4 I’m getting a very stable rotation BUT if the screen looks garbled, please wait a few seconds until the graphic user interface adjusts to the screen changes. I don’t think I can do much about that…

From the ChangeLog:

2008-11-19 - 0.5.0 - Lazy edition
        * uses a second thread for reading the accellerometer packets
        * drops Fabian's changes (not that they weren't good, just not
          needed any more)
        * adds flags (look at display_help() or ./rotate -h)
        * drops packets with 0 value coordinates (I got bogus packets
          like that so I decided to drop them, if you feel you get good
          packets with 0 value, you can use '-0' as an argument to take
          them in account).
        * top -d 1 -p PID shows 0.0% CPU usage (of omnewrotate) even
          during rotation
        * seems to waste a little too much memory (some stuff could be
          done with one number and bitwise operations instead of several
          numbers, I wonder how much that will improve and if it's worth
          the effort...)
        * only output outside of debug mode are real errors

OpenMoko newRotate checks brightness

Oscar Casamitja patched the old rotate program to change brightness on rotate in order to better hide xrandr’s artifacts. That’s actually a very good idea.

This new version reads from actual_brightness and set into brightness, which you can find in /sys/class/backlight/pcf50633-bl/ , in order to skip packet reading when the screen is dimmed, which is the next best thing to checking wether the screen is locked.

I run into a problem, though: it seems that if I open() actual_brightness once, I never again read an updated value, which makes me have to read on every loop 🙁

Enough talk, get it here: rotate-0.3.0.tar.gz (ascii sig) [now, if only this bug was fixed on projects.openmoko.org…]

Hope you’re enjoying it… 🙂

$ head -2 ChangeLog
2008-10-14 - 0.3.0
	* dims while rotating and doesn't rotate if dimmed, sleeping for 5s
$ cat KNOWN_ISSUES
Known Issues:
	* I'm not getting updated results if I only open
	  /sys/class/backlight/pcf50633-bl/actual_brightness once
	  which means I need to open it on every cycle.
	  Since it's in memory and not an actual file, wast should
	  not be too much
	* some heuristic values may need fine tunning

OpenMoko Rotate 0.2.1

Yes, it’s out, release early, release often, yadada yadada. I’m grumpy because of less sleep time than usual, and a whole day of ITIL Foundation V3 lesson (3 more days of it, plus an exam later on).

Get it here: rotate-0.2.1.tar.gz (signature)

Anyway, here’s the good news:

$ head -5 ChangeLog
2008-09-22 - 0.2.1
        * more heuristic fixes (hopefully really fix when laying around, and
          turned up)
        * workaround with alarm() for the accelerometer read-hang problem
        * sleeping for 100ms seems to get cpu usage quite low (0% to 0.9%)