Thursday, December 2, 2010

WeTabOS to pure MeeGo

OK, I must warn those who are reading this text: more than I'm used to, this post is going to be really nerdy, maybe not in the best meaning of the term. This post will describe in details how to remove the WeTabOS from the WeTab internet tablet (http://wetab.info).

Brace yourselves, and get a lamp 'cause there's gonna be some grues.

First, why wouldn't I want to use the WeTab OS? Well I found the Graphical User Interface truly horrible, lacking any ergonomics engineering. While the core of the system, based on MeeGo, seemed to be good and usable (hey, a terminal accessible from the WeTab Market! Adobe Air supported out of the box!), the G.U.I. just didn't made it. The right panel always visible, the ugly virtual keyboard, I could go for hours. Ok, maybe minutes, but STILL.

Being a geek, I also wanted to try some other tablet operating system (or linuxes particularly packaged for these tablets, like JoliCloud). I use a N900 phone every day, so MeeGo, the successor to Maemo, seemed the way to go. I grabbed a disk image on their website (http://meego.com/), took the one with Chrome Browser (labelled "MeeGo v1.1 for Netbooks (Google Chrome Browser)")(there's a E.U.L.A. http://download5.meego.com/netbook/meego-v1.1-netbooks-google-chrome-browser). There's a good how-to for creating your own USB booting device, there: http://meego.com/devices/netbook/installing-meego-your-netbook, the guide is pretty straight-forward and adapted to all operating systems. The partition table of your USB drive can be either MBR or GUID (I tried with both) thanks to the WeTab having an Extensible Firmware Interface 'bios'.

Now that you have your USB drive, it's time to prepare the WeTab to boot on it. Simplest way: using the PLOP bootloader, instructions here: http://wetabz.blogspot.com/2010/10/using-plop-boot-manager.html. Basically, all you have to do is download a binary of PLOP here, copy the .img and the .bin to /boot/extlinux/, and add the entry to /boot/extlinux/extlinux.conf with vim or gedit (sudo is your friend here).

label plop
menu label ^plpbt
KERNEL memdisk
INITRD plpbt.img
menu default

I removed the "menu default" from the WeTab OS entry and added it to PLOP, just to be sure that if the keyboard isn't recognized I'll be able to boot PLOP.

So, that's it. Plug your USB drive, reboot the WeTab, don't forget to plug it to its AC adapter, and to maintain the 'soft' button as soon as the blue led lights up, and select the 'plop' entry (the quickstart button (the thingy on the upper-left of the WeTab, near the camera) can act as a selector in PLOP: one push to go down, hold to select the entry). If everything goes well, the MeeGo boot menu should appear. It didn't worked when I choose "try MeeGo", so I did an install (I already tested that in a virtual machine in OSX to be sure), and I entirely removed the WeTab OS. It should be feasible to dual- or triple-boot (plop is good for these kind of things), but I didn't wanted to spend disk space for multiple OS. Anyway, once the image is copied on the WeTab's disk, you can reboot. If you haven't done that before, now is the time to plug your USB keyboard in the WeTab.

At that point I had an error at boot, the famous "init: Id "x" respawning too fast: disabled for 5 minutes.". Just shut down the device, wait for a few seconds, and reboot.
If there's an error, or you have to leave the first screens of the MeeGo boot, don't panic: at the startup prompt, login as 'root', password 'meego', and type 'firstrun' on the command line, it'll relaunch the registering process for the new user.

Then, to activate the virtual keyboard! Again, MeeGo's website is useful for that. Basically what you have to do is add repositories to the package manager, and refresh the repositories :

$ sudo zypper addrepo http://repo.meego.com/MeeGo/releases/1.1/handset/repos/ia32/packages/ handset
$ sudo zypper refresh

then, do a '$ sudo zypper install meegotouch-inputmethodbridges', and '$ sudo zypper install meegotouch-inputmethodkeyboard'. You can do that either by plugging an USB mouse to the WeTab and selecting the Terminal in the Applications menu, or switching to the command prompt by alt+F2 or ctrl+alt+F2.
Now we are going to say to the system that it can use another input method by modifying /etc/xdg/autostart/meego-im-uiserver.desktop, adding the '-target name' and the "X-MEEGO-NB" at the end. name refers to an entry in /etc/meegotouch/devices.conf. For the WeTab, good values are 1366x768 for the X and Y resolution, and 250 and 200 for ppiX and ppiY.
Reboot! ('$ sudo shutdown -r now' or ctrl+alt+backspace)

Now you should have a working virtual keyboard! Congrats.
For the hard but last part: getting the touchscreen to work! Yeah, that thing didn't worked, from the first boot. MeeGo chooses to attribute to it a USB driver, and that is not working. At all.
So, another helpful post from Samiux's Blog, http://samiux.blogspot.com/2010/07/howto-ubuntu-1004-on-gigabyte-touchnote.html, is going to help us a lot. If you choose to install Ubuntu or some other GNU/Linux distribution based on it (Kubuntu, etc.) then you're in luck, because that bug has already been patched in the main branch (read the informations here).

Alas, we have to get dirty again. if you look closely, the post from Samiux's blog describes its touchscreen as a 'Bus 005 Device 002: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen', on the WeTab it's a 'ID 0eef:72a1 D-WAV Scientific Co., Ltd' (to check that, run a '$ lsusb'). We have to change the instructions in order to make it work.

In /etc/modprobe.d/blacklist.conf, add this line : 'blacklist usbtouchscreen'.

Another thing that changes is that MeeGo doesn't rely on GRUB to boot: the WeTab has an EFI 'bios', so it's extlinux again (I say again because the WeTabOS uses it too) that manages the boot. Instead of the 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.noloop=1 usbhid.quirks=0xeef:0x1:0x40"' described on Samiux's website, we have to append this after the last line in the first entry: 'i8042.noloop=1 usbhid.quirks=0xeef:0x72a1:0x40'. Note that I changed the second hexadecimal value to match the one from our 'lsusb'.

You also have to add a file in the /etc/X11/xorg.conf.d/ section. '$ sudo nano /etc/X11/xorg.conf.d/05-evdev.conf' (or whatever your preferred editor is, at that point I had already installed VIM) (again, thanks to Samiux), and add in this newly created file:

Section "InputClass"
Identifier "eGalax"
MatchProduct "eGalax"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "SwapAxes" "off"
Option "Calibration" "2 4100 11 4099"
EndSection

Another thing that changes: it's not Debian, so we don't have to create the .deb for xinput_calibrator like Samiux describes. Just a '$ sudo zypper install xinput_calibrator' will do the job.

Now you can reboot and enjoy the touchscreen.

And... That's it! Now you can play with it, install OpenOffice (really easy) and Firefox, impress your friends, patati patata.

P.S.: It may (or may not) have been easier to just remove the 4tiitoo UI from the WeTabOS and put MeeGo's one in place, but I'm really not sure about that. Let's say that technically, it should work (after adding the MeeGo repositories to yum, deleted everything related to tiitoo, then having installed MeeGo's UI).
Do not hesitate to ask questions here about the procedure or about MeeGo, I'll try to answer them as best as I can. Google is also (and always your friend), as are the guys on the MeeGo forum.