Sunday, September 9, 2012

Debian Kit: Debian Squeeze/Ubuntu[Lucid/Precise] on your Android device

Because my very trusted and loyal IBM/Lenovo Thinkpad X60s has been "deskridden" for quite a while now, so to speak, I now turn to my Asus Eee Pad Transformer TF101 as my new mobile computer. Here are its basics:
  • It runs Android 3.0 Honeycomb when I bought it, but currently it's running on the custom Android Revolution 4.0.3 ICS ROM, though "custom" doesn't seem like the right word here as they [Android Revolution] tries to keep themselves looking stock-like.
  • It has a dual-core Nvidia Tegra 2 CPU, clocked at 1GHz a core.
  • It has this shiny dock with a shitty keyboard, but still, it sure beats having to use a software on-screen keyboard.
  • Did I mention the keyboard also serves as a second battery?
If you want more info on my Transformer, you're better off Googling it yourself and reading about them elsewhere.

The Transformer has been immensely useful for regular productivity tasks. The default browser, strangely named "Browser", and which I assume is based on the FOSS Chromium browser code, works well enough, though I keep Google's own Google Chrome browser with me as well (it's shinier, damn it). Both of them are great enough for casual browsing. For documents, I can easily access my stuff from Dropbox, though actually getting stuff into Dropbox is quite uncertain (though there are some workarounds for this). Polaris Office seems to be sufficient enough for basic document editing, though I'd like to liken it to a word processor built for a Vtech kid's "laptop". So most of the time I'm editing my documents through Google Docs, or not at all, since I hate word processors.

But I'm a student of Computer Science, a Software Engineer, and a hacker at heart, so this wasn't quite enough for me. In essence, the original "productivity suite" my Transformer offered to me at the start appears to be more appealing for children ("regular" Android tablet users might say the same thing to people with iPads, but I digress). So I started searching for solutions to my little problem.

My first attempt to fix the problem are, as ashamed as I am to admit it, using ready-to-use apps from Google Play. I got some text editors here and there, though they all sucked and couldn't hold a candle to Vim. I also grabbed a couple of C and C++ compilers, because sometimes I some code prototyping and I occasionally teach and help a certain list of people how to code. I also installed "Scripting Language for Android", or SL4A for short. SL4A, as far as I can understand, is a collection of interpreters and such for different scripting languages, most notably, Python and Perl; that you can run on your Android device, though it seems that native Android app development using scripting languages is still pretty much uncertain (sorry folks, you'll still have to live with Java).

But I wasn't satisfied with those yet. I preferred working in a command-line interface, so I needed a good terminal emulator. Unfortunately the one that you can easily get from Google Play will most definitely suck if you do not have root permissions on your device (this was before I decided to root the Transformer). Fortunately, there's Terminal IDE, a suite of command line software development tools that run on its own userspace. However, being jailed in its own userspace has some distinct disadvantages, one of these is that fact that everything in Terminal IDE is being jailed in its own userspace.

I tried SSH'ing remotely into my Thinkpad as well, though this effectively turns my Transformer into a dumb terminal, plus the Internet connections of the Philippines are too shitty to effectively maintain a stable remote connection.

Debian Kit


After a lot of lurking around on the web, however, I've discovered Debian Kit for Android. This little solution puts a complete GNU/Linux Debian installation inside your Android device, allowing it to work side by side with the Android OS, rather than, say, completely replacing or dual-booting alongside it.

The idea of a GNU/Linux distribution running inside Android isn't particularly new, however. Numerous people have gone lengths to do the same, though their solutions usually boils down to chroot'ing the distro inside Android. This means the distro will run in its own little "virtual environment" inside Android. The big disadvantage in this approach is that the distro's world is limited to that little environment, which means you'll have difficultly accessing the files on your Android device's SD card, etc.

Debian Kit does this differently. According to its creator, Debian Kit effectively makes Debian/Ubuntu run side-by-side with Android through cleverly-made symlinking and bind-mounting. It will allow you to access the different storage devices present on your Android device, which is extremely important, at least for me.

I won't be writing instructions on how to set up Debian Kit on your Android device here. If I did it would be completely redundant and unnecessary. The creator of Debian Kit has written adequate documentation regarding the installation and my install worked after I did one or two read throughs. Also, he made some screencasts for the people who does not RTFM.

Though, there is one important thing that he forgot to document, and that is manually adjusting Debian/Ubuntu's timezone. On a regular installation procedure of Debian, the installer automatically sets this up for you, but in Debian Kit this isn't present, so your timezone is automatically set at UTC +0. This is fine for you people living somewhere in the UK, but not for everybody else who aren't. This has been a pain in the ass for me for a long time until I finally found a solution through a bit of Googling.

The solution for the borked timezone is the here (courtesy of Geek Ride).

Right now I'm reinstalling Debian Kit on the Transformer because I thought by doing so, I could fix the timezone, but no it didn't, so now I'm about to configure everything again. Thankfully the only thing that's a nuisance to replace is my SSH key, but that should be easy to regenerate and remanage.