Tuesday 8 February 2011

Ubuntu on the Toshiba AC100

I recently replaced my beloved but aging EeePC 901 with a shiny new Toshiba AC100.
The nice thing is that it runs Android 2.1 which means a) I had a nice excuse to buy it (my Archos 5 has only 1.6 with no upgrade in sight... and of course I *need* a halfway current Android device for development ;-) ) and b) that most people think it sucks many of which sell theirs again on Ebay for real cheap.
The problem is that it runs Android 2.1 which really is not such a great choice as a netbook OS (and to make matters worse there is no Google market - and no hack to sideload it as far as I know). Thus, while I don't agree with most people regarding the degree to which Android sucks as a non-phone OS (I think it has its merits) I do think that the AC100 is a beautiful gadget that deserves a proper desktop linux installation. Fortunately a few adventurous souls have done most of the explorative work needed for that and put it online. Still, as usual there were a couple of problems on the way. Anyways, this is how I did it:

The main HOWTO sits on http://tosh-ac100.wetpaint.com/page/Ubuntu, however it is aimed at installing Ubuntu on an SD card and uses an older kernel. There is a newer kernel by phh available here, with accompanying instructions for installing onto the device's SSD.

installation

Everything worked fine up to the point where I wanted to boot the newly installed boot image which lead to this cryptic message:
Waiting for devices ... done
/bin/sh: can't access tty; job control turned off
and a shell prompt. First I thought the problem was that I had used the newest update of the boot image, but the generic phh image had the same problem. It took a bit of fiddling and research but in the end a post in this thread lead me in the right direction.
Disassembling the boot image into kernel and ramdisk (following this guide) I found out that there were two distinct problems producing the same symptom: the older boot image did not check for /sbin/init on the right partition (mmcblk0p6 in my case) while the newer one did not have the right kernel arguments to recognize the partitions in the first place (see here). After I had just reassembled the new boot image with the proper kernel args everything worked fine.

(some) fine tuning

Most things worked out of the box after the install completed (notably sound!), however I had neither wifi nor suspend (there was also a problem with the touchpad but that disappeared mysteriously after a while...).

wifi
Following the discussion in this thread I put together a simple script which gets called from rc.local:
#!/bin/bash

/etc/init.d/network-manager stop
/etc/init.d/networking stop
echo 1 > /proc/test_program/wifi3g
/etc/init.d/networking restart
/etc/init.d/network-manager restart
suspend
The instructions in the HOWTO work like a charm except that lid-switch-daemon doesn't take an option '-d' - just '-s' is fine.

backlight
The instructions in the HOWTO are a bit vague. In fact the light_05 command takes an rgb value as argument with intensities between 0 and 255. This script will take a single value (0-255) and call light_05 with the right argument:
#!/bin/bash
light_05 $(( $1 + $1 * 256 + $1 * 256 * 256 ))

what doesn't work (yet)
  • shut down - doesn't seem to do anything (see below)
  • CPU scaling - as far as I know
  • dim screen on idle - should be doable
update [10/02/11]:
  • I found two new places with documentation - the kernel tree on gitorious actually has a wiki; and there's a new wiki being set up on linad. Now they all just need to merge their info...
  • Shut down works (see comments section)
  • I added a hook for pm-utils to dim the backlight on battery. Just put this:
    #!/bin/bash

    if [ $1 = "true" ] ; then
    /usr/sbin/dim_ac100 100
    else
    /usr/sbin/dim_ac100 255
    fi
    in /etc/pm/power.d/00backlight (assumes /usr/sbin/dim_ac100 is the backlight script mentioned above)